Object Oriented JavaScript II: the pattern
Dec 21st
Ok, now that we’ve covered the most basic concepts of JavaScript, we can now proceed to take a look at the pattern itself.
The first feature we need to implement is private and public members. Using closures, this is easy to achieve:
Object Oriented JavaScript I: the basics
Dec 2nd
Today’s web applications are inconceivable without the use of JavaScript. It has become a fundamental part in modern web systems. A lot of time and effort must be put into client-side programming to make our application have that modern look & feel that JavaScript provides and we all like to see.
Until AJAX techniques emerged, JavaScript was not seen as an application development platform. It was treated merely as a scripting language to implement minimal dynamic web page behavior. Up till not too long ago, all the JavaScript I needed to write was just a few lines of code to make some validations, a few animations and some AJAX calls… but this has definitely changed today. The number of JavaScript lines I am writing nowadays for the web apps I’m developing are counted in the thousands. Heck, the last module I developed at work contained more than 12000 lines of JavaScript code! This means that I can no longer just write code without order. I need to have some logic behind the process of writing code. And this is when object oriented techniques come into play.
GUI Testing
Oct 4th
A very important thing you must do before releasing your web application into the wild is some sort of Graphical User Interface Testing. This kind of testing ensures that the interfaces between the client and servers execute in tandem. It is an important factor that these connections or interfaces work seamlessly without any failure or degradation in performance of speed and accuracy. The testing should also check for appropriate error messages. So, you must design these tests not only to check whether your application works as expected, but also to ensure that the performance is good enough.
Improving software quality: automatic testing
Jul 13th
Providing high quality software from early stages in the software project is the key to a successful project. We must check the quality of our software in every single release and make sure it’s meeting our expectations. It’s much easier to code having quality requirements in mind from the very beginning than finishing a module and then fixing all the unexpected behavior afterwards.
There are many tools to improve the quality of our work. Developers have refactoring tools, memory profilers, code coverage, etc. But in a software project we also have testing resources, also known as Quality Assurance. Their job is to test the application and find as many bugs as possible: to achieve a high quality product, thorough testing is a very important step. However, this can be a very tedious and time-consuming task. Fortunately, part of this work can be performed automatically using some tools.
HTML 5 C# Web Sockets server and ASP.NET client implementation
Jun 22nd
In the previous post we saw that Web Sockets are the best invention since sliced bread: they bring to the web the bidirectional full-duplex communication traditional desktop applications have been enjoying for quite some time now. It solves many current problems, and enables much more powerful applications than current standards.
I’ve developed a very basic Web Socket server implementation in C# just as a proof of concept. It handles the most basic operations you would expect from a server: start a new connection, disconnect, and send and receive data. Besides, I’ve developed the client part as well using regular ASP.NET. Actually it’s just plain HTML and JavaScript being served from an ASP.NET server – this example doesn’t use any fancy runat=server controls or anything of the like. The functionality is achieved with very simple and easy to understand JavaScript.
HTML 5 Web Sockets
May 30th
Following the series of posts discussing AJAX calls, today we’ll see what is going to be its evolution: Web Sockets. It’s still a very new technology, and support is starting to be implemented in most major browsers and web servers. But don’t count on using it yet, since most of the clients of your web app will not be able to use them. I’ll discuss web sockets here just so you know what the future is going to bring to the web apps world.
The history: the beginning of AJAX
The world wide web and the Internet started as a stateless content delivery mechanism, taking a step backwards compared to traditional desktop applications. Early Internet applications needed to explicitly request every piece of information, and the server sent only the requested data.
Then came what we now call “Web 2.0 application development”: Dynamic HTML, heavy usage of JavaScript, AJAX, and various plugins (Adobe Flash and Microsoft Silverlight). These applications were dynamic and responsive, and they brought much of that rich interactive experience users enjoyed in desktop client/server applications to the Internet. However, due to the request and response architecture that these applications are based on, the latest Rich Internet Applications still cannot match the connectivity and the capability to get real-time data that client/server applications had more than a decade ago.
PHP or ASP.NET?
Feb 9th
The other day a friend of mine was telling me he was going to start a new project. He wanted to develop a new web app from scratch, and was telling me he was going to use PHP. He did have experience with ASP.NET from some other projects, so I told him to use this technology. But he still preferred PHP. The reasons he gave me were:
- PHP is free. You do not have to pay to use it. With ASP.NET you need to pay a whole bunch of licenses.
- PHP runs faster than ASP.NET.
- PHP hosting is cheaper.
- Out there on the internet, you can see more PHP than ASP.NET applications.
- There’s more CMS on PHP than on ASP.NET.
Ok, he had his reasons, but I didn’t fully agree with him. So I discussed some of those ideas with him:
Sluggish database view? Materialize it!
Jan 26th
The other day we were having some slow database view at our project. It was the main view of the new module we were developing, and it was slowing down the whole application to an unacceptable point. It was a rather complex view and could not be optimized much more. So, what was the solution we adopted? We materialized the view.
Regular views store just the SQL script needed to retrieve the data, and every time they are consulted the stored SQL query is executed. However, materialized views not only store the script, but the retrieved records as well, making it much faster.
jqGrid multiselect: a little improvement
Nov 10th
The jqGrid plugin is fantastic. It provides an improved user experience and makes your web application stand out from the rest. But sometimes the default behaviour it has is not what we like, and those are the times when we have to dive into the source code to tweak it. And today was one of those times for me.
We’ve implemented the jqGrid plugin in a couple of pages in our project at work. We needed some multiselect in one of them. This option seems very easy to implement: just add a couple of options at creation time and you’re done… well, not quite. JqGrid’s multiselect default behaviour is not really the standard one. I mean, it is a multiselect, just not what the regular user might be used to.
Javascript frameworks overview
Oct 26th
A Javascript framework is set of pre-written Javascript functions aimed at simplifying development. They take care of the most common and time-consuming tasks, like AJAX-related techniques. But why should we use them? Well, keep in mind that a Javascript framework:
- Saves you time. Even if you really love programming in Javascript, you will save a bunch of time doing your work with one these frameworks.
- Has much of your work already done. Don’t reinvent the wheel. Don’t waste time in doing something it has already been done and tested and re-tested by thousands of users.
- Makes you use less code. With less code you get a smaller file size, better maintenance and less development time.
- Makes your code more readable. Which also aids in better maintenance and less development time.
- Makes your web application execute faster. These frameworks are really fast in performing their tasks and most of them have been optimized for really fast execution.
- Makes your web application run in most modern browsers. If you dealt with Javascript a bit, you’ll have realized how different browsers have different ways of the doing the same exact stuff. Handcrafted cross-browser development can get annoying and irritating. These frameworks have already taken care of that and will just work in most browsers.

