What will you do if you write a shitty application? And what will you do when you find that you have written a shitty application? I’ve been haunted by these questions for the past two days, and yes, I’m guilty as charged. Before someone thinks I sound like someone who knows programming, let me clarify – NO I DON’T. And that is exactly the reason for this post.

The application that I worked on wasn’t something big and impossible. It was a simple school management system, written in PHP/MySQL with a liberal dose of javascript thrown in. Unfortunately, it just didn’t make it to the servers, and I abandoned it about 6 months ago. Much has changed in that time, and thankfully. I now really understand the need to follow Software Engineering processes, the most important being Design. So why did my team, and I choose to ignore something we’ve actually studied in college? Were we dumb enough to think that we wouldn’t be needing it? Probably. Were we not actually able to understand why we will need it? Possibly. The only reason that readily comes to my mind was because we never knew that we will actually need it.

Software Engineering courses in Indian colleges are often the most boring, monotonous and brain-dead courses among the lot. Throw in a thick rimmed, thick skulled man in his 40’s who has never worked on a real application all his life, to teach it and you have a 2012 waiting to happen. And it often does. We students cram the Pressman’s book a day before the exam, answer standard questions about SDLC, Testing, importance of SE, and get away with it. And that is that. We are never taught first hand on why we need it, how we should use it, how badly it will affect the software if you don’t follow certain principles, or why learn SE at all! Those are left to the student to discover after a few years, just like I have.

So what exactly was my application? It was

  • Very simple and modular
  • Web based for universal access
  • Not that huge or complex (Our team of 4 completed it in 3 working months)
  • Architecturally simple

Then why did we screw it up? We did everything that we could think of. We first gathered requirements, refined them, thought we did some design, then went on with the coding. Too bad we thought we designed it! We did not. Looking back, I feel really stupid about some of the decisions we took based on our understanding of the system. We knew we had to design it properly, but we didn’t take it seriously as we didn’t really know its consequences. I am no programmer, and if I feel my app is shitty, it really has to be!

Where did I go wrong?

  • No framework
  • No separating of logic from presentation. It was all embedded in a single file in true PHP fashion
  • No proper design of the entire system. No HLD/DLD
  • No glue. The code looks like disjoint pieces of a puzzle

What I did right?

  • Probably the architecture
  • With PHP/MySQL
  • Revision Control which was never used seriously

So the question beacons – When does one decide to rewrite/redesign an application? I need not have decided on redoing the whole thing. I could have as well patched it up, and sold it as many still do. It would still work, can be understood by almost any developer, and I wouldn’t have to waste time and money on a rewrite. Decorate shit and it will still be shit. If one doesn’t learn from mistakes at the first instance, he/she probably never will. So I finally did what I should have done in the first place:

  • Designed a breakdown of the entire system into modules and the coupling between them
  • Decided against going for a fully blown framework like Symfony as that will add unnecessary complication to a simple application, but rather write my own simple framework to separate code from design
  • Chose mysqli as the database driver and developed a simple wrapper around it
  • Added a logging system which was entirely missing
  • Work on a custom design from scratch, which will also work on portable devices
  • Write a generic framework for the reporting module with custom graphs and charts rather redo the entire code
  • And many many more…

The point I’m trying to make is, no one is perfect to start with. As a programmer, I was happy with my code 6 months back. Now I despise it. It is not something I can work on anymore. So rather than choosing to ignore the mistakes, swallow your ego, acknowledge the mistakes and redo it. Yes it is hard, painful, time consuming and costly. But software is a continuous process and the continuity is there for us to learn, undo and redo things the right way. I bet I will find blunders again after 6 months, but they will not be as bad as those I’ve found now. Maybe then, I can afford to patch things up, and be on my way.

For now, back to Software engineeringĀ : a practitioner’s approach by Pressman

P.S: This post is more of a reminder to myself than to others.

For quite a long time, Sony Ericsson has daunted theĀ  mobile giants Nokia, Samsung, et all, yet somehow always falling at the last hurdle. It was a story of the underdog putting up a brave fight, but always failing to upset the champion. Faced with rapidly falling sales, and a lineup that didn’t offer anything different or exciting, SE had to comeup with something radical to stay afloat. Their recent refresh in Q4 2009 offers something for everyone, with a variety of devices aimed at different segments and price points. But will it be enough to save the company and turn it around? This article tries to explore.

Read more

Ever wanted to get the MAC/IP address of your computer in a Linux shell script? The following two commands should work on most flavours of Linux/Unix

Note: It retrieves the address of eth0 interface by default. Make necessary changes as required.

IP:

/sbin/ifconfig | grep ‘\<inet\>’ | sed -n ‘1p’ | tr -s ” ” | cut -d ” ” -f3 | cut -d “:” -f2

MAC (H/W address)

/sbin/ifconfig | grep ‘eth0′ | tr -s ” ” | cut -d ” ” -f5

So you have a spanking new jailbroken iPhone and raring to see what it can do. Here are a few tips to get you started

1. Install openSSH from Cydia. This is ABSOLUTELY ESSENTIAL if you want to play around with your iPhone.

2. If you wish to installed cracked apps directly through iTunes (which is the easiest way), just install AppSync for OS 3.0/3.1 from hackalo.us repo. For those folks who can’t access hackalo.us, use this repo instead: http://repo.beyouriphone.com

3. Get SBSettings through Cydia. You simply can’t live without it.

4. Install Backgrounder from Cydia. iPhone doesn’t allow third party apps to run in the background by default. Backgrounder lets you do that. Simple.

5. If you use an unofficial carrier, Apple decided that you shouldn’t be let to edit your GPRS/EDGE APN settings. To fix this, follow this post

6. If you are facing the infamous “No Service” problem after jailbreaking/unlocking your iPhone, give this a shot

7. This is for a non-jailbroken phone as well. Make ringtones easily right from iTunes – http://cnettv.cnet.com/create-free-iphone-ringtones-using-itunes-8-0/9742-1_53-50003920.html

This is on an iPhone 3G 16GB running OS 3.1 and jailbroken

1) All apps are a bit sluggish to start. Maybe cleaning up unwanted language files will improve things

2) Not really liking safari. No data compression so higher data bills

3) No Opera Mini!

4) Turning off images in Safari (using ImaSafari) doesn’t really stop the images from downloading (correct me if I’m wrong)

5) Interface rocks!

6) Sound from speaker is just too mild. They really need to have a better speaker in the next version

7) Good for developers or someone wanting to mess around with the internals (openSSH a must)

8) No Opera Mini (again)

9) Decent battery life under light usage. If you really make a lot of calls or browse extensively, look else where. But you can get a lot of juice if you listen to music a lot and use the phone sparingly

10) Great keypad for typing (the horizontal keypad suits me better cause of my bigger fingers).

11) Very good predective spelling correction. It really works

12) Breeze to install apps (even the cracked variety if you know how)

    Stuff
    Everyone
    Calendar
    March 2010
    M T W T F S S
    « Jan    
    1234567
    891011121314
    15161718192021
    22232425262728
    293031  
    Rate this blog
    Clickity
    15520
Get Adobe Flash playerPlugin by wpburn.com wordpress themes