Author Topic: Coding Quote  (Read 4509 times)

0 Members and 1 Guest are viewing this topic.

Offline NuMysterio

  • Newbie
  • *
  • Posts: 43
Coding Quote
« on: November 17, 2009, 12:14:49 PM »
I know little about coding, but I came across this statement from this blog and figured it might be relevant for those of you plugging away at this game:

Quote
Crack open your current project. Now, delete as much stuff as you can and still have it work. Done? Okay, now toss out more, because I know that your first pass was too timid. Pretend that you’re paying cash for every line of code. If your project incorporates code by other people, wade into their stuff, too. You’ll be amazed how much can come out.

Don’t leave unused code hanging around because it might be useful someday. If it’s not being used right now, remove it, because even just sitting there it’s costing you. It costs to compile (you have to fix build breaks in stuff you’re not even using), it costs to ignore it in searches, and the chances are pretty good that if you do go to use it someday, you’ll have to debug it, which is really expensive.

It’s tremendously freeing to zap the fat in a system, and after a while it’s addictive. Read all code with an eye towards “What is superfluous?” and you’ll be amazed at how much unused, half-written and buggy crap there is in loose in the world, and how much better off we are without it.

Offline necno

  • Core Developer
  • ******
  • Posts: 385
Re: Coding Quote
« Reply #1 on: November 17, 2009, 03:38:38 PM »
lol, thats actually starting to happen anyway. I think 1.30 will be alot cleaner and functional. Already many bugs have been squashed.
Click here to donate
After you do so please pm me the email address you used so I can add you to the donation forum.

Working on:
Whoremaster II (Official)
Birthright (Now a commercial rougelike)

Offline delta224

  • Dev Team
  • *****
  • Posts: 577
Re: Coding Quote
« Reply #2 on: November 17, 2009, 04:11:24 PM »
As one of the coders, all I have to say is this, Do not reinvent the wheel, this causes so many errors.  The heap corruption error was a result of reinventing the wheel.  If the standard library already does what you need it to do, use it.  The code will be cleaner and there will be less errors down the road.
 
Necro, for C++ this is one of the best references on its standard library I have found online http://www.cplusplus.com/reference/ to the point I have the site bookmarked.

Offline DocClox

  • Dev Team
  • *****
  • Posts: 1867
  • Messing Around With Python
Re: Coding Quote
« Reply #3 on: November 17, 2009, 04:53:04 PM »
Yeah. One of the things I really want to do is go through and replace all those hand rolled linked lists with std::vector or std::dequeue. It'll clean things up a lot, and eliminate a lot of potential errors

Offline delta224

  • Dev Team
  • *****
  • Posts: 577
Re: Coding Quote
« Reply #4 on: November 17, 2009, 05:14:46 PM »
I will help you with that DocClox.

Offline necno

  • Core Developer
  • ******
  • Posts: 385
Re: Coding Quote
« Reply #5 on: November 20, 2009, 03:36:47 PM »
Yeah, i did think to use STL but i decided i needed the practice and linked lists are a snap to make. That and i always feel STL looks messy.
Click here to donate
After you do so please pm me the email address you used so I can add you to the donation forum.

Working on:
Whoremaster II (Official)
Birthright (Now a commercial rougelike)

Offline delta224

  • Dev Team
  • *****
  • Posts: 577
Re: Coding Quote
« Reply #6 on: November 20, 2009, 03:46:32 PM »
My main issue with STL and templates in general, are the error messages that pop out.  It only gets messy if you deal with the iterators, which I refuse to touch.

Offline DocClox

  • Dev Team
  • *****
  • Posts: 1867
  • Messing Around With Python
Re: Coding Quote
« Reply #7 on: November 20, 2009, 04:08:35 PM »
Well, you need 'em for some of the container classes. But yeah, I don't like iterators either. Someone involved in the design of C++ templates was a Smalltalk fan, unfortunately.