On Java Rearview Mirror

Standard
Java

The Java Mascot

I am rediscovering Java again, and my mind was transported to Fabricio, an excellent programmer I met and the person who opened my eyes to the language. Back then, I knew a little bit about programming. I knew BASIC, Pascal, and some COBOL. I had a very solid yet incomplete knowledge of Assembler, based on a reduced macro-instruction set. So you can safely say I was not a newcomer to programming, yet I lacked an important piece: object-oriented programming.

But back then – circa 1997 – Fabricio told me that Java was the greatest because it would do all kinds of things. First, it was its own environment. I thought he meant it was its own OS, but he said no, that the idea was complex, but the language could be written once and ran on all platforms. He told me Java was so complete, no other tools were needed, that it could sustain a programming environment on its own, making it ubiquitous to the extreme. In a nutshell, to my then young and naïve mind, it sounded like programming magic.

Very soon I started looking for Java tools and downloaded Sun’s primers and Java compiler. My first attempt if I remember well was creating a java applet that ran on the browser and opened a small window with a canvas where polygonal figures were drawn. I remember the example being extremely complex. I quickly forgot everything and left Java to its own devices.

A lot farther down the road I went back to college to learn Java right. That was my big introduction to all manners of OOP concepts, from static classes to encapsulation, heritage, composition, polymorphism, etc. My knowledge of the language was now strong, but I noticed the language itself had changed a lot to adapt to modern web needs and it looked a lot like C++.

Now enter the next wave of modern languages. I did not understand all concepts in Java, so while reading Bruce Eckel’s books I came upon Python. I tried Python to see if some of the more obscure examples of Java collections made sense to me. It was love at first sight. I was doing things in Python that were simpler to read and understand, while more complex in design, that I would not even envision in Java. My love for Java began to fade.

The next departure came to me while trying to make an active web page work. Java web applications with their plethora of XML files, classes, servlets, and such were making me suffer while getting nothing done. Then I discovered a Ruby On Rails tutorial and found myself even more alienated from Java. I was doing things in hours that took me days in Java.

One concept needs to be clear: I am not a programmer by trade. I use programming to solve business problems from time to time when Excel and other tools find lacking. I never needed any of these abilities as a must, rather as a compliment to my other core competencies.

A week ago I found Fabricio. I think he doesn’t remember me. Before I call him to my office to talk, I began to think how much I had grown programming wise, how much had Java grown, and how much had other languages grown.

Java became the COBOL of old companies and legacy systems. Why? I am not sure, but I bet it had to do with several factors. One is the cool wave of Ruby programmers. Twitter made Rails cool, and 37signals made of Rails a success story. Another is the wave of intellectual programmers doing Scala and Smalltalk and other even Clojure. Can’t say much about them, other than the fact they don’t use Java. There is a third body of people, running what I call conservative systems in Python and Perl. Perl hasn’t moved a lot, but I never see a Linux distro that doesn’t depend a lot on Perl. When it comes to run-of-the-mill web applications, PHP is king where I live. I cannot think of an uglier language, but people who love PHP swear and live by PHP.

And of couse, .NET did not die. Banks and corporations tied to Microsoft use .NET depend on .NET technology for all their applications.

Java does many things right, but it is a big beast to tame. For console programming and solving general problems, Java is not better than C++ or C#. I have already mentioned web programming. Javascript seems to have taken over the client-side script mission Java was intended for. On the server side, PHP, Perl, Python and Ruby look to be faster, simpler solutions with 99.9% of the robustness of strict typed languages. On the desktop, Java Swing is good, but so is wxPython, Gtk and QT classes for C, and don’t even get me started on the eye candy of Objective C.

Java owns to Android not disappearing from the mobile app environment. I honestly thought the mobile world had Objective C to look-up to from now on.

Today, Oracle owns Java and I think to them it’s just a good language on which to found their database engine empire. The COBOL of 2010 if you will. But Java did one thing that I think we usually take for granted. In a moment where .NET could have been the only option left in a world where mainframes began to disappear, Java challenged Microsoft on the web battleground. Despite not becoming the de-facto web language, it opened the doors for a whole plethora of other languages – OOP or not – to thrive.

Mint Linux Review: Get It!

Standard

About two months ago the company changed my MacBook Pro for a Dell laptop. I loved the Mac, but it was getting old and everyone complained that the Office versions – despite claims of being compatible – were too different for collaborating on documents. From the first moment I got the Dell with Windows 7 I had just one thought on my mind: making a second partition and installing some flavor of Linux. I haven’t played with any of the problems in Project Euler, and I just hate running Python or Java in a Windows machine. Yesterday, there was surprisingly little to do in the office, and I found myself downloading Mint Linux just for the aesthetics. I know this is a bad excuse, but it was a choice between Ubuntu (bent on Python) or the shiny desktop of Mint.

