Page 2 of 2 FirstFirst 12
Results 16 to 29 of 29

Thread: Grrarrrgh, terrible code - Web Dev Vent Megathread

  1. #16
    Join Date
    3rd February 2004 - 08:11
    Bike
    2021 Street Triple RS, 2008 KLR650
    Location
    Wallaceville, Upper hutt
    Posts
    5,234
    Blog Entries
    5
    Our new web dev at work showed me this:

    http://theoatmeal.com/comics/design_hell

    He had some pretty uncomplimentary things to say about his predecessors, too.
    On the other hand, he has a job for life, sorting out their shit.
    it's not a bad thing till you throw a KLR into the mix.
    those cheap ass bitches can do anything with ductape.
    (PostalDave on ADVrider)

  2. #17
    Join Date
    15th August 2004 - 17:52
    Bike
    KTM 2T & LC4
    Location
    Rather be riding
    Posts
    3,326

    Top tips

    Break your code up in to small manageable chunks. Don't write a 350-line subroutine that basically does the same thing to 10 elements... normalise it, write a function to do the thing, call it 10 times. Much, much better. Whitespace does cost, in that instance, as it cannot be collapsed and must be scrolled through. Gets extremely tedious and time-consuming to work with.

    Of course the smaller chunks can be tested, proven, library-ised and forgotten about.

    Comments should describe what is being done (eg "add GST"), not how it's being done ("multiply by 1.15").

    The most common style advice is to be consistent - and everyone sharing code on the project should use the same style. Conventions don't matter so much, as long as you follow whichever one you've chosen.

    I _hate_ working with crappy, lazy, ignorant coders.
    Cheers,
    Colin

    Quote Originally Posted by Steve McQueen
    All racers I know aren't in it for the money. They race because it's something inside of them... They're not courting death. They're courting being alive.

  3. #18
    Join Date
    23rd August 2008 - 14:37
    Bike
    Speed Triple 1050, '89 Spada
    Location
    Wellington
    Posts
    1,763
    All old and / or large systems eventually turn into a big ball of mud as described here:
    http://www.laputan.org/mud/

    Well worth a (geek) read.
    Quote Originally Posted by FlangMaster
    I had a strange dream myself. You know that game some folk play on the streets where they toss coins at the wall and what not? In my dream they were tossing my semi hardened stool at the wall. I shit you not.

  4. #19
    Join Date
    8th December 2009 - 16:11
    Bike
    Nothing, sadly
    Location
    Browns Bay
    Posts
    175
    Quote Originally Posted by davebullet View Post
    All old and / or large systems eventually turn into a big ball of mud as described here:
    http://www.laputan.org/mud/

    Well worth a (geek) read.
    That was actually fantastically read. Tempted to drop my hourly rate but tell clients I will only build sites on the precursor that they first read that.

    Then ftp all the images out and bomb the site.

  5. #20
    Join Date
    23rd August 2008 - 14:37
    Bike
    Speed Triple 1050, '89 Spada
    Location
    Wellington
    Posts
    1,763
    The worst system I worked on was a life insurance capture application (client / server) that had 1,500 classes - each UI element was subclassed!

    Do web developers these days use OO practices? I know various frameworks exist, but wonder whether OO theory is still widespread?
    Quote Originally Posted by FlangMaster
    I had a strange dream myself. You know that game some folk play on the streets where they toss coins at the wall and what not? In my dream they were tossing my semi hardened stool at the wall. I shit you not.

  6. #21
    Join Date
    15th September 2004 - 22:33
    Bike
    Hornet 900
    Location
    Capital town
    Posts
    3,471
    Crappy code = Code that does not deliver the solution to your customers expectations.

    Good code = Any code that delivers the customers expected result.

  7. #22
    Join Date
    8th December 2009 - 16:11
    Bike
    Nothing, sadly
    Location
    Browns Bay
    Posts
    175
    Quote Originally Posted by Kendog View Post
    Crappy code = Code that does not deliver the solution to your customers expectations.

    Good code = Any code that delivers the customers expected result.
    How far into the future does that extend? Only to the moment they see it, or to the moment they discover Web Dev #2 is going to take 5 hours to do something that should have taken 1 because of Web Dev #1's practises?

    Trying to decide whether you're the crappy coder we're talking about.

  8. #23
    Join Date
    17th February 2005 - 11:36
    Bike
    Bikes!
    Location
    Christchurch
    Posts
    9,649
    Quote Originally Posted by Gremlin View Post
    Don't seek to write perfect code either. Like most jobs, perfection has to be balanced with delivery.
    Yup, don't over engineer, there's no money in it.

    Quote Originally Posted by pzkpfw View Post
    Yes, it's all very good the way inheritence of styles works, and it's nice how you can sub-class the style selectors and all that; but geez it's hard sometimes to figure out why that box over there looks that way.
    No no no. There are plenty of point n click tools that will tell you exactly how a particular element got it's rules applied. Work smarter, not harder.

    Quote Originally Posted by sil3ntwar View Post
    And on a completely unrelated note i have a mate getting paid to write PHP when he has never done it before.
    That's nothing. One guy I know looks after a webhosting companies technical odds and sodds... 8 servers, (2 Apache/MySQL, 5 IIS, 1 MSSQL), 8 different CMS systems (mixture of PHP/ASP/ASP.NET ones)... he looks after the servers, the code, the databases, everything... over 500 sites, and he's knows nothing about operational tasks, has never done a lot of PHP, or PASP, or other even weirder shit... and still gets $150 an hour for the privlege. Sickening ain't it

  9. #24
    Join Date
    9th November 2005 - 18:45
    Bike
    2005 Z750S
    Location
    Wellington
    Posts
    1,136
    Quote Originally Posted by imdying View Post
    No no no. There are plenty of point n click tools that will tell you exactly how a particular element got it's rules applied.
    Sure, but that still doesn't make the CSS any easier to edit (with whatever tool) or to add a new rule to or ...

    Bad messy CSS is bad messy CSS, regardless of what tool you use to see what it's doing.

    (Bad analogy time) It's like how a Doctor might have a new fangled high resolution MRI scan of your guts, to see what that bullet did, but it's still going to be hard for him or her to fix you up.



    Quote Originally Posted by davebullet View Post
    The worst system I worked on was a life insurance capture application (client / server) that had 1,500 classes - each UI element was subclassed!
    That reminds me of a large VB6.0 app I had to support, many many years ago. Absolutely full of stuff like (my memory-fu is weak):

    sub EnableButton(Button theButton, Bool enabledOrNot)
    theButton.Enabled = enabledOrNot
    end sub

    Tons and tons of absolutley normal stuff was farmed out into subs and funcs and stuff. Way pointless and meant you had to dig through twice as much code as you should, to trace through what was going on.
    Measure once, cut twice. Practice makes perfect.

  10. #25
    Join Date
    24th February 2010 - 21:01
    Bike
    2007 Suzuki SV1000s
    Location
    Wellington
    Posts
    728
    Quote Originally Posted by EJK View Post
    Any personal opinions/hints/tips to avoid writing crappy codes?
    yes, the biggest is DO NOT OUTSOURCE TO INDIA. Those cheap pricks write the worst code. Pay peanuts, get monkeys.

  11. #26
    Join Date
    16th September 2004 - 16:48
    Bike
    PopTart Katoona
    Location
    CT, USA
    Posts
    6,542
    Blog Entries
    1
    Quote Originally Posted by EJK View Post
    Any personal opinions/hints/tips to avoid writing crappy codes?
    Comments are like GOLD!!
    Make the code 3 x in length.....I DONT CARE!! JUST ADD COMMENTS!
    Reactor Online. Sensors Online. Weapons Online. All Systems Nominal.

  12. #27
    Join Date
    16th September 2004 - 16:48
    Bike
    PopTart Katoona
    Location
    CT, USA
    Posts
    6,542
    Blog Entries
    1
    Meh - you guys complain to much.
    Trust me it gets a hell of a lot more worse when you have to have code interface to stuff in the real world.
    Embedded loops, broken cases or even a bad pointer means that someone (usually sitting in a comfy office somewhere) pushes a button on a web page and then a train on a site somewhere goes into "runaway" mode.

    Consultants are the bane of my life, and could not design an exit out of a cardboard box.
    Reactor Online. Sensors Online. Weapons Online. All Systems Nominal.

  13. #28
    Join Date
    17th February 2005 - 11:36
    Bike
    Bikes!
    Location
    Christchurch
    Posts
    9,649
    Quote Originally Posted by pzkpfw View Post
    Sure, but that still doesn't make the CSS any easier to edit (with whatever tool) or to add a new rule to or ...

    Bad messy CSS is bad messy CSS, regardless of what tool you use to see what it's doing.

    (Bad analogy time) It's like how a Doctor might have a new fangled high resolution MRI scan of your guts, to see what that bullet did, but it's still going to be hard for him or her to fix you up.
    I dunno mate, I never have much trouble fixing that sort of stuff... compared to what I normally do it's a walk in the park.

  14. #29
    Join Date
    25th June 2008 - 07:37
    Bike
    K6 1K
    Location
    East Auckland
    Posts
    425
    Crap code and system design is killing me right now. Supporting/maintaining multiple legacy apps and systems where 3rd party controlled PC-connected embedded cryptographic devices have to work across all manner of unreliable networks and that at least 20 previous "rockstar" programmers have all mangled horribly before landing in my lap is causing me to seriously rethink my vocation! I really enjoy programming, but other people's horrid code just serves to make me realise how good my own code is

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •