The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 24, 2012, 02:19:18 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: On commenting your code...  (Read 1450 times)
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 9896



View Profile
« on: December 07, 2010, 03:59:17 PM »

Wow. Sudden borderline emergency to do a considerable amount of research and work on some code that I started writing 13 years ago (fundamental libraries and tools written in Delphi then ported to Kylix) and did the majority of work taking it to about 200K lines of Apache .so from 2001 to 2003. I have not touched it for 4 years. FFS, I don't even look at Object Pascal anymore. This stuff runs in a virtual of RedHat 7 because that was the last version of the kernel that Kylix would run on LOL. Hesitation and squinching of the eyes aplenty at the prospect.

But!

I developed my own sort of narrative style of coding where the variables, comments and structure tell a story about 20 years ago. Not that this is any big thing, every coder should do it. But my style is uniquely built for the way I read and interpret. I have to stay *very* disciplined about my coding style because I swear to God if I don't , I don't recognize sh!t I wrote just a couple months ago.

So I opened the projects today and, after a bit of stretching my eyes and fingers around Kylix again for a few I was all over it. Problems averted, code updated. Easily readable, followed the logic through how it builds and executes. And damn, I was good. Wink

Anyhoo: This is the oldest code of mine I've ever needed to open back up and work through. The discipline and extra effort it takes to make sure your code is wired tight is SO VERY WELL WORTH IT. It doesn't matter if it's just a couple lines, you KNOW it will break at some point and you'll have to fix it.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
nutballs
Administrator
Lifer
*****
Offline Offline

Posts: 5627


Back in my day we had 9 planets


View Profile
« Reply #1 on: December 07, 2010, 04:10:52 PM »

pfft. i just dont answer the phone.
Logged

I could eat a bowl of Alphabet Soup and shit a better argument than that.
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 9896



View Profile
« Reply #2 on: December 07, 2010, 07:22:29 PM »

Liar!  ROFLMAO
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
nutballs
Administrator
Lifer
*****
Offline Offline

Posts: 5627


Back in my day we had 9 planets


View Profile
« Reply #3 on: December 07, 2010, 08:52:16 PM »

The other option is to just charge a lot to relearn your code.
Logged

I could eat a bowl of Alphabet Soup and shit a better argument than that.
Phaėton
Lifer
*****
Offline Offline

Posts: 507


⎝⏠⏝⏠⎠


View Profile
« Reply #4 on: December 07, 2010, 09:59:17 PM »

Cool.....  I talked to my boss at the delphi shop ... hes still rocking the RAD for money!
Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
daviator
Expert
****
Online Online

Posts: 319


View Profile
« Reply #5 on: December 08, 2010, 02:12:12 AM »

The other option is to just charge a lot to relearn your code.

The fact that you don't have to relearn your code and can complete the work quickly doesn't preclude you from charging a lot to ostensibly relearn it.   Grin
Logged
kurdt
Lifer
*****
Offline Offline

Posts: 1153


paha arkkitehti


View Profile
« Reply #6 on: December 08, 2010, 04:47:01 AM »

Or you could outsource it all to reliable provider and never worry about having to relearn your own code or even write your own code Wink
Logged

I met god and he had nothing to say to me.
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 9896



View Profile
« Reply #7 on: December 08, 2010, 06:41:44 AM »

Or you could outsource it all to reliable provider and never worry about having to relearn your own code or even write your own code Wink

That depends mightily on whether or not someone can be found that can do what I do Wink
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 1669



View Profile
« Reply #8 on: December 08, 2010, 01:32:49 PM »

I hope this never happens to me. Then again, most of what I've written is wiped out within a few months by other developers working on the same products. The rest of it...well, I went through what I use and ported everything I had ever written to Ruby, and I put virtually no comments in my Ruby code because it's so eminently readable on its own. Damn, I love Ruby. To the point of fanboism.
Logged

hai
isthisthingon
Global Moderator
Lifer
*****
Offline Offline

Posts: 2873



View Profile
« Reply #9 on: December 16, 2010, 12:25:03 AM »

Nothing like unit tests to run regressions for you, especially with code that's cooled off for a while.  But nothing can possibly compare to producing good code in the first place Wink

Cheers and welcome back from the past!
Logged

I would love to change the world, but they won't give me the source code.
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!