Advertisement

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

Started by January 22, 2013 05:39 AM
42 comments, last by MilchoPenchev 11 years, 9 months ago

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.

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

Advertisement

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

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.

This topic is closed to new replies.

Advertisement