So, it’s is 2012! What is a new year without a new preoccupation?
I have been working on a .NET based application using MVVM. All I can say is: .NET seems like a very uncomfortable straitjacket to me.
So, in my spare time, I dream of making my escape. This time, I am playing with Node.js. I won’t say much about it right now, except to say that I am playing with the idea of developing my own little library to make node code easier to write and maintain.
Code readability has become a big commitment for me. I work with so much code that is virtually unmaintainable and unreadable. It offends me. I do not mean to offend or unfairly criticize anybody that I have worked with, but I have grown frustrated by the fact that programmers do not know how to write clean, beautiful and elegant code. Bad names, bad functions, and poor architecture abound.
I like node, but the first thing I notice is that the code can get ugly pretty fast. Today, I am playing with tamejs, which makes it easier to write clean asynchronous code. For now, I am calling my library GumMachine. More about that later.
Several years ago, I had the pleasure of working on a contract at Canadian Forest Products. I worked with a great group of people who had worked together for years, on a good project with clear requirements. While I was there, I used the remote scripting toolkit from Microsoft, which allowed me to communicate with the server without reloading the web page: we now call this technique AJAX. I wrote a lot of JavaScript.
While I was there, Terry French, team leader of Canfor’s e-business effort, expressed an opinion. I am paraphrasing after years have passed – if I do not get it right, I hope Terry will forgive me: “You code as if JavaScript were a programming language. It is not. It’s a scripting language. It’s great for providing simple form interactions, and validating fields on submit. That’s it.”
If this blog were a trashy daytime TV talkshow, it would be one of those look-at-me-now shows. You know the kind: people who were unpopular in high school, but who have made good, confront their tormentors. Terry was a great guy to work with, but on behalf of the much maligned computer language, JavaScript, I say: look at me now!
Server side JavaScript is making a comeback. But, wait, there’s more. JavaScript programmers now get to deal with sophisticated concepts such as currying, callbacks, closures, array comprehensions, and test driven development in JavaScript.
And then there are those lovely libraries: JQuery, Mootools, and YUI, just to name a few. JavaScript has come a long way. What do you think of JavaScript now, Terry.
If you are interested in Javascript, check out Douglas Crockford’s videos on JavaScript at Yahoo Video.
I am working to use reflection to generate a POJO from data models defined in Jython – DB4O can only persist Java ojects. However, as I sort that out and prepare for my next DB4O/Jython/Django post, let me share this good advice for any developer who builds any sort of web application in any language.
These seven habits for developing secure applications target PHP developers, but they constitute good advice for you, even if you are working in another language. Take heed.