The Fall of Intelligence

September 30, 2005

You all heard about the US gov’t’s desire to have intelligent design taught in science classes, right? Isn’t it ironic that the same politicians deplore the fact that the USA is losing its world-leading position in science in technology? I guess that’s gonna be even more true if you decide to teach the future generations that some “guy” created all life on Earth 6,000 years ago.


September 30, 2005

Stephan Schmidt writes about how he feels more productive in Java than in dynamic languages (Ruby, Smalltalk, Python, etc.) He mentions that a good IDE, such as Eclipse or IntelliJ, will make a developer churn out code much faster. Now, this guy’s been programming in Java for 10 years, and from what I can understand he occasionnaly plays with a few dynamic languages.

I agree that an IDE helps with writing code faster, but in the end, I still think dynamic languages win when it comes to productivity. Let me take ShortURL as an example. When I started ShortURL, my code was very dirty, I created a method per service and just repeated the same code over and over again: this was because I first started the project as a way to scratch an itch and I solved the immediate problem (turning a long URL into a shorter one) as quickly as possible. However, as I started to include more services, I realized that a new problem had arisen: the ease of adding new services. So I went and created a Service class which heavily relies on Ruby blocks. I use a block to override default options and I use another block to tell the method how to retrieve the shortened URL.

Let me show that with code:

rubyurl = Service.new("rubyurl.com") { |s|
      s.code = 302
      s.method = :get
      s.action = "/rubyurl/create"
      s.field = "rubyurl[website_url]"
      s.block = lambda { |body| URI.extract(body)[0].gsub("rubyurl/show/", "") }
}

This is how you can get a shorter URL from RubyURL. The block associated with the Service.new method call overrides the defaults (expected response code, the retrieval method, the FORM action, the name of field into which you type the long URL and, the most important, the block to retrieve the short URL among the HTML code). Adding new services is now extremely easy, I just need to find a new service, look at their HTML source, override the defaults if required and that’s it.

The only utility of an IDE here would be to help me type faster, because I think the code is pretty short, maintainable and to the point. It usually takes me a few minutes to add a new service, and that time is usually spent looking at HTML code. If you wanted to accomplish the same thing in Java, since it doesn’t support blocks, the code would probably be much longer (I’m not quite sure how one would implement it). Therefore, adding services would take a longer time and the programmer would thus be less productive. Not to mention that you’d need to think about things like static typing.

I’ll stick with dynamic languages.


September 30, 2005

Stephan Schmidt writes about how he feels more productive in Java than in dynamic languages (Ruby, Smalltalk, Python, etc.) He mentions that a good IDE, such as Eclipse or IntelliJ, will make a developer churn out code much faster. Now, this guy’s been programming in Java for 10 years, and from what I can understand he occasionnaly plays with a few dynamic languages.

I agree that an IDE helps with writing code faster, but in the end, I still think dynamic languages win when it comes to productivity. Let me take ShortURL as an example. When I started ShortURL, my code was very dirty, I created a method per service and just repeated the same code over and over again: this was because I first started the project as a way to scratch an itch and I solved the immediate problem (turning a long URL into a shorter one) as quickly as possible. However, as I started to include more services, I realized that a new problem had arisen: the ease of adding new services. So I went and created a Service class which heavily relies on Ruby blocks. I use a block to override default options and I use another block to tell the method how to retrieve the shortened URL.

Let me show that with code:

rubyurl = Service.new("rubyurl.com") { |s|
      s.code = 302
      s.method = :get
      s.action = "/rubyurl/create"
      s.field = "rubyurl[website_url]"
      s.block = lambda { |body| URI.extract(body)[0].gsub("rubyurl/show/", "") }
}

This is how you can get a shorter URL from RubyURL. The block associated with the Service.new method call overrides the defaults (expected response code, the retrieval method, the FORM action, the name of field into which you type the long URL and, the most important, the block to retrieve the short URL among the HTML code). Adding new services is now extremely easy, I just need to find a new service, look at their HTML source, override the defaults if required and that’s it.

The only utility of an IDE here would be to help me type faster, because I think the code is pretty short, maintainable and to the point. It usually takes me a few minutes to add a new service, and that time is usually spent looking at HTML code. If you wanted to accomplish the same thing in Java, since it doesn’t support blocks, the code would probably be much longer (I’m not quite sure how one would implement it). Therefore, adding services would take a longer time and the programmer would thus be less productive. Not to mention that you’d need to think about things like static typing.

I’ll stick with dynamic languages.


September 30, 2005

Stephan Schmidt writes about how he feels more productive in Java than in dynamic languages (Ruby, Smalltalk, Python, etc.) He mentions that a good IDE, such as Eclipse or IntelliJ, will make a developer churn out code much faster. Now, this guy’s been programming in Java for 10 years, and from what I can understand he occasionnaly plays with a few dynamic languages.

I agree that an IDE helps with writing code faster, but in the end, I still think dynamic languages win when it comes to productivity. Let me take ShortURL as an example. When I started ShortURL, my code was very dirty, I created a method per service and just repeated the same code over and over again: this was because I first started the project as a way to scratch an itch and I solved the immediate problem (turning a long URL into a shorter one) as quickly as possible. However, as I started to include more services, I realized that a new problem had arisen: the ease of adding new services. So I went and created a Service class which heavily relies on Ruby blocks. I use a block to override default options and I use another block to tell the method how to retrieve the shortened URL.

Let me show that with code:

rubyurl = Service.new("rubyurl.com") { |s|
      s.code = 302
      s.method = :get
      s.action = "/rubyurl/create"
      s.field = "rubyurl[website_url]"
      s.block = lambda { |body| URI.extract(body)[0].gsub("rubyurl/show/", "") }
}

This is how you can get a shorter URL from RubyURL. The block associated with the Service.new method call overrides the defaults (expected response code, the retrieval method, the FORM action, the name of field into which you type the long URL and, the most important, the block to retrieve the short URL among the HTML code). Adding new services is now extremely easy, I just need to find a new service, look at their HTML source, override the defaults if required and that’s it.

The only utility of an IDE here would be to help me type faster, because I think the code is pretty short, maintainable and to the point. It usually takes me a few minutes to add a new service, and that time is usually spent looking at HTML code. If you wanted to accomplish the same thing in Java, since it doesn’t support blocks, the code would probably be much longer (I’m not quite sure how one would implement it). Therefore, adding services would take a longer time and the programmer would thus be less productive. Not to mention that you’d need to think about things like static typing.

I’ll stick with dynamic languages.


September 30, 2005

Stephan Schmidt writes about how he feels more productive in Java than in dynamic languages (Ruby, Smalltalk, Python, etc.) He mentions that a good IDE, such as Eclipse or IntelliJ, will make a developer churn out code much faster. Now, this guy’s been programming in Java for 10 years, and from what I can understand he occasionnaly plays with a few dynamic languages.

I agree that an IDE helps with writing code faster, but in the end, I still think dynamic languages win when it comes to productivity. Let me take ShortURL as an example. When I started ShortURL, my code was very dirty, I created a method per service and just repeated the same code over and over again: this was because I first started the project as a way to scratch an itch and I solved the immediate problem (turning a long URL into a shorter one) as quickly as possible. However, as I started to include more services, I realized that a new problem had arisen: the ease of adding new services. So I went and created a Service class which heavily relies on Ruby blocks. I use a block to override default options and I use another block to tell the method how to retrieve the shortened URL.

Let me show that with code:

rubyurl = Service.new("rubyurl.com") { |s|
      s.code = 302
      s.method = :get
      s.action = "/rubyurl/create"
      s.field = "rubyurl[website_url]"
      s.block = lambda { |body| URI.extract(body)[0].gsub("rubyurl/show/", "") }
}

This is how you can get a shorter URL from RubyURL. The block associated with the Service.new method call overrides the defaults (expected response code, the retrieval method, the FORM action, the name of field into which you type the long URL and, the most important, the block to retrieve the short URL among the HTML code). Adding new services is now extremely easy, I just need to find a new service, look at their HTML source, override the defaults if required and that’s it.

The only utility of an IDE here would be to help me type faster, because I think the code is pretty short, maintainable and to the point. It usually takes me a few minutes to add a new service, and that time is usually spent looking at HTML code. If you wanted to accomplish the same thing in Java, since it doesn’t support blocks, the code would probably be much longer (I’m not quite sure how one would implement it). Therefore, adding services would take a longer time and the programmer would thus be less productive. Not to mention that you’d need to think about things like static typing.

I’ll stick with dynamic languages.


Deobfuscation by Florian

September 29, 2005

I was Googling for my name (yeah, I’m like that…) and I found a page that explains my IORCC (International Obfuscated Ruby Code Contest). If you want to know how the code below works, that’s the place to go, because I won’t explain it, I had too much of a headache getting that formatting just right! :)

        d=[30644250780,9003106878,
    30636278846,66641217692,4501790980,
 671_24_603036,131_61973916,66_606629_920,
   30642677916,30643069058];a,s=[],$*[0]
      s.each_byte{|b|a< <("%036b"%d[b.
         chr.to_i]).scan(/\d{6}/)}
          a.transpose.each{ |a|
            a.join.each_byte{\
             |i|print i==49?\
               ($*[1]||"#")\
                 :32.chr}
                   puts
                    }

Friend says Java is out of his workplace

September 28, 2005

A friend of mine told me tonight that his boss is putting the axe in Java at his workplace. This is explained by the very low productivity of Java. Demands made by users are never delivered on time, and apparently the programmers are not really to blame, they know their stuff pretty well. Java is simply too complex, puts too many sticks in their wheels for them to be really productive.

So my friend asked me what I would recommend. Since they were doing web-based stuff with Java, I suggested that they look into Ruby on Rails and/or LAMP. I also mentionned that Smalltalk would be a good choice, because they could get commercial support from Cincom. Since he’s not on the development team and that he’s not a boss, he doesn’t get to make the decision, but he can make suggestions.

I compared dynamic languages and Java with riding a bike; in dynamic languages, you ride on two wheels and you get where you want pretty quickly. You can fall if the road is slippery, if you hit a rock or something, but with a little experience, these cases rarely occur. On the other hand, riding a Java bike is like having 8 wheels to make sure you don’t fall over, 10 people constantly around you, ready to catch you should you fall. You may be safer, but you’re not getting places faster than the dynamic biker.


Badminton

September 28, 2005

Well, our local badminton season started again yesterday. We were 17 people, which is nice, and there were a few new faces. I didn’t play too bad, although I didn’t win any game, but on some games, I think I can blame my partner ;) I’m probably gonna need a week or two before I can play at the same level as last year: I was struggling with my net shots, long services and smashes last night. The two latter aren’t so bad, but my short, sneaky net shots need to come back, and soon if I want to score some points.

In other news, the sister of my first baby sitter (when I was 1 to 10) called last night to tell me that her computer was misbehaving. Why do people keep calling me? You know, I think I better start telling people I’m a geologist or an entomologist or something, people aren’t gonna ask me anything, are they? Or I could just say that I don’t do technical support, that I do programming and that I don’t think I can fix their problems.


New ShortURL!

September 26, 2005

I released ShortURL 0.7.0! Time to gem update!


Two nice evenings

September 25, 2005

Well, I had two very nice evenings this weekend.

Friday, myself and seven friends (Jessica, Nicolas, Joel, Chris, Seb, Etien and Peej) went to this italian restaurant in Valleyfield called Florantino’s and we had a lot of fun. We had a very nice and very gorgeous waitress, Annie, who really got into our stupid games. Last time we went to that restaurant, Etien couldn’t stop laughing when we said the word “pain” (that’s french for bread), so we told her about that, and every time she brought bread to our table, she made sur pronounce “pain” really loud and look at Etien, who, of course, couldn’t help but crack up. I also made sure she knew I was the moron of the gang by ordering “aligned chicken.” The look on her face was priceless and the other at the table couldn’t stop laughing. I would also like to mention that whenever she needed to bend over, our waitress would do it over me. I’m sure it was a way to flirt with me ;)

And Saturday, I went over to Seb’s place to watch hockey with Etien, Peej and, of course, Seb. The Habs won, wohoo! After the game, Seb decided to plug in his old 8-bit NES. We played Duck Hunt, Blades of Steel and a bunch of games on a 52-game cartridge. A little note, the 52-game cartridge wouldn’t boot, so Seb was about to give up when I took the cartridge, blew in it in my own special way, put it into the NES, pressed the power button and the menu came up. Blowing in games rules!

And today I went over to my grand-parents to see my god-daughter for her birthday. She’s four years old and I gave her an electronic game to learn the alphabet.