Over complicating code

  • (2 Pages)
  • +
  • 1
  • 2

23 Replies - 2895 Views - Last Post: 11 May 2014 - 10:53 AM

#16 cfoley  Icon User is online

  • Cabbage
  • member icon

Reputation: 2065
  • View blog
  • Posts: 4,290
  • Joined: 11-December 07

Re: Over complicating code

Posted 09 May 2014 - 12:19 PM

Dear God, is nothing sacred?!
Was This Post Helpful? 0
  • +
  • -

#17 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7950
  • View blog
  • Posts: 13,543
  • Joined: 19-March 11

Re: Over complicating code

Posted 09 May 2014 - 12:21 PM

Nope.
Was This Post Helpful? 0
  • +
  • -

#18 cfoley  Icon User is online

  • Cabbage
  • member icon

Reputation: 2065
  • View blog
  • Posts: 4,290
  • Joined: 11-December 07

Re: Over complicating code

Posted 09 May 2014 - 12:25 PM

Not even figuratively?
Was This Post Helpful? 0
  • +
  • -

#19 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7950
  • View blog
  • Posts: 13,543
  • Joined: 19-March 11

Re: Over complicating code

Posted 09 May 2014 - 12:33 PM

Nope.
Was This Post Helpful? 0
  • +
  • -

#20 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5901
  • View blog
  • Posts: 12,805
  • Joined: 16-October 07

Re: Over complicating code

Posted 09 May 2014 - 02:36 PM

Heh. I'm a DBA. When I was a fledgling DBA I warned against being too proactive.

That is, optimizing everything as well as you can means you have nowhere to go when someone inevitably bitches about speed. If you wait until the pain is so bad that you're asked to investigate, your optimizations will meet with much more appreciation. ;)

I've never knowingly left a bug in... though I have seen stuff escape into production that I suspected might be a future problem and put them on my to do list.
Was This Post Helpful? 0
  • +
  • -

#21 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7950
  • View blog
  • Posts: 13,543
  • Joined: 19-March 11

Re: Over complicating code

Posted 09 May 2014 - 03:13 PM

If I'm going to be honest, I haven't actually used that trick either... but I've been tempted.
Was This Post Helpful? 0
  • +
  • -

#22 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3649
  • View blog
  • Posts: 11,416
  • Joined: 05-May 12

Re: Over complicating code

Posted 11 May 2014 - 12:39 AM

LOL! The opening post reminded me of this old post about Mortgage Driven Development.

Quote

Do the simplest thing that could possibly work

So you can probably imagine how frustrated I get working with people whose mantra appears to be:

Make the biggest mountain you can out of any molehill

...

Anyhoo, we were bemoaning those people who make things as complicated as possible, and it suddenly hit me like a bolt through the brain - what if these people really are doing the simplest thing that could possibly work, only their goals are not what we think they are?

... But what if your goal was to pay off your mortgage? The longer it is before you're not needed any more, the more payments you can make. ...


Anyway, on a tangent, if you need a good laugh, it's always good to review the refuctoring slides, and read other fun articles: http://www.waterfall2006.com/
Was This Post Helpful? 1
  • +
  • -

#23 creativecoding  Icon User is offline

  • Hash != Encryption
  • member icon


Reputation: 927
  • View blog
  • Posts: 3,211
  • Joined: 19-January 10

Re: Over complicating code

Posted 11 May 2014 - 06:57 AM

I haven't seen this mentioned yet so I think I will.

I honestly think overly complex code is created by people who wish to follow a design pattern but simply haven't learned one yet. Overly complex codes with lots of modules/classes/functions typically doing minuscule things at once are a sign that the writer wishes to compartmentalize their code but don't know how to effectively do it in a correct manner.

I think what you need to do is learn a proper design pattern. This can be hard for smaller projects because usually you'll end up writing more than if you hadn't, but when you get into larger projects you'll be thankful.

also jon.kiparsky, how the heck do you sneak a bug in lol. "if($logged_in && mt_rand(0,1)) /* now that I have your attention, fix this */" is all I can think of :P
Was This Post Helpful? 1
  • +
  • -

#24 depricated  Icon User is offline

  • You and me had such wonderful times when I'm all by myself.

Reputation: 877
  • View blog
  • Posts: 2,848
  • Joined: 13-September 08

Re: Over complicating code

Posted 11 May 2014 - 10:53 AM

View Postcreativecoding, on 11 May 2014 - 07:57 AM, said:

also jon.kiparsky, how the heck do you sneak a bug in lol. "if($logged_in && mt_rand(0,1)) /* now that I have your attention, fix this */" is all I can think of :P/>

easy example off the top of my head is in VB.NET to use iif() instead of if() when writing a function that will evaluate null a small percentage of the time and doesn't get run often. "I need this out by noon today but really need a few more hours to get it done." 3 months later a defect kicks back to you for that function because iif() evaluates both sides of the argument and errors if it evaluates to null, while if() only evaluates the side of the argument that will be used.

Not that I'd ever do that.
Was This Post Helpful? 1
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2