Home
Thursday, May 25, 2017
5:32:14 AM
Users online: 0   You are here >> Home > Programming

Forums | Programming Forums search
Forum FAQ
   
  1  
What buggy code does to users
^Faldo^ 
5/8/08 11:23:50 AM
God

I have spent the last one and a half hours trying to fill in about 15 fields to publish an article. I swear there's a Screw.With.Editorial.Team call in our CMS that takes your input, adds zero, waits 5 minutes, then returns the value and lets you keep working.

I have a lot of respect for people who can code, because I can't. But christ almighty: if you're going to do it, do it right -- or the people who interact with it will hate you.

Fuck bad code.

-DAVE.

-----

kikz 
5/8/08 11:42:20 AM
Immortal

Yep. There's definitely something to be said about writting maintainable code. IMO writting maintainable code should be above just about anything else. Including performance.

#1 - make sure it works
#2 - make sure it can be maintained and read by those that come after you.
#3 - Everything else

-----
Q6600 | 4Gb PC6400 | 2 x 500Gb RAID 0 + 2 x 320 Gb RAID 0 | 19" Benq FP591 + 24" Samsung 245B + 19" Dell | 8800GTS 640 Mb + 8400GS 256 Mb | Gigabyte GA-P35-DS3P | Antec P182 | Corsair HX-620 | Thermalright 120 Extreme | Vista x64

Sneddo 
6/8/08 11:54:12 AM
Hero
Immortal


*sigh* I feel your pain.

At work we use a bunch custom written VB6 applications, which fail so regularly I was spending on average an hour or two per day just fixing errors caused by it. I'm just glad I don't have a hand in development, or I would go insane. Just looking at the code once made me want to poke my eyes out.

No source control (unless you count the haphazard "copy to a directory and pray nobody else has done changes" approach), horrible feature-creep over the several years it has been in operation, and two mediocre developers (including one VERY well paid consultant...) working on it have come to a complete mess. I shudder to think how much it costs the business just in lost productivity.

The sad thing is, a large chunk of the functionality could be re-written properly fairly quickly. The current system relies on external libraries which can be achieved natively in .Net, and contains common code in each module of the software package which could be abstracted out. It's like the developers have no understanding of very fundamental software engineering practices...and that's a Comp. Sci. graduate saying that, not a "proper" developer like the current guys are =\

-----
Where have all the quality posters gone?

kikz 
6/8/08 1:49:00 PM
Immortal

Sneddo, sounds like you need the services of an uber VB6 .& NET developer to redevelop the those custom applications :)

-----
Q6600 | 4Gb PC6400 | 2 x 500Gb RAID 0 + 2 x 320 Gb RAID 0 | 19" Benq FP591 + 24" Samsung 245B + 19" Dell | 8800GTS 640 Mb + 8400GS 256 Mb | Gigabyte GA-P35-DS3P | Antec P182 | Corsair HX-620 | Thermalright 120 Extreme | Vista x64

Sneddo 
6/8/08 2:19:34 PM
Hero
Immortal


Quote by kikz
Sneddo, sounds like you need the services of an uber VB6 .& NET developer to redevelop the those custom applications :)

Yeah, but without paying for one... seriously, that is exactly what we need, but management don't see it that way. Mostly because the people who caused this situation are in management positions, and nobody wants to spend any money around this place (which is likely the same reasoning behind Faldo's troubles as well, seen it many times before).

Reeeeealy frustrating...maybe they will get the idea when anywhere between one and three of the 5 IT staff resign this year...

-----
Where have all the quality posters gone?

Meeko 
6/8/08 5:48:02 PM
Titan

But kikz, if you write maintainable code, you're writing yourself out of work. If nobody else can read your code, they'll pay for you to come back and fix it. Easy money.

-----

eckythump 
6/8/08 7:46:47 PM
Overlord

Meeko: Doing a job right the first time goes a long way, too, though. It's more likely to get you a long-term job developing an ever-growing piece of software.

It also helps if you're applying for another job and the potential employer can call upon a previous employer and get told that you did an awesome job and everything just works and it's been running flawlessly since day 1.

It certainly doesn't seem like kikz is lacking for work, and while I haven't seen his code, I get the impression he's got his shit together and approaches things The Right Way[tm].

I've done sysadmin work for various people over the years, and PHP has helped facilitate an ever-growing presence of people who don't know how to code giving it a bash, and royally fucking it up. People with no sense of modularisation, no sense of code-reuse, just generally no idea at all when it comes to sensible coding practices.

The saddest thing I seen is when a bug is found in a codebase, that the devs then need to go and fix it in 30 places. 30 places where they should've gone: include("/path/to/code/base.inc"); and then include("/path/to/local/config.inc"); to actually set the 3 or 4 variables that differ in each instance of said codebase.

And you try and explain it to them, some just don't get it. Others go "ooh! that's a great idea, that'd make things a lot easier to maintain!" and then you see 2 years later they're still doing it arse-backwards.

management types have never been known for making sensible decisions, though, it's almost as if they deliberately want to fuck things up, and fuck you over. You can offer to fix things for them, tell them al lthe issues they're having and get brushed off, only to find that 3 weeks later, some random contractor turns up, charing $300/hr to do exactly what you wanted to do (and if we're being honest, potentially fucking things up themselves.)

Gotta love the industry. :)

-----
"Grandfather had an accident, he got burnt." "Oh no, how bad?" "Well, they don't fuck around at the crematorium."

Meeko 
6/8/08 8:31:43 PM
Titan

It seems to me, Ecky, that the solution is for all the good coders to become contractors and push the bad coders out of that profitable business.

-----

kikz 
6/8/08 8:49:02 PM
Immortal

Quote by Meeko
But kikz, if you write maintainable code, you're writing yourself out of work. If nobody else can read your code, they'll pay for you to come back and fix it. Easy money.


No way. There's always work for decent programmers. Not that I'm a contractor mind you. If you write maintainable code, you'll make more money, because you reduce the risk in your software and you reduce the time it take to make changes, meaning you can make more changes. Implementing more functionality = more money. Most people I know don't work on an hourly rate, we work on quotes based off specifications. I guess if you expect to the code base to be a pile of spaghetti, you'll adjust your quote accordingly, and get outbid :p

As far as contractors go, I get the impression that many people believe the majority of consultants/contracts are incompetent.


Quote by eckythump

It certainly doesn't seem like kikz is lacking for work[tm].


Quite the opposite actually :(


Quote by eckythump
The saddest thing I seen is when a bug is found in a codebase, that the devs then need to go and fix it in 30 places. 30 places where they should've gone: include("/path/to/code/base.inc"); and then include("/path/to/local/config.inc"); to actually set the 3 or 4 variables that differ in each instance of said codebase.


Yep. Code should never been duplicated. Strangely enough, another part of ensure your code is maintainable. As developers we should never trust our minds, we should expect that we won't remember the 15 other places throughout a codebase some logic is duplicated. I think it's good to programme defensively, to expect the worst, as far as believing you'll remember how your code works after you haven't seen it for 6 months. A lazy programmer is a good programmer :) Lazy programmers don't repeat make extra work for themselves by duplicating code.

-----
Q6600 | 4Gb PC6400 | 2 x 500Gb RAID 0 + 2 x 320 Gb RAID 0 | 19" Benq FP591 + 24" Samsung 245B + 19" Dell | 8800GTS 640 Mb + 8400GS 256 Mb | Gigabyte GA-P35-DS3P | Antec P182 | Corsair HX-620 | Thermalright 120 Extreme | Vista x64

zephyr 
8/8/08 12:20:34 PM
Hero
Titan


Quote by Meeko
But kikz, if you write maintainable code, you're writing yourself out of work. If nobody else can read your code, they'll pay for you to come back and fix it. Easy money.



That's like saying "if you shit on the floor, you'll get the job of cleaning it up!" Sure you make more work for yourself and no one else will want to do it anyway, but it's unpleasant and you'll lose respect because of it.

-----
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in. We're computer professionals. We cause accidents. (N. Borenstein)

Meeko 
8/8/08 7:46:24 PM
Titan

If you get paid for shitting on the floor...

It's like a job fixing tractors. If you fix threm all up so good they never fail, you will be out of a job until aomebody buys a new one.

-----

kikz 
8/8/08 10:37:13 PM
Immortal

Quote by Meeko
If you get paid for shitting on the floor...

It's like a job fixing tractors. If you fix threm all up so good they never fail, you will be out of a job until aomebody buys a new one.


WTF. How many successful businesses are built on doing a half arse job. OK ignore microsoft :p

-----
Q6600 | 4Gb PC6400 | 2 x 500Gb RAID 0 + 2 x 320 Gb RAID 0 | 19" Benq FP591 + 24" Samsung 245B + 19" Dell | 8800GTS 640 Mb + 8400GS 256 Mb | Gigabyte GA-P35-DS3P | Antec P182 | Corsair HX-620 | Thermalright 120 Extreme | Vista x64

Meeko 
9/8/08 12:12:48 AM
Titan

Telstra.

Australia Post.

The Australian government.

-----

Redhatter 
11/8/08 5:03:48 PM
Hero
Titan


I've seen my share of ugly code lately.

The approach I've taken to fixing the code has been to strip it completely to bits, break it apart into modules, get each piece working, then put it back together again.

Not fun... but it beats putting up with a truly horrible monolithic mess.

-----
Stuart Longland (aka. Redhatter, VK4FSJL)
I haven't lost my mind it's backed up on a tape somewhere...
http://atomicdoc.yi.org <-- AtomicDOC Wiki
Resident Coolie-hatted Gentoo geek. (Gentoo MIPS & Mozilla herd member)

  1  
Forums | Programming