Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,593 members, 7,812,937 topics. Date: Monday, 29 April 2024 at 11:04 PM

I Just Wrote What Might Be The Worst System Ever Programmed In This Country - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / I Just Wrote What Might Be The Worst System Ever Programmed In This Country (3208 Views)

I Need A Responsive And Well Programmed PHP Script / What Is The Essence Of This "Programmed" Restriction On Nairaland? / Selling Of Some Of My Custom Programmed Application At A Rediculous Price (2) (3) (4)

(1) (2) (Reply) (Go Down)

I Just Wrote What Might Be The Worst System Ever Programmed In This Country by larisoft: 7:27pm On Jul 22, 2016
I JUST WROTE WHAT MIGHT BE THE WORST SYSTEM EVERY PROGRAMMED IN THE HISTORY OF THIS COUNTRY: HERE'S HOW I DID IT

First of all, how do I know that this code is the worst piece of code ever written in Nigeria?

- The System consists of only 2 backend scripts. Each of which has over 2000 compacted lines of code comprising several classes and independent methods. It has several front pages of course, but everything relies on these 2 backbones (i.e. Every page references the two pages one way or another. (Wasn’t the plan initially, trust me).

- The only comments in these pages are previously existing code which I marked as comments after replacing them with new, working code. (I’m scared that if I try removing these unused codes, I might mistakenly remove a letter from a variable and have another hour in hell).
Anytime I realize I have to change a variable name…My mouth goes dry and I feel myself sweating. And changing the variable name usually takes 2 hours, with a lot of ‘ctrl F’.

- The Error reporting is set to NONE. I dare not set it to WARNING or the browser will crash with all the text it will spit out.

- Some newbie out there has probably written something worse, but it can’t possibly be this large. This is a system that is meant for a big institution. Any newbie that attempted this would have given up in frustration after correcting the first 1000 bugs (Am not joking!).

On the other hand, no pro could have written this. They usually have established conventions they follow to avoid this sort of thing. And they would have charged enough money to justify rewriting it once things started to look funny.


Now, even though this is a baaaad barge, it’s a barge all the same.I have written the worst piece of code in this country! And not knowing how else to vent my frustration with this piece of code; I’ve decided to blog about how I accomplished this disastrous feat…and perhaps, stop someone else from beating my record.


This is how I did it.

I PUT PRODUCTIVITY ABOVE ALL ELSE

This project actually started as a small program – not a system. My company got the contract last year when I hadn’t written this article on how to treat clients (http://larisoftng..com.ng/2016/05/what-freelancers-should-make-clients.html). I accepted the job, and wrote two simple, neat, object-free scripts to solve the core problem. I can’t mention the real project here, but its very much like computing Employee payroll.

The client said he didn’t have a lot of cash. All he needed was a script that would record employees’ basic Bio data, and get the salary of each person when one keys in their name or email. He pleaded that it shouldn’t take me more than 3 hours. (He was a programmer that did more job-hunting than programming, and this contract he got turned out to be above him, so he outsourced to me).

Here’s what I should have said: “Bro, this program doesn’t seem to be complete and I know you will come back for more features. Hence, the only condition upon which I will write this program for you is that you sign this agreement that you will not request for any other feature than what you just listed. And that if you do, you shall pay me whatever I charge you before I’d be able to add them”.

Unfortunately, here’s what I said: “Its alright, bro. I will send it to you this evening”. My poor laptop was probably screaming at me to take that back. But I didn’t hear it.

I got a really cool template, (this project is one of the best looking I’ve made by the way), pounded away at the keyboard for 2 hours using a language that is very good for getting things DONE FAST (more on that later), and our program was ready. I had produced value in less than 2 hours and got paid for it. Yeah! That’s how I rolled.

However, twice or so every week, the guy would call and plead that I add a function to do something simple…like say… a ‘form to record employee attendance’…or’merging employee attendance with employee salary’…or a ‘view that enables seeing the difference between what the employee is paid and what he should actually be paid’. I always added these features within minutes, collected whatever token he thanked me with, and moved on to whatever major project I was working on. Productivity was key.



I CHOSE PHP

Its unfortunate that my very last blog post was a critique on PHP, and here I am again, ranting against a language that has paid me over and over again. A language that I couldn’t create, even if it was to save my poor soul. But the truth must be said I guess.
Its possible to write bad code in any language; but PHP actively begs you to write bad code.

1. While PHP offers OOP, it offers what seems like a poor implementation of a hashmap, which tempts you to avoid creating objects at all. This implementation is called string indexed arrays. For instance, why create

$person = new Person();
$person->name = “me”;
$person->confession = “I wrote bad code”;
$person->punishment = “Five projects ahead of absolutely clean code”;

When you could simply do this:

$person[‘name’] = “me”;
$person[‘confession’] = “I wrote bad code”;
$person[‘punishment’] = “five projects of absolutely clean code”.
Note that I didn’t even have to initialize the array. And this error will be suppressed once I change the error report from WARNING to NONE.

The second option is very tempting right? I fell into that temptation a lot on this project. Till date, the project has no objects. I guess am doing functional programming.

2. Error reporting: PHP is very soft-spoken about what you can do and not do. If I had created this mess in Java, I would have given up after the first 500 lines because too many compilation errors would have stopped me. But with PHP, all you need to do is turn the error reporting off and everything looks clean! And boy! did I use that ‘turn off’ button’?

3. There is a lot of bad design decisions in PHP, which may or may have not aided me in accomplishing this feat. But I will leave those for maybe another article.

4. This one is largely dependent on the fact that I used Net beans, but the automatic indenting for braces and if statements is very poor for PHP. I shouldn’t have used the duo.

Yeah! I just blamed Rasmus Lerdorf again for my own shortcomings. I guess that’s how I roll!


I Used An Already Existing But Unrelated Project, And Several Libraries:
I already mentioned that I used a template. What I didn’t mention was that I also used a sample project for an employee database. As time went on, I would clutter my workspace with so many libraries and sub projects, so long as I found a way to fuse them to my two backbone php pages.

Things were bad. Rather than stop, I patched it on:
As at 3 months ago; it was clear what this project had become. One would think I’d have the sense to propose a rebuild but I didn’t. I kept patching it for tokens.

Well, that’s how I got this barge! If anyone asks you who has written the worst piece of code in Nigeria yet, you know who that person is.

More on the project; we are now at the point where I’m making charts to show employee performance, performance in comparison with objectives, performance in comparison with other employees, etc. And there is no fixed price for all of this.

One may ask, why don’t I drop the project? My response: Am the only one alive who can navigate this code. I have accepted too many tokens over time to reject it now or charge again to rewrite it. My client wont hear of rewriting everything from scratch, too much money has been spent and everything seems to be working okay. Calling in a new developer would reveal the abomination that’s been hidden for a year now so am reluctant to pull away forcefully. Also, I am so engaged now that I would be squeezed for time to redesign it .

Its sort of that position where you are too small to get over, too tall to get under, and you are stuck in the middle. (Tribute to Michael Jackson there).

Do you think you have written something worse than I did? Please share! It would be really comforting to know am not that bad…



Source http://larisoftng..com.ng/2016/07/i-just-wrote-what-might-be-worst-system.html
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by Nobody: 7:38pm On Jul 22, 2016
First to comment, PHP WAR BOYS, oya, come and finish off this dude once and for all. . . . .
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by ugo2016: 7:42pm On Jul 22, 2016
Lol! Was wondering when you will write again. This forumn is just dull without these articles.
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by larisoft: 7:45pm On Jul 22, 2016
ugo2016:
Lol! Was wondering when you will write again. This forumn is just dull without these articles.

Wow! Thanks man! Have been too occupied lately. I'm glad you enjoy my opinions. Please note that I sometimes publish articles on my blog which I do not share here.
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by larisoft: 7:47pm On Jul 22, 2016
dhtml18:
First to comment, PHP WAR BOYS, oya, come and finish off this dude once and for all. . . . .

Lol! what are forumns like this for my brother?
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by FrankLampard: 8:19pm On Jul 22, 2016
Larry my man, I'm waiting for the article where you will talk about PHP's bad design.

Them go complain, yet go back to their vomit. #Nawa.
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by bot101(m): 8:21pm On Jul 22, 2016
My neighbours are beginning to think I am crazy. grin grin grin


Let me not say mine sha, lost a lot of money on that so to talk am go dey bring bad memories.
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by Nobody: 8:45pm On Jul 22, 2016
larisoft:

Lol! what are forumns like this for my brother?
I can answer that, it is for TROLLING.
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by danidee10(m): 10:21pm On Jul 22, 2016
You could have used odoo and you'll have gotten a more robust system in minutes smiley

Or a minimal erp like django erp

I know this article isn't about erp's but I just wanted to talk about it grin
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by tr3y(m): 8:02am On Jul 23, 2016
PHP is not even phasing out anytime soon.
All languages are dumb, it is the programmers' work to make sense out of it.
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by Nobody: 8:18am On Jul 23, 2016
tr3y:
PHP is not even phasing out anytime soon.
All languages are dumb, it is the programmers' work to make sense out of it.
gdevit.com is done with php, and it is quite cool. It is not the language but what you make out of it. Great developers (like me) get the best even out of rugged systems.

If we setup a competition, I can beat some of you modern guys with just visual basic 6.0 as old as that thing is.
Reason: it was the first language i mastered (and i believe that any trick that i dont know in visual basic 6.0 is not worth knowing) before I even started web development, and I have learnt how to implement other languages (like javascript, flash actionscript, JAVA, C++, Python even NODE.JS) in a regular visual basic 6 projects using techniques (mostly discovered by me and not readily documented anywhere) that i have mastered over the course of several projects (over 15years+).

For example, all my phpbrowserbox (just search google for phpbrowserbox) versions (except the latest version 4.0) were built on visual basic 6.0 (because it is TRULY MY BEST LANGUAGE - TILL DATE). All other languages that I have learnt JAVA, NODE.JS, PHP etc are all secondary languages as far as I am concerned.

If i were to rate the languages that I know in descending order based on my mastery, it will start like this:
- VISUAL BASIC 6.0 [Master Troll]
- JAVAScript / dhtml [that is where my dhtml ID came from]
- ASP (not .NET mind you)
- PERL
- NODE.JS / PHP /JAVA [there is a tie at this point]
- C, C++

2 Likes

Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by larisoft: 10:32am On Jul 23, 2016
danidee10:
You could have used odoo and you'll have gotten a more robust system in minutes smiley

Or a minimal erp like django erp

I know this article isn't about erp's but I just wanted to talk about it grin

thanks man. I m checking out odoo today. you wouldn't believe how everybody wants systems these days and no one wants programs anymore.
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by larisoft: 10:46am On Jul 23, 2016
tr3y:
PHP is not even phasing out anytime soon.
All languages are dumb, it is the programmers' work to make sense out of it.

Php is here to stay. but all languages are not dumb. perl, python, c#, to mention a few, are languages that were designed carefully, in strict adherence to core computer science principles established over years of trial and error.

I think I will write an article detailing the design flaws of php. I feel weird perpetuating this but....I guess it'd demand and supply.
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by Nobody: 10:59am On Jul 23, 2016
Larisoft, I am still waiting for you to write an article on creativity of developers. You are always hammering on codes and languages which to me is boring.
Make a post on an API, a tool for aiding programmers, useful classes or libraries or extensions that you or someone else have written.
But all these senseless arguments about which languages are better is simply boring and uninteresting to me. I am in favour of creativity, and business. There is no productivity in this thread as far as I am concerned.

Someone built gdevit.com on PHP, you no talk anything. Someone created a nice UI for nairaland mobile app - those are interesting.

This sort of rubbish does not happen on gdevit.com for instance. And I will not reply this post or open this thread again.
This is not a discussion, it is simply a statement from an angry troll.

And I hereby unsubscribe to all Larisoft's posts or any kind of post like this from now henceforth.

- Signed DHTML18 (King Troll of Nairaland Programming Section and Pro-Gdevit Fan)

4 Likes

Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by danidee10(m): 11:16am On Jul 23, 2016
larisoft:


thanks man. I m checking out odoo today. you wouldn't believe how everybody wants systems these days and no one wants programs anymore.

Forgetting that programs make up a system
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by tr3y(m): 1:22pm On Jul 23, 2016
larisoft:


Php is here to stay. but all languages are not dumb. perl, python, c#, to mention a few, are languages that were designed carefully, in strict adherence to core computer science principles established over years of trial and error.

I think I will write an article detailing the design flaws of php. I feel weird perpetuating this but....I guess it'd demand and supply.
Depends on your definition of dumb. Did I hear you say python is not dumb, I freaking hate the language. Now that is my opinion though.
Personally I like JavaScript and most coders claim its a stupid language which is not far from the truth if you don't know the in and out of the language (quirks).

Recent Stackoverflow survey even shows that JavaScript coders are the most sought after in the industry because it is versatile.

It seems you are not leaving PHP alone anytime soon grin

1 Like

Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by tr3y(m): 1:25pm On Jul 23, 2016
dhtml18:
Larisoft, I am still waiting for you to write an article on creativity of developers. You are always hammering on codes and languages which to me is boring.
Make a post on an API, a tool for aiding programmers, useful classes or libraries or extensions that you or someone else have written.
But all these senseless arguments about which languages are better is simply boring and uninteresting to me. I am in favour of creativity, and business. There is no productivity in this thread as far as I am concerned.

Someone built gdevit.com on PHP, you no talk anything. Someone created a nice UI for nairaland mobile app - those are interesting.

This sort of rubbish does not happen on gdevit.com for instance. And I will not reply this post or open this thread again.
This is not a discussion, it is simply a statement from an angry troll.

And I hereby unsubscribe to all Larisoft's posts or any kind of post like this from now henceforth.

- Signed DHTML18 (King Troll of Nairaland Programming Section and Pro-Gdevit Fan)

I knew it.

There is something between you and boomatanga. I can almost swear its more than meet the eye self.

2 Likes

Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by tr3y(m): 1:28pm On Jul 23, 2016
dhtml18:


VBASIC, sir which era are you from?

I only know JavaScript and PHP, the rest (Python, ruby), I am only familiar with.

I am sure you won't beat anybody with your Vbasic though. Respect still.
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by webninja: 1:39pm On Jul 23, 2016
@OP this section is about programming, stop posting silly escapades here about you or your shitty larisoftng blog.. reason the programming section is full of low quality Posts no moderation at all..

2 Likes

Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by Craigston: 3:41pm On Jul 23, 2016
webninja:
@OP this section is about programming, stop posting silly escapades here about you or your shitty larisoftng blog.. reason the programming section is full of low quality Posts no moderation at all..
Really?
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by Nobody: 5:50pm On Jul 23, 2016
tr3y:

VBASIC, sir which era are you from?

I only know JavaScript and PHP, the rest (Python, ruby), I am only familiar with.

I am sure you won't beat anybody with your Vbasic though. Respect still.
Someone drew my attention to this your comment and I came back here just for this.

Now, I hereby dare you to challenge me with a not-so-complicated windows app - I shall use visual basic 6.0, and you can use any language of your choice.
In fact, I double-dare you to try. As for Era, I have been coding relentlessly since 1998 (and I am familiar with all programming technologies from that ERA to this ERA - yeap, qbasic, fortran, cobol, turbo-pascal, cold-fusion, action-script 1.0, flexbuilder and all that). And I have been writing windows applications right from windows 95 through windows 98, ME to windows 10. O yeah, that is the ERA that I am from, and in the course of that time period, I have successfully mastered quite an array of programming languages - but I am not here to fumble, challenge me if you dare - leave all that story.

Before I end this post, I should add that I can also code well with VB.NET (any version). But for portable apps, I still use VB 6.0 (or NODE.JS in form of NODE WEBKIT) - and I dont care what anyone says about that.

I hate fumbling, but what I hate more is for people to be coding with their mouth. So, I am waiting for you to challenge me and you must win - because you said I CANNOT BEAT ANYONE WITH VB 6.0.
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by Nobody: 6:01pm On Jul 23, 2016
webninja:
@OP this section is about programming, stop posting silly escapades here about you or your shitty larisoftng blog.. reason the programming section is full of low quality Posts no moderation at all..
No o, we should not abuse his blog now. He is trying with his post, and he can write well. It is just the direction that he is taking with bashing languages that I do not like. Because I see all these languages as tools.

Whenever, I receive any job request, I sharperly select the best language for the job. Like yesterday, a .NET job came in, I just quickly upgraded my .NET to latest version, despite the fact that it is not one of my favorite languages.

Based on experience and lots of things, if for a given job that I wish to do, the best tool appears to be Python, then I go python for that job. I dont have any favorite language to handle every single job request. That is why i can never tell anyone to learn just one language and sit on it.

But some people use a single language, and try to force everyone to adopt that language - usually by criticizing other languages - and this is the approach that I do not like.

2 Likes 1 Share

Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by Booyakasha(f): 6:03pm On Jul 23, 2016
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by Nobody: 6:10pm On Jul 23, 2016
Very funny, I am super-charged right now, as in my blood dey hot. I am waiting for my challenger, and pounding my chest like king-kong for that matter.
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by larisoft: 6:24pm On Jul 23, 2016
webninja:
@OP this section is about programming, stop posting silly escapades here about you or your shitty larisoftng blog.. reason the programming section is full of low quality Posts no moderation at all..

Thanks for noticing me bro. Am sorry my posts annoy you but now you know me and I know you...and its probably because of them. If that's all it has earned me, its not entirely unprofitable.

About the blog; I'm sure (and hope) you will develop a better opinion of it someday. I am learning! What I dont know today, I will know tommorrow.

Thanks for reading!!!!

1 Like

Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by Nobody: 6:38pm On Jul 23, 2016
^^^Na just beef jare, them dey beef your blog, keep up the good work jare. I am still waiting for the sach guru to come and comment on this thread.
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by tr3y(m): 7:36pm On Jul 23, 2016
@dhtml18 I have removed the quote oo, You no even sabi when someone is playing. grin

You wish.
I am contesting on Hackerrank CodeSprint now. If you are cool with it, larisoft may select one of the hardest Algorithm on Hackerrank or any other online code rank site, then drop it at maybe 6pm tomorrow then the first person to finish wins.
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by Nobody: 7:45pm On Jul 23, 2016
lol, i was playing too jare - just trolling actually - i am sure you dont want me to end up in disgrace like a certain ehm ehm phD professor. . . . . .why you wan select the hardest algorithmn now? you want give me a heart-attack in old e-age ni?
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by Nobody: 9:05pm On Jul 23, 2016
Oh Almighty God please don't let me be someone who designs and write systems for clients when I graduate
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by Nobody: 9:24pm On Jul 23, 2016
malailayi:
Oh Almighty God please don't let me be someone who designs and write systems for clients when I graduate

An everlasting Amen to that:

while(true) {
Amen();
}
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by godofbrowser(m): 11:29pm On Jul 23, 2016
tr3y:

Depends on your definition of dumb. Did I hear you say python is not dumb, I freaking hate the language. Now that is my opinion though.
Personally I like JavaScript and most coders claim its a stupid language which is not far from the truth if you don't know the in and out of the language (quirks).

Recent Stackoverflow survey even shows that JavaScript coders are the most sought after in the industry because it is versatile.

It seems you are not leaving PHP alone anytime soon grin

even my pc knows I love javascript, at a time i didn't wanna learn jquery as a framework and even after I did, I always try to find a javascript alternative to any jquery function I find interesting.

ex::

jquery::
$('.box').each(function(){
statements...
}); //will connect to every element with class "box"

javascript ::
var box = document.getElementsByClassName('box');
var i;
for ( i=0; i < box.length; i++) {
statements...
}
//will also do the same job.


and that reminds me jquery's called "write less, do more"
Re: I Just Wrote What Might Be The Worst System Ever Programmed In This Country by tr3y(m): 11:49pm On Jul 23, 2016
godofbrowser:


even my pc knows I love javascript, at a time i didn't wanna learn jquery as a framework and even after I did, I always try to find a javascript alternative to any jquery function I find interesting.

ex::

jquery::
$('.box').each(function(){
statements...
}); //will connect to every element with class "box"

javascript ::
var box = document.getElementsByClassName('box');
var i;
for ( i=0; i < box.length; i++) {
statements...
}
//will also do the same job.


and that reminds me jquery's called "write less, do more"
Jquery just abstracts the whole process. If you check it's source code you will find its pretty much the same thing.

One benefit of Jquery is the for solving any cross browser headache e.g getElementsByClassName is not fully supported, same with querySelectorAll.
I guess it's necessary evil especially when it comes to front end development.

(1) (2) (Reply)

Download Spynote RAT V6.5 And Hack Android Devices Remotely / ATTENTION: Programming Logic Comparison / How To Choose A Programming Language

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 85
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.