Thursday, December 6, 2007

Google Charting API

Google has just released an interesting, easy to use charting API.

Very simple example:


img src:
http://chart.apis.google.com/chart?
cht=p3&
chd=t:42,42&
chs=250x100&
chl=Panic|Don't&
chco=83B627,669922

The following types of charts are available:
  • Line chart
  • Bar chart
  • Pie chart
  • Venn diagram
  • Scatter plot

Read more about it here

Wednesday, December 5, 2007

I love Ray Ozzie

Well, actually I don't love Ray Ozzie, but someone does.

Just spotted this t-shirt on Amazon.com:

Tuesday, December 4, 2007

Rant about the apparent lack of "serious" Notes/Domino programmers

Started of as a comment on "The reason the Domino Development Platform Isn't Taken Seriously", where Craig asks if it's time for the DominoDevs to grow up. My rant is also influenced by the comments posted on Nathan's "Sanity Check" that OO is the way to go/most N/D developers are lazy.

Start rant:
This is just a wild guess, but don't think that the majority of N/D developers are willing/able to make the effort to write "serious" code.

Then again, how many applications need the complexity that is Java/OO/Inheritance/MVC/etc?

The recent discussions on the future of N/D remind me a lot about discussions about JavaScript, which also has had the toy stigma for most of it's life.

It's not until the Ajax-term is coined by a well respected person in the community, Jesse James Garrett, that suddenly JavaScript is THE language to learn. Then Douglas Crockford steps in and show the "serious programmers" all the amazing stuff you can do in JS, and all of a sudden, all platforms must have JavaScript.

Now the "serious programmers" want to tighten JS (with EcmaScript 4), and make it more serious (or more precisely, make it fit their world..?).

JavaScript is a forgiving language, just as LS. There is a lot of awful code being written in JS, making sites/applications brittle/insecure. If you force strong typing/classical inheritance/etc. on all JavaScript-developers (as some feel that EcmaScript 4 will), how many are you going to have left? Will the tightening of the language be worth the loss? Is the proposed tightening of the N/D-platform going to be worth the loss of less advanced programmers?

I believe that what we as a community (and Notes/Domino as a platform) need, are people who love and understand what is great about the platform, and also are able to sell the concept to developers -and- IBM. Until I see the next designer, I'm firmly convinced that the decision makers of Lotus/IBM doesn't understand what is great about the platform. From looking the latest releases (6/7/8), they see it as a collaboration/mailing platform. N/D isn't great because IBM has made a great mail/calendar application with it, but maybe the mail application is so great because of the (mysterious/genious) concept that is Notes/Domino..?

Regarding lazy/untrained developers:
Great code != Great application from the users perspective, just as Horrible code != Horrible application. Great code will probably lead to a more stable/secure/maintainable/expensive application.

If you want N/D developers to write serious code, and you believe you know how to teach them, why not go together with other great minds and write a book to enlighten them? There must be publishers willing to still publish N/D books..?

With all the Agile development books coming out recently, where is "Agile application development with Notes/Domino" (horrible title, I know).

Other titles I'd like to see:
"Web 2.0 with Domino" (although I hate the term web 2.0, it sells)
"Rich Internet Applications with Domino"
"Enterprise applications with Domino 8"
"Object Orientated programming in LS for dummies"
"Taking advantage of DB2 with Domino 8"
etc. etc.

/rant

Friday, November 30, 2007

Rant about Notes 8, Lotus/IBM

Nathan writes "Where is the love".

More and more, I think, "Where is the hate?" :)

I was on the point of starting a rant in the comment section on the post, but after half an hour of writing/rewriting my frustrations with (my perceived) impression of IBM/Lotus directions, I decided to keep the rant on my blog.

Every week 5+ blogposts enter my RSS-reader about how great Notes 8 is. Almost nothing about the bugs/bad integration between the new client and Domino Designer (maybe I am the only one having problems), or how, once again, the majority (the non-java) of developers were screwed over in a release.

What mostly irritates me is that the scripting tools in Domino Designer has less functionality your average notepad-clone. You (Lotus/IBM) want me to learn Java? Then give the Designer team the resources to make tools that doesn't stink of the 1990s.

It doesn't make me happy when I think about how much resources they probably put into making 100+ different-looking icons look more or less like one (orange-ish) icon.

From my point of view, it looks like the marketing-department in Lotus/IBM has a LOT more power/resources than the developers of Notes/Domino.

Most of what's great in Notes/Domino has been there since pre version 7. Of all of the things the developer-community has asked for (in partner-/public forums), what has been implemented?

Domino Designer in Eclipse? Great!! When did you say it's going to be released?

If you want to rant about how wrong I am, please do.. I don't deny that I could be. :)

Thursday, November 29, 2007

Notes/Web JS to get text from aliased combobox/dialog list

Something I needed today. Thought i could share it with you. Easy to make, but sometimes one forgets that Notes supports JS.

>>Flash-demo
I forgot to refresh, so the alias doesn't show :)

The reason I didn't use "Refresh field on keyword change" is that it's awful on web (reloads the page).

The alias of the combobox/dialog list was the corresponding number to the text (One|1, etc).

>>Demo-application

In Notes, the code also works with hidden/computed fields. For computed fields, set value = @ThisValue.

For the web, you should probably set the text-field to editable, "HTML Attributes" -> "type=\"hidden\"".

In Notes, onChange fires when the field looses focus/value has changed. On the web, the event fires when you select another value.

JS-header - Common Javascript:

function textFromMultivalue( multival, valuefield ){
var f = document.forms[0];
/*if valuefield is the name of the value-field,
get field from form */
var valuefield = ( typeof valuefield == 'string' ) ?
f[valuefield] :
valuefield;
/*if multival is the name of the multival-field,
get field from form */
var multival = ( typeof multival == 'string' ) ?
f[multival] :
multival;

valuefield.value = multival.options[
multival.selectedIndex ].text;
}

onChange in multi-value field (also Common Javascript):
textFromMultivalue( this, 'name_of_textfield' );

Tuesday, November 27, 2007

Maintaining Strong Typing in LotusScript

Update 28.11.07: Tim Tripcony wrote a somewhat related article about using ByVal for input parameters. Recommended read!

--

Upon reading "Code Complete", I discovered that a way of using Subs I've previously thought of as bad practice, actually is quite normal.

The author writes (I apologize if I interpreted this wrong) that some developers think that functions should be used for mathematical calculations/simple operations and procedures used for more advanced stuff. In LotusScript, from his description, a Sub is a procedure and a Function is a function (duh..).

He also suggest that when you make procedures, you put input parameters (read) first , and output-parameters (modify) second, to make it easier to read the code.


One of the advantages with using subs this way is that you can always maintain strong typing. This enables you to capture coding-errors at compile-time, instead of at runtime.

In the code below:
createToyotas is a sub that has an outputparameter, List As Toyota
toyotas is a function that returns a variant containing List As Toyota


The compiler recognizes that a "Toyota" doesn't have a method "destroyWorld", whereas the variant, also a Toyota, passes through compiling.

Error caught at compile-time with strong typing, whereas the variant doesn't cause an error until runtime.

In most cases you could probably pinpoint the runtime-error quite fast, but catching it at compile-time is preferrable for me at least.

Also, the most common error would probably be a spelling-mistake, not trying to run a random thought-up method.

Performance-wise, there may also be advantages, especially if you're using inheritance/creating many objects/etc.

When debugging there doesn't seem to be much advantage using strong typing over variants.

>> Extremely simple db with some (messy)test-code (test-agent, StrongTypingAdvantage)

If you can think of other advantages, or disadvantages for that matter, please post a comment!