Page 1 of 1

Coding techniques from our past

Posted: Wed Feb 22, 2017 11:43 am
by Dude
Just looked at some old code of mine from 2002, which had this in it:

Code: Select all

If GetSystemMetrics_(#SM_SWAPBUTTON)=#False
  mousebutton=#VK_LBUTTON
Else
  mousebutton=#VK_RBUTTON
EndIf
Was that even necessary back then, or even today? :o

What sort of things like this do you have from your past that make you cringe? :mrgreen:

Re: Coding techniques from our past

Posted: Wed Feb 22, 2017 6:33 pm
by netmaestro
What sort of things like this do you have from your past that make you cringe?
I once spent two months as a student coding a database and text-based gui on a mainframe. I did it for the challenge alone but when it was finished the college offered to buy it from me. This was very flattering and I sold it to them along with full source. Five years later I hired a new employee who had just graduated from the school. When she heard my name she said, "you're famous" and went on to tell me that every computer science student knew my name because of the project the college had bought from me. I basked in the glow of this revelation for about 3 seconds and then she went on to add, "The computer science department gives your code to all second-year students to rewrite and change from its hopeless spaghetti-code logic into something that is properly structured and maintainable. It's listed in the course material under the heading, 'Avoiding common coding mistakes'."

Re: Coding techniques from our past

Posted: Wed Feb 22, 2017 8:39 pm
by djes
:mrgreen:
Be happy, we're at the stone age of coding, and I'm sure that some days, your skills will be recognised as of form of art...

Re: Coding techniques from our past

Posted: Thu Feb 23, 2017 12:35 am
by Dude
netmaestro, I loved the plot twist! :mrgreen:

Re: Coding techniques from our past

Posted: Mon Feb 27, 2017 3:28 am
by Lunasole
For a years after beginning I was giving a personal name for every number used in program :)
Defined custom constants or global variables for 0, 1 or any other static number used in any calculations ... also those names were always different in every new program. Inhuman ordeal for inhuman memory and hyperactivity.

// however it is also sad a bit to remember such, because of... TIME

Re: Coding techniques from our past

Posted: Mon Feb 27, 2017 4:23 am
by skywalk
netmaestro wrote:
What sort of things like this do you have from your past that make you cringe?
I once spent two months as a student coding a database and text-based gui on a mainframe. I did it for the challenge alone but when it was finished the college offered to buy it from me. This was very flattering and I sold it to them along with full source. Five years later I hired a new employee who had just graduated from the school. When she heard my name she said, "you're famous" and went on to tell me that every computer science student knew my name because of the project the college had bought from me. I basked in the glow of this revelation for about 3 seconds and then she went on to add, "The computer science department gives your code to all second-year students to rewrite and change from its hopeless spaghetti-code logic into something that is properly structured and maintainable. It's listed in the course material under the heading, 'Avoiding common coding mistakes'."
Ah yes, this is the reason vaporware is unassailable while published work is subject to critique. The world operates on the latter. :wink:

Supporting theorems:
Any given program, when running, is obsolete.
Laws of Computer Programming, I

If a program is useful, it will have to be changed.
Laws of Computer Programming, III

Program complexity grows until it exceeds the capabilities of the programmer who must maintain it.
Laws of Computer Programming, VII