Linux MintI downloaded the ISO image from the website, which took a little over twenty five minutes, and burned a DVD. Installing Mint Linux is very easy. Just burn the DVD and insert from the Windows 7 desktop. Click on Install with other OS and Mint does the rest. Someone mentioned I should shrink my main partition and manually create a partition adjacent to Windows for installing Linux, but Mint does everything for you. It will suggest a partition size, install the OS, download updated packages, and then install a boot program so you can easily decide between Windows and Linux at start-up. The whole process takes around 25 minutes, and you are set to go.

The basic installation comes loaded with software for all the common chores:

  • OpenOffice for word processor, worksheet, data base and presentations
  • Firefox
  • Thunderbird email
  • Tons of multimedia programs for playing music, video, and what not
  • Gimp image program
  • Excellent terminal
  • Very easy administration panel

My version of Mint runs on Gnome, but there are KDE versions available. I never understood how to program C and Gnome libraries, but then I am not that good at C++ to use Qt libraries either (I have read Qt manuals and because of my Java background understand a lot more about how it works, but I will stick to Swing for the moment.) If you have no idea what this means, rest assure it’s all transparent for the user. Let’s just say Gnome is cute, and now you know where Windows Vista stole its look.

The system uses a Software Manager that simplifies updating and installing packages. I like using apt-get but I found the Software Manager so friendly and inviting, I have hardly used the command line at all. Repositories and a little bit restricted unless you look from Universe and Multiverse, but I guess that is intended to keep the integrity of the system. I downloaded wxPython libraries in a breeze, and installed Netbeans in less time than what it took to do the same in my Mac. I had problems installing Komodo Edit, a great editor for Python, Php, Perl and Ruby. I can not still make the program run from desktop icon, but launches from the command line (and I guess it’s my mistake for not setting properties for the folder correctly…)

When I look at Linux Mint, I can not believe how far it has come from the early versions of Linux of days past. This is such a mature system, that I wonder how much leverage a Windows computer has. I would recommend Linux Mint any day for the beginner to medium user who wants a fun, easy to use Linux distribution in their machines.

Upgrading WordPress Themes

Standard

I hate updating my website http://www.meilij.com which uses WP as a blog engine. Something always breaks, something goes missing, etc. My actual theme no longer works right. Fixing mistakes usually takes hours of Google work, trial and error or just simple luck.

I installed a simple theme for the moment but I will try to install Arras or F8 Lite again, or the excellent theme Modern Clix by Rodrigo Galindez.

But it still is a bummer…

eService gone bad…

Standard

I got an email from Copa Airlines – which I absolutely love as an airline – reminding me of my upcoming flight and advising me to do web check-in. I usually use the web check-in service but I liked the way the software now sends a quick message to my BlackBerry.

Not one to postpone things, I got my self to a terminal with a hard line to the net to check-in electronically. And that’s when the magic stopped. Posting my passport data time and time again, I got nothing but error messages. After four times, I gave up.

If you are going to couple e-mail alerts which are supposed to be followed up with web services, make sure the coupling works! Maybe all the mails were sent at the same time and that chocked up the system. I am only guessing here. But the dissappointment is great. Which is a shame. I was probably going to do the web check-in sometime tonight and I would have felt great about my airline. It’s only when you over-promise and under-deliver when the customer gets angry.

One for the do-less achieve-more crowd.

You must try RM-install for Mac OS X

Standard

RM-installI recently got a new laptop, a MacBook with a 13-inch display and dual core 2.0 Intel processor. I will not speak of the Mac though because it is not the time yet. I promise another review later on.

What I did want to talk about is installing Ruby and Ruby On Rails. In the past I have done so in other Mac computers with different degrees of success. Installing on the UNIX shell is not as installing in the Linux Shell. Not sir, it is not. Maybe it’s me (yes, I am a particular type of fellow). However, I never seemed to get the full installation right. Maybe my paths were wrong. Maybe the paths were right, but the original and older Ruby distribution got in the way.

I could do it in Linux with my eyes closed. I think Linux has a friendlier shell than Unix. And the FreeBSD shell in my Mac is not very friendly. In Ubuntu I can even apt-get and install, and I can’t do the same in my Mac.

So when I got my new Mac, I kind of wondered what to do. This is not Leopard; this is Tiger, with an old Python 2.2 installation and an even older Ruby 1.8.1. What is one to do? The only remedy is to Google your way out in geek language and learn to do everything the hard way.

That is, until now. Because thanks to http://www.rubyinside.com I learnt about Five Runs and its superb RM-install product.

On their on words, RM-Install, powered by BitRock, is a free, multi-platform, enterprise-class Ruby on Rails stack enabling you to instantly begin developing and deploying great Rails applications without the worry of installing or maintaining the various integrated software components.

