Coding techniques from our past

Everything else that doesn't fall into one of the other PB categories.
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Coding techniques from our past

Post 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:
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8433
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Coding techniques from our past

Post 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'."
BERESHEIT
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: Coding techniques from our past

Post 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...
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Coding techniques from our past

Post by Dude »

netmaestro, I loved the plot twist! :mrgreen:
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: Coding techniques from our past

Post 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
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
skywalk
Addict
Addict
Posts: 3997
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Coding techniques from our past

Post 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
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Post Reply