Archive for the 'Web Programming' Category

(Chronologically Listed)



Develop like an architect, not like a cowboy

Few years back when I was still in University, one of my lecturer who taught us Software Engineering said, “Don’t be a programmer, be a developer.” I was a bit confused back then. In my head I asked, “What’s the difference? Don’t developers also write codes?”. I’m pretty sure the other students in the lecture hall were as confused as I was at that time. But now I know for sure that programmers and developers are from different planets.

In software development, there is a term called “Cowboy coding” which implies the method of writing softwares where the programmer start coding the application without doing any sort of proper “planning”. They just picture in their head how the application will look like in the end and start coding straight away…. do whatever they think is right. They hate planning. They think planning is boring and a waste of time. The idea of writing codes straight out from the head may sound cool, but in reality, applications that are written by cowboy coders are typically sluggish, full of bugs and very troublesome to maintain. I know this because I used to be one of them (in certain cases I still am, but well that’s a different story Foot in mouth).

Class diagramAn experienced developer will plan his project out before he even writes a single line of code. Knowing the basics of UML (Unified Modelling Language) is an advantage. Now you don’t have to plan out too detail until you had to prove the cowboy-coder’s point - wasting time. No. The best thing is to balance your planning phase so that you have a firm base to start writing the code. For me, I like to use UMLPad to plan for my project. It is a very lightweight program, free, easy to use, very straight forward, and eliminates the complexities of other more sophisticated UML tools like Rational Rose or maybe, ArgoUML. Since PHP is not really a pure Object-Oriented programming language, all you need before you start writing an application are:

1. a simple Class diagram - to define your classes/objects and the relationships between them,
2. an activity diagram - to define your application’s flow, and
3. a state diagram - to define your application’s behavior.

UML diagramsUMLPad provides exactly that. Alternatively, planning the traditional way (ie: sketching on papers or white boards) is also very recommended because many finds it to be more comfortable and allows us to think out of the box. What about the rest of the diagrams in UML? No need to worry about them for now. Is UML hard? Trust me, UML is just common sense. Do you need to plan in detail about everything? If you can do that very quickly, go ahead, but you probably don’t need to. Remember, we don’t want to waste too much time on planning, but we also understand that no planning is planning to fail. So if you respect yourself as a person, be a developer who plans, not just a programmer who cares about nothing but codes.

Tags: 


Why you should use a Web Application framework

web developmentEven though I have been programming for years, I have never actually fully utilized a web application framework when developing web applications. Part of the reason being that I may be a bit too proud to adopt someone else’s programming structure. I used to believe in my own codes so I always write applications from scratch. That was a big mistake. After I found and studied a great web application framework for PHP since just a few weeks ago, I realized how much time I have wasted all these while and how many headaches I had to go through just to rewrite the same codes and reinvent the wheel all over again.

For those who are new to web application framework, I’ll try to explain it briefly here. Everytime we start writing a web application, there are some basic codes that we need to repetitively write again and again. We had to write the database connection classes for the database access layer, we had to write every objects classes with their basic CRUD methods. Then we had to deal with so many annoying basic issues like Access Control Lists (ACL), data sanitizations, authentications and authorizations, session handlings, and you know… the rest of those stuffs. This same repetitive coding is a waste of time if you keep writing them from scratch. Plus, you can’t be really sure that the structure of your code is secure and lightweight enough to run. Then you started to wonder, “Am I doing this correctly? Is this exactly how everybody does it?” Here’s where an application framework comes in. An application framework is basically a standard programming structure that already pre-defines those repetitive stuffs as well as any other necessary functions so that you can easily and effectively write your web applications in no time.

Let’s see some of the few benefits that I find when using a Web Development Framework:

1. It saves a hell lot of time

Because you don’t need to worry about data sanitizaion, session handling, error handling, and authentication logics anymore (ok maybe just a little bit). Most of these are well taken care of by the framework. No more head scratching. You can start writing functions for your apps straight away without wasting anymore time with those repetitive codings. Double up development process!

2. Organized application structure

Another thing to not worry is about managing your web files and directories. The framework will already have a good skeleton structure to use. No more stuffing PHP files here and there and then realizing at one point that you have messed up with your files’ placings. Business logics can be separated from the interface files. Things get more organized.

3. Flexibility over different platforms

I’m a MYSQL user. If you give me a Postgresql database to use, I’d be scratching my head again if I am to write the application from scratch. Luckily a framework can help me not to waste time studying things that don’t really matter. A few tweaks can ship my application from one platform to another.

4. Secure codes

This is another huge advantage of using a development framework. You can be sure that your application is using good security measurements because the framework takes care of it. No need to worry over those nerd hackers trying to break your application anymore. In fact, I’ve never been truly confident that my application is secure if I write them from scratch. Now that I’m starting to use a framework, I feel much… much better :D

There are endless other benefits of using a web application framework but to list them all here is crazy. So I’ll let you decide the rest of them. I mainly develop web apps in PHP, so the framework that I’m currently exploring is CakePHP. I’ve looked into other PHP frameworks but so far I guess CakePHP got my attention the most.

Tags: 


Page 3 of 3«123