“Joys” of web programming

The last couple of weeks have taught me that I’m not a natural web coder. For one thing, my grasp of PHP/javascript is really pitiful. It goes deeper than that, though. I’m a command-line script guy. I like to write clean code with short, discrete subroutines, type “program_name file_name”, sit back with a coffee and wait for a CSV file to pop out.

In a web application, you write an awful lot of code – most of which either (a) checks user input for errors or (b) makes things look pretty. The underlying algorithm is only a small part of it. On top of that, you have to imagine what users might want to do – unlike a set of linear procedures, they might want to go back, or forward, or jump in the middle. So you need a picture of the whole working site in your mind. For some reason, good coding practice goes out the window when I write web code. I forget to declare variables, or include checks for missing values. I copy/paste the same code with different variables multiple times, instead of writing functions. In short, I find it hard.

That said, I have a mostly-working web application which should see the light of day in the new year, so stay tuned.

2 thoughts on ““Joys” of web programming

  1. Well said, Neil. I fear I know what you’re talking about. ;) And as soon as you think you’re “done” and that you’ve got something to release to the world, your users chime in keeping you busy with a ton of feature & help requests. On the other hand, this user feedback can be very helpful and is, after all, what keeps you going, and it motivates you to strive for a better application.

    Oh, and to feel home again, you could always write a nice command-line program that interfaces with your web app. Sounds familiar? ;-)

  2. Your web code is rather better than mine! My PHP looks like a beginner’s Perl script. I should add “learn OO PHP” to my new year to-do list. I agree though – users are a blessing and a curse. But then, web apps are for users.

Comments are closed.