Jump to content

  • Log In with Google      Sign In   
  • Create Account


Share your wisdom! Sage thoughts related to programming you've discovered over the years


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
43 replies to this topic

#41 irreversible   Crossbones+   -  Reputation: 1301

Posted 27 January 2013 - 05:28 AM

I'm not trying to endorse the software (though I personally find it invaluable) but 1) refactoring really is much less of a pain than you would think with VAX (which, at the end of the day, might be a better option if you're stuck with a truly cryptic codebase) and 2) I was not implying it makes code easier to read, but rather that if you're going to be abusing long names in the code, always use as much itellisense/autocomplete functionality to start with. That's what it's there for. The prod wasn't at ChaosEngine, but rather the person who wrote the code.



Sponsor:

#42 SuperVGA   Members   -  Reputation: 1118

Posted 27 January 2013 - 10:03 AM

My grandfather once said

 

"The time taken to think something through before doing it is often well spent."
                                                                                   -Jørgen Jørgensen

I've yet to prove him wrong.

I never come up with anything clever to say. On purpose, at least. smile.png

Aside from perhaps...

 

    "Always listen to Bregma." biggrin.png


Edited by SuperVGA, 27 January 2013 - 10:25 AM.


#43 ChaosEngine   Crossbones+   -  Reputation: 2284

Posted 27 January 2013 - 03:25 PM

I'm not trying to endorse the software (though I personally find it invaluable) but 1) refactoring really is much less of a pain than you would think with VAX (which, at the end of the day, might be a better option if you're stuck with a truly cryptic codebase) and 2) I was not implying it makes code easier to read, but rather that if you're going to be abusing long names in the code, always use as much itellisense/autocomplete functionality to start with. That's what it's there for. The prod wasn't at ChaosEngine, but rather the person who wrote the code.

 

I didn't take it as a dig at me, and I'm familiar with VAX; it's a great tool.

 

But in this case, the goal was to replace the legacy C++ code base with new functionality written in C# (with unit tests, yay!) so any refactoring effort on the C++ ultimately wouldn't have been worth it.


if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

#44 Milcho   Crossbones+   -  Reputation: 1175

Posted 27 January 2013 - 09:05 PM

I'm just going to throw this out there because I've suffered a lot from it:

Don't copy and paste code!

a) Common and large enough code should be in a function

and 

b) Copy-pasting will lead you to copy your mistakes, cause you to forget to rename variables and generally be bad for you

 

It's 3am here, and I just realized that the reason my code crashes at runtime is two lines that I copy-pasted but had forgotten to rename one of the parameters accordingly. F*ck me.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS