Tuesday, May 22, 2012

Web Revisited

It's been a while since I've done any serious web programming.  There are many career programmers in other industries who view web programmers with a jaundiced eye.  It is as though the reputation of web programming is forever tarnished by the proliferation of idiots who called themselves "web programmers," back during the .com boom, but who could barely muddle their way through basic HTML.  I wont lie to you:  There was some schadenfreude in some circles, when the bust hit, and some programmers found themselves chronically unemployable.

However, the pendulum keeps swinging.  We are back in a big growth phase for web technologies, and there are a lot of good programmers who have taken up residence here.  There are interesting challenges, in this space.  There are things worth exploring and learning -- yes, even for game developers -- especially for game developers.

Having gone swimming in web technology after a hiatus of almost a decade, I have the following observations to make:

1.)  JQuery is awesome.

If you type "jquery is awesome" into Google, you get 5,480,000 hits.  If you type "jquery sucks" into Google, you get 436,000 hits.  How many things get that kind of love from programmers?

In the days before Ajax, we did insane things.  I created magic with DHTML and hidden frames, but it was black magic.  It was hard and it was ugly.  Ajax got rid of the hidden frames, but it was really JQuery that made the DHTML part of it considerably less painful, and for that, I am pleased.

2.)  You can't possibly know everything.

There are so many frameworks and methodologies now that you just can't master them all.  There's just too much.  It may be an embarrassment of riches, but it is also very hard to choose what technologies to use for anything.

3.)  Clients are growing fatter.

There was a time when we thought we were moving towards thin-clients.  Everything was going to be on the internet, and our computers were just windows into that space.  The counter-intuitive thing is that our clients are actually growing fatter by the day.  Many modern web applications have most of their logic on the client-side, with only a small data service on the back-end.  I am still trying to get my head around exactly what this means, in the long-term.

4.)  CSS is great, except when it's not.

I have used a lot of layout engines, over the years.  For something that was intended to get people to abandon their abuse of tables, CSS continues to be somewhat disappointing.  And don't you dare try to tell me that I am saying that because I don't know how to use it, either.  I have done some pretty serious gymnastics with it, and I am annoyed at how much time I always spend fighting to get what I want (especially cross-browser -- GAH).

5.)  Here there be dragons.

I see bad web code way too often, and a lot of the code examples out there for new programmers don't demonstrate best practices.  Things get big.  Things don't get cleaned up.  Remember:  Just because you're not coding in C++ doesn't mean you can just stop thinking about your memory usage, and other Responsible Programmer Stuff.  Be a professional.

Tuesday, May 15, 2012

Create Repository Here

I love Mercurial.

Well, really, it's Mercurial + TortoiseHg, on Windows.  As a career-programmer and tinkerer, these things give me great delight.  Oh yes, certainly there are many different source code repositories out there, at this point, and there are compelling reasons to choose other ones.  But, the thing that Mercurial and TortoiseHg give me is this:

When I am tinkering on a casual personal programming project, and I know I'm about to really mess something up good, I just right-click in the directory where I'm working.  I select TortoiseHg > Create Repository Here.  (Or, from the command line, "hg init (project-directory)") My directory where I'm working is now both working directory and repository -- just like that!  I have no need for messing around with servers, or other directories, or launching special clients.  I just add my files, commit them, and then I can iterate to my heart's content, and roll back if I mess it up.

I lament that I had no such thing when I was a student.  I wonder how much time and heartbreak I would have saved, if I could have done such casual version control with my class projects.