It is so simple I doubted at first how good it would be. Just download the file and double click. After the installation I simple had to run the following command from the shell to correctly set paths:

$ source ~/rminstall/scripts/setenv.sh

And that is all! I started to use MySQL immediately, and it worked like a charm. The correct and updated version of Ruby, the Rails installation, even Apache and Mongrel, and Subversion as an added bonus!

Probably some of you are nodding left and right, thinking to yourselves “how can Ariel be such a dummy? I can install all these and more while my right side of the brain codes Assembler in XCode!” What can I say, I am not that smart.

But the beauty of RM-Install is just that, making it very simple to get the installation right for software development. I don’t do anything extraordinary, just code simple things. And I am far from destining great amount of times installing my favorite language setting since that would be contradictory on why I like it so much.

I copied my expense tracking web application, and created a database using MySQL in a snap. After running rake and migrating tables, I proceeded to run the server and found myself with a fast Mongrel (faster than my Windows box at least) and excellent Rails support.

All in all, finally the pain of installing and running Rails on Max OS X is gone. I guess all the authors will now have to change their How To Install in Mac OS X sections.

And the winner is… Vim!

Standard

I remember, several times actually, David Heinemeir Hanson explaining in his presentations there is no need for IDE’s in the Rails world, because everything is very accesible and simple. I am not one hundred percent in agreement with said comment, and in the past I have tried several IDE’s.

My first one was Rad Rails for Eclipse, which I loved at the beginning. I now use Aptana, which is a very good tool for Rails and Javascript work.

I also used NetBeans 6.0. I think it has the best Rails approach to source formating (I like tidy code) but I miss some refactoring options. The smart windows and excellent use of the new SWING library make it a favorite, except for the vast resources it needs, which usually means it runs a bit slow in my desktop.

RoRed is a Windows only light IDE which gets the job done surprisingly fast. It lacks some of the major features of the big names, but for fast editing, it surpases the previous three contenders. Too bad it is only for Windows environment.

But what is surprisingly, is what I am using at the moment in my Windows XP machine as my main editor. No, I am not using an IDE. I found it faster to just keep some console windows open and run the script commands myself. As I depart the ranks of the newbies, I found in no need of an IDE console to use rake or run a script. As a matter of fact, it started to get annoying. Jumping from folder to folder was also easier from a window. What I wanted was fast, very fast editing, and superb editing control. The kind of highlighting syntax that recognizes RHTML, HTML, and Ruby apart in the same file (okey, if it’s Ruby + HTML = RHTML…) I wanted control on my folding and I wanted commands galore to make my life easier… and I found it.

It’s called… Vim!

Yes, I went back to Vim and the new(est) Windows plugin for Rails. It’s so amazingly light, fast and powerful, I might not use anything else in the future. Or I might. But the thing is I am surprised how an old tool got new features and it looks better than ever.

Go figure…

I dream of code…

Standard

I am not sure if it’s me, but last night I couldn’t sleep, as I was dreaming on code…

It might sound strange, but I dream of code.

I spent the weekend working on my web accounting application. It began as an alternative for my father’s roof workshop. A place where he could gather data and I could inspect it from my office or while away from the office, seating lonely in the Caracas Embassy Suites. My job keeps me traveling sometimes. And as I juggle my company’s finance strategy, I would periodically check if my dad had overspent in things like hammers, zinc sheets or imperlastic (gluey stuff that keeps your roof from leaking…)

But then the program grew. It was massive. It was beautiful. It had careful controls and meticulous use of Ruby syntax. As my abilities with Rails developed, so did the code, taking on new proportions. Relationships in the model grew, from has_many to has_many_through. Controllers multiplied. Helpers methods came to the scene, and very soon I was using every tag_as possible helper and plugin.

And then last night, I started dreaming in code…

I was trying to sleep, but in my dreams I kept highlighting some obscure labels for a form with titles in bold brackets (you know, those funky brackets…)

Then I had a wonderful idea for a new relationship model that would accelerate my queries. I can’t remember which it was or what was it about. But in my dream, I was busy typing in Komodo Edit (the free version!) the solution to my problems.

And I got no rest last night. Most of my hours sleeping involved decorating tables, creating new reports, or trying to get my PDF generated reports to work…

This is not the first time. It happened years ago when I went back to college to learn Java. I would dream of objects, classes, encapsulations and such. In my dreams, I would type away at Eclipse building classes to resolve retail marketing programs, such as maximizing profit per square feet alternating product assortments…

Yes, dreaming of Ruby code is more efficient and sintactically less stressing than Java code. And the constructions are also more beautiful.

Some would say you dream on Ruby code, but Java code is more like a nightmare…

Spooky…