logo

It's a whole new world out there

How's this for a foreign concept. You're developing with a product and you find a bug. Nothing strange in that. But, instead of calling a black hole of a support line you open your chat client and see if the developer happens to be online. You see he is and tell him about the bug. Ten minutes later and you've just received a patch. Everything is working as expected. Can you tell what it is yet? Indeed, it's Puakma.

Talking of Puakma and foreign concepts I am currently switching mindsets from flat to relational data. Not all that easy for somebody who's been a Notes developer for just about the whole of their career. As I've been finding SQL is a right royal pain. Maybe developing on MySQL for a target platform of PostgreSQL isn't such a bright idea after all. Something tells me my fun has only just begun and that this book will end up with a lot of dog ears. As will this one. Note to self:

if ( ActionDocument.getItemValue( "ContactStatus" ) == "I" )

Is NOT the same as:

if ( ActionDocument.getItemValue( "ContactStatus" ).equals( "I" ) )

In writing this out I am hoping I will never again spend two hours scouring at my code convinced there can't possibly be any errors.

Comments

  1. Jake,

    henceforth, you shall be known as Puakman.

    • avatar
    • Jake
    • Wed 9 Apr 2003 09:45

    I think we should reserve that honour for Erwin who owns the first Puakma based blog {Link} in the world and a range of PMX merchandising - {Link}

    • avatar
    • Erwin
    • Wed 9 Apr 2003 10:02

    Thanks Jake... I'm not worthy... ;-)

  2. As unlikely as it may sound I got a very similar service from Microsoft.

    I'd had a problem with blips in cd music, played only with media player, they used a flash version of the messenger client and were able to talk you through suggestions etc!

    For MS - I thought that was very good.

  3. Jake,

    Practical Java, by Peter Haggar, formerly of IBM, is a ver good reference. It's mostly a programming guide. The book is divided into Praxis rather than chapters. I knew exactly what you meant with regards to = not equal to .equals as a result of reading this book 4 years ago.

    Pete is also pretty good about answering emails.

  4. I like the fact that equals() means whatever I want it to -- overriding is just about my favorite thing in the whole world (next to overloading, that is). Gotta watch the old polymorphism, though -- some objects are more equals() than others....

  5. BUGGGSSS???!! Those were "undocumented features"!

    Next week we'll work on:

    if ( ActionDocument.getItemValue( "ContactStatus" ).equalsIgnoreCase( "i" ) )

    ...and getItemValue() may return a null which can get you into all sorts of trouble ;-)

    I have to admit, chat is fantastic for this kind of distributed development.

    Brendon.

  6. I have a professor that says that everytime he teaches a C programmer SQL it always starts with the C programmer taking a quick look at all those simple UPPERCASE commands and saying something like, "Give me five minutes, and I'll get this all sorted out." Then thirty minutes later they are still working out the first JOIN conditions. All I know is that when I skip from DB2 to MYSQL, code of any complexity seems to fail. I love the ease of MySQL, but if your target is Postgres, and you have RedHat, I would get the rpm distribution of the Postgres system and stay with that for your work.

    The other wonderful tool I have appreciated is a query writer. The one we use is Showcase (not at all open source, unfortunately). It does a lot of clean-up behind me patching up my almost correct SQL. I do a lot of SQL editing and major surgery in the vi editor, but for some tasks I love having the OLAP tool pick up after me. I wonder if there are any good open source equivalents.

  7. All of you struggeling with such issues as the one Jake reported should get into the habit of writing the constant on the left instead of on the right.

    An example should clarify what I mean. To test whether an item is empty write:

    if (null == doc.getItemValueString("Form") {

    ...

    }

    instead of:

    if (doc.getItemValueString("Form") == null) {

    ...

    }

    There doesn't seem to be much to this other than it looks wierd... :-) The purpose of wrinting it like this is twofold:

    1. If you by mistake do an assignment (=) instead of a test for equality (==) it will be caught by the COMPILER since you cannot assign a constant to to variable.

    2. I find that once you get into habits like this the frequency doing the String-equality-test-error is reduced (some_string == "abc123").

    Thats my two cents...

    lekkim

    • avatar
    • me
    • Fri 9 May 2003 14:18

    Jake == Puakapimp...

    ;-?

    • avatar
    • Jake
    • Fri 9 May 2003 16:40

    if (!LastPoster.getRealName().equals("me"))

    {

    goto(hell);

    }

  8. Humm.... Jake, In Java normally the sintax is with the first letter in lowercase, so you are throwing and exception at line 1.

    Your second error is the "hell" variable since is not defined, and the Javadoc for that program says that the syntax for the error method is:

    public void goto(String place){

    //Your code goes here

    }

    Replace with:

    if(!lastPoster.getRealName().equals("me"))

    {

    String hell = new String("Hell");

    goto(hell);

    }

    Just my two cents, as you can see my java is weak :-S

    .::AleX::.

    Dominocode.Net

  9. No no no! Goto? GOTO?!?!??!

    • avatar
    • Erwin
    • Mon 9 Jun 2003 03:47

    I guess instead of

    goto(hell);

    this would be better in terms of java:

    if(!lastPoster.getRealName().equals("me"))

    {

    lastPoster.moveToLocation(Hell);

    }

  10. I'd have checked the object with getStuffed() first....

    • avatar
    • Henk
    • Mon 9 Jun 2003 19:10

    Jake,

    Since you're using Eclipse, maybe this plugin {Link} could come in handy. It supports both MySQL and PostgreSQL.

    Henk.

    • avatar
    • Jake
    • Wed 9 Jul 2003 06:37

    Thanks Henk. That looks like a must-have to me. Trouble is I can't get it to run with Eclipse 3. Do you know if it's supported??

    • avatar
    • Henk
    • Wed 9 Jul 2003 08:53

    I'm sorry Jake, I don't know. I'm using Eclipse 2.1.1 myself, as probably should you, because Eclipse 3 hasn't reached alpha yet.

    It wouldn't surprise me a bit if many plugins don't work with Eclipse 3. And it's a shame missing out on 369 available plugins

    {Link}

    I asume you used the update manager to install the Clay plugin and installed GEF first?

    Anyway it works perfectly with Eclipse 2.1.1

    Good luck,

    Henk

    • avatar
    • craig
    • Sat 9 Aug 2003 13:42

    if ( ActionDocument.getItemValue( "ContactStatus" ) == "I" )

    Is NOT the same as:

    if ( ActionDocument.getItemValue( "ContactStatus" ).equals( "I" ) )

    Well it oughta be! That's why God invented operator overloading.

    And why isn't HTML allowed? I wanna underline and <blink>

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Thu 4 Sep 2003

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content