Friday, February 27, 2009

The Joys and Sorrows of Programming
How do you build web software?

I promised some words on that part of life here at the conglomerated jobs of Ed. Just what does it take to build a web app?

To get my little history application (you might soon see it) up and running, I've had to teach myself nearly a dozen languages and frameworks. This would be fine enough if I had any significant programming experience. But I'm just too stupid to know that I shouldn't be trying this.

There's HTML, of course. That displays words in a web browser. If you saw the web back in '92-96, you might remember the ugly nature of raw HTML; CraigsList still does serve it up mostly straight and nasty.

To make things look better, CSS pretty's up how the words and images appear-all those solid backgrounds, lines and colors, and things positioned anwhere yeyond the left column.

To complete the package we send to your home or office, JavaScript tells your computer to do anything more active than a magazine page. Popup window? Javascript. Menu that drops down when you pass your mouse over it? Javascript. Interest rate calculator, MS Office Document editing, the nice charts that adjust to tell stock prices over 1 day or 5 years? Javascript.

That completes what we send over the wires, wherever they may go. Ooh! I should add Adobe Flash, which drives many of the Interactives cited on this blog. I only use it in the animation on this home page - the book being flung over the mountain? It's code, too, that runs in a special plugin in your browser. Many more such plugins exist; however Flash is the most widely distributed by far.

OK. How do we create the package we send you? There are special authoring tools, some to edit HTML, some to make CSS easier, etc. We also send you images, which means learning how to use several image programs--Photoshop, Fireworks, GIMP, etc. Image creation and editing has its own natural language, and its amazing how hard it can be to learn how to do something you can describe very succintly-say, "make his face brighter". At least if you're teaching yourself.

None of this so far is programming, save Javascript.

What about data? A good app will store and retrieve lots of info for you. I use MYSQL, but there are many others. SQL is the language to talk to the database; I've had to learn some, but blessedly little.

Which brings us to Rails. Or Ruby on Rails to be precise. Rails helps me not speak SQL. Magicly loaded (for free) on my laptop and also the server, Rails does a huge amount of work with very little adjustment (well, for a non-expert like me, its time consuming. But it really is very little code written on my part).

Which brings up Ruby! I love Ruby! Ruby is a real and genuine programming language. Unlike HTML and CSS which mark up documents, or MYSQL which issues commands to a database, Ruby has lots and lots of command for adding and subtracting and pulling strings of characters together and a host of other actions you might tell a computer to do. Ruby is very powerful and very flexible. Too flexible for some--you wouldn't ask it to fly a passenger airplane. Not because it couldn't, but because it lets programmers do stupid things! Which is cool.

So, as history, I've studied a bit of 40 some computer languages. Ruby is the most human. Who couldn't love a language that easily does this:
>> "Jimmy" * 5
=> "JimmyJimmyJimmyJimmyJimmy"
or this:
>> 40.to_s.reverse
=> "04"
>>
or >> [12, 47, 35].sort!
=> [12, 35, 47]


Dang! Its 4:32, or tea-time, on Friday, and I didn't get to all the additional toys it takes to make a web app. We haven't even mentioned AJAX! Or CGI! OK, more later.

Have a good weekend.

No comments: