Code: Select all
int function(void)
{
int i=0, x=0; //function variables
for(i=0;i<10;i++) { printf("\nblah 0x%X",i); }
if(!(i==8)) { printf("\nNot 8"); } else { printf("\n8!"); }
return x=i; //return value of i
}
Code: Select all
int function(void)
{
int i=0, x=0; //function variables
for(i=0;i<10;i++) { printf("\nblah 0x%X",i); }
if(!(i==8)) { printf("\nNot 8"); } else { printf("\n8!"); }
return x=i; //return value of i
}
this is a little messyosdnlo wrote:Sorry, haven't read all the posts, so I hope no one stole my style yet: (A Perfect Example)
I think you call that OCD. My goal is to compact my code as much as possible. Ideally, each line would be the exact same length.Code: Select all
int function(void) { int i=0, x=0; //function variables for(i=0;i<10;i++) { printf("\nblah 0x%X",i); } if(!(i==8)) { printf("\nNot 8"); } else { printf("\n8!"); } return x=i; //return value of i }
Run, boy. Run and pray we never meet in an office at work.osdnlo wrote:One thing my style does is that it provides a mild form of job security...
I think you found the next rant for your blog, Solar.Solar wrote:Run, boy. Run and pray we never meet in an office at work.osdnlo wrote:One thing my style does is that it provides a mild form of job security...
(No smiley put on purpose. I mean it.)
No wonder you want to kill me. Perhaps I should run and pray for you instead.Solar wrote:I work as a maintenance coder for roughly ten years now. Picking up the muck other people left behind and making some sort of sense out of it.
Solar wrote:I found that technical competence and legibility of source are usually directly proportional to each other.
Words of wisdom.Solar wrote:Writing obscure source is not job security, at least not in the long run, because you won't stay in the same job for all your life. Job security is when you do your job so well that your references will get you another job any time, and legibility of code is a value in itself.
No. Intentionally obfuscating source to cover your shortcomings (e.g., "being perpetually late") and having other people do double and thrice the work so you can sleep longer is mean.osdnlo wrote:Solar wrote:I found that technical competence and legibility of source are usually directly proportional to each other.
Now that's just mean.
I read this, and I'm still not sure exactly how to respond, so this is really just freelancing I'm doing here. I cannot understand how writing messy code can give you job security. Unless you're one of those incompetent, pathetic cretins who just sits in a 'department' and works at a 'job' for 'a living'.osdnlo wrote:You said it brother. Debugging is a biotch. It's the price I pay to sooth the savage beast. One thing my style does is that it provides a mild form of job security. I learned that the more mucked up I make my code, the less likely the boss will can me for being perpetually late, simply because no one else wants to work on my code. Moreover, when I am feeling pissy I remove all comments when I am done haha. Lastly, I hide my copyrights in various places in the code. This is work code I am talking about.
I think the reasoning goes something like: Only I understand the code, therefore only I can work with it, so I can't be fired. Works better the larger and more essential the obfuscated code base is, but I'd guess that then it causes so many bugs that it's probably *more* likely to get rewritten from scratch (depending on where you work, whether the time can be afforded, etc.)gravaera wrote:I cannot understand how writing messy code can give you job security. Unless you're one of those incompetent, pathetic cretins who just sits in a 'department' and works at a 'job' for 'a living'
Code: Select all
int i, j, k; // Loop indices
int somevar;
int sum=0;
And there you are, doing the only job anyone would give you: Working on the same project for the rest of your live - and that project is horribly obfuscated, uncommented and, most likely, buggy.Selenic wrote:I think the reasoning goes something like: Only I understand the code, therefore only I can work with it, so I can't be fired.