Monday, January 9, 2012


vi and cc - for a long time, those were the two tools I used for most of my programming. Maybe a linker once in a while, though I usually just let “cc” invoke it. I debugged by embedding printf() statements, and the closest I got to using a Makefile would be a script (usually named “doit” or “go”) that listed a cc command for each program to be compiled, and a final one to link together the .o files. IDES? Pffft! or so I once thought…
I did use Visual Basic back in the early 90s. That was fun! It was so different from the programming I usually did, that it didn’t feel like I was using something different from what I would normally use. It just felt like VB meant a big graphical environment where you drag and drop objects, click on them to get to their action code, and so on. I was using an IDE, but it didn’t feel wrong.
Then I pushed my luck: I decided to learn MFC, using Visual C++. The experience was horrifying! I wanted to write a simple “Hello World” program. I followed the first few steps of the tutorial, and then BAM! I had what felt like dozens of pieces of code, each requiring me to fill in certain sections, none of it having any meaning to me, and apparently having nothing directly to do with writing “Hello World” to the screen. I followed the steps in the tutorial, feeling a bit like a circus animal. In the end, the program did what it was supposed to, but I had no idea why it worked, or what I had just done. I returned a few times to repeat this exercise, but always felt like instead of programming, I was being enslaved by the IDE: tasked to do its bidding.
That was my last experience with an IDE for something like 17 years.
Last year (2011) I took one shot at developing for Android - again with a Hello World tutorial. Not as bad as my Visual C++ experience, but it didn’t leave me feeling warm and fuzzy.
I bought a TI EZ430-Chronos watch a few years ago, and around the same time I tried developing some code for that. Again, following a tutorial, not sure why I was doing all the things I was doing.
In Fall 2011, I bought some Arduino microprocessor boards. These boards required me to use an IDE, but it was completely painless: really just an editor window, a Compile button, and a Download button. It had some annoying auto-indent, but I mostly just ignored that. Somehow, that seemed to get me over a mental hurdle as far as IDEs.
A bit later, I was looking at the Android SDK, realizing that if I knew how to call these different methods, I could do some really cool programming. I think that planted the seed for really wanting to learn how to program on an Android OS.
While playing with the Arduinos, I developed an application that required a GUI on the connected PC. Here again, I had always done GUI development with pretty low-level tools. For Java, this meant using AWT. “It works, that’s good enough.” But now, the thought of creating my own widgets, writing all that even-handling code for routine events, and so on, felt overwhelming. I started looking for a better way.
I Googled, and found someone who had effectively ported Visual Basic’s look and feel to Linux. I downloaded that (feeling slightly embarrassed), and tried to install it, but it needed a lot of additional software to be installed as well. Combined with my embarrassment, I gave up quickly and kept Googling.
The 3rd or 4th time Netbeans came up, I decided to look at it more closely. I had heard the term over the years, but never knew what it meant. I assumed it was some sort of package/set of libraries/some annoying add-on. But I dug into it, and…wow! Suddenly I understood :)
Netbeans changed my life over a span of 12 hours. Suddenly, I could develop Java GUIs as easily as I had one used Visual Basic. As advertised, it let me concentrate on writing the code itself, without worrying about the display and management of the widgets. Suddenly, creating GUIs was fun again. If I wanted a text box and some push buttons to go with my code, it was easy to add them.
More significantly for me, Netbeans got me over my phobia of IDEs. Maybe it was just my mood, or maybe the time was just right, but for whatever reason, I embraced what the IDE offered, and found it not bad at all. After a few days, I began to actually enjoy certain parts of the experience.
From there, I went to Eclipse, and finally found peace working with the Android SDK. My Hello World was an application to allow me to type SMS messages on my laptop and have them sent by the phone. I didn’t feel like messing with sockets just then, so I used tag-files on the SD card to pass requests and status between the phone and host PC. Old-school, but it worked. From there, I added the ability to monitor incoming text messages and pass those to the PC for display. This was a nice mix of Eclipse for Android development and Netbeans for the PC GUI. Doing this was a blast!
  • automatic syntax/semantic checking, as soon as you make a typo etc.;
  • automatic dropdown boxes showing available methods for a just-typed object;
  • suggestions on how to correct mistakes, often with the option to auto-correct (add an “import” statement, etc.);
  • ability to re-format all code with a single command;
  • externalization of strings. Seemed goofy to me at first, but it really makes a lot of sense, and I can see taking advantage of this a number of ways;
  • “refactoring” - for example, changing the name of a variable or object and having the IDE change all references accordingly.
  • automatic syntax/semantic checking, as soon as you make a typo etc. Because while I’m typing “longvariablename” it’s flashing red and underlining and warning me that “longv” is not a defined name…”longva” is not a defined name…”longvar” is not a defined name…you get the idea. How about waiting till I stop typing, or hit a delimiter like a space or “.”
  • auto-fill-in of text. I think I’ve got this disabled, and things work great, but once in a while, I find a generated closing parenthesis at the end of a line while I’m still typing. Usually it disappears once I type my own “)” but once in a while it stays there. Similarly, sometimes the method that appears after an object is nothing like what I typed, but was a automatically filled-in suggestion that took precedence over what I typed. Sometimes these take a while to find, because I’ve learned to ignore most of the reported errors and warnings, because
  • there are a lot of reported errors and warnings. If I have a debug var I’m not using, it generates a warning. If I am using an object I haven’t yet defined, I get a bunch of warnings. It’s disconcerting. I want to know about these when I compile, not while I’m typing. The worst of all may be when you begin a definition with a “{” and the entire rest of your program is underlined/red/flagged as an error because there’s a brace mismatch now. And if you correct an error, it won’t necessarily correct errors in other files until you save your changes. Makes sense, but kind of changes programming from a nice relaxed encounter to a tense ERROR! ERROR! one.
  • automatic indenting/formatting. It’s useful after the fact, but not so much while typing. I’ve tried the options for tailoring this, but the space between too-much and too-little seems pretty wide. And in fact I enjoy indenting, I like balancing braces. It helps me keep things organized in my mind, helps me know where I am in the code and what I’m doing. When that’s removed, I tend to more-quickly lose track of where I am.
Just my initial experiences :)

No comments:

Post a Comment