Zeppu
.....wat!?
(04-01-2011, 02:37 PM)

Zeppu's Avatar
#101

I was once forced by design specs to do the following:

function int doSomething(int enableOption) {
if (enableOption == 0) optionEnabled;
}

Why the fuck would someone design something such that 0 = true?!!?! Especially in C++ where NULL == false == FALSE == 0.

Thing I hate most about my current job is the fact that higher ups want everything done yesterday which means half the things we do are temporary 'hacks' which work perfectly but make absolutely no sense. Maintainability, as expected, is now a nightmare. :(
Hari Seldon
Member
(04-01-2011, 02:39 PM)

Hari Seldon's Avatar
#102

Originally Posted by ronito:
I find it funny that developers outside of doctors are pretty much the only profession where it's pretty much expected you'll end up having to sleep in the office or work insane hours. You don't see accounting do that. Let alone sales and marketing.
Software devs need to stand up for themselves. Staying over night should only be an option if there is a life or death situation like a melting down nuclear power plant. Otherwise it is just a job so go the fuck home. If managers can't manage then fuck them. A job isn't worth anyone's sanity or health, nor is it worth ruining your relationships.
Barberetti
Member
(04-01-2011, 02:39 PM)

Barberetti's Avatar
#103

Originally Posted by ronito:
man I could write a book. And someday will.
Here's one:

"We need you to find out with this code right away!"
It was 32 pages long.
There was one, ONE, comment.
It came right before a huge 3 page for loop. It said:
//for loop
Oh man, I'm a complete amateur that writes the odd bit of VB6 just for personal stuff, and even I don't do shit like that lol.
Drkirby
Corporate Apologist
(04-01-2011, 03:53 PM)

Drkirby's Avatar
#104

While not the right topic, I figure someone should know the answer.

How would I use both an 'and' and a 'or' in a single while loop in C, or can I? Something along the lines of

Code:
While (struct != NULL && (strcmp(FirstName,struct->First) || strcmp(LastName,struct->Last)))
More or less keep evaluating the first and last name as long there is a valid node, until you ether run out of nodes or there is a match. What I am trying to do is write a function that will search a Binary Search Tree (Still in C) for a name, and return the ID once it finds the name (Or an ID of -1 if there is no node with that name)
iapetus
Scary Euro Man
(04-01-2011, 03:57 PM)

iapetus's Avatar
#105

Originally Posted by ThoseDeafMutes:
Watching first years try to do their 101 java programming assignments is hysterical. I saw one guy a while back who had typed up:


public int 7;


... and he thought this was going to create an array of 7 elements numbered 0 through 6.
You think that's funny, try getting graduate Java devs to try to implement the equals() method for a simple data object. :( It's the interview question that most people I've interviewed have flunked on.
Ubersnug
Member
(04-01-2011, 04:00 PM)

Ubersnug's Avatar
#106

Originally Posted by nickcv:
once when we were looking form new programmers a dude mailed us his resume and some code.

one of the projects that he mailed us was something his teachers made him do in college as a test:
a graveyard management system

you must be a really creepy dude to make your students do something like that.


btw, do you guys in the US all work in cubicles?
here we usually have open spaces or we are just divided in a bunch of different rooms w/o any logic.
Well, I work in Scotland and every office I have worked in has been an open office. In fact, now I'm in an office with just me and my boss.

Also just got new desktops and triple displays to replace our ageing laptops. Quite novel having visual studio on one screen, SQL server 2008 on one and your web app on the third.
Kalnos
Member
(04-01-2011, 04:02 PM)

Kalnos's Avatar
#107

Originally Posted by Drkirby:
While not the right topic, I figure someone should know the answer.

How would I use both an 'and' and a 'or' in a single while loop in C, or can I? Something along the lines of

Code:
While (struct != NULL && (strcmp(FirstName,struct->First) || strcmp(LastName,struct->Last)))
More or less keep evaluating the first and last name as long there is a valid node, until you ether run out of nodes or there is a match. What I am trying to do is write a function that will search a Binary Search Tree (Still in C) for a name, and return the ID once it finds the name (Or an ID of -1 if there is no node with that name)
You can use AND and OR operators in a single loop, yes.

Example, if X is less than 5 AND Y = true OR if X is greater than 5:

Code:
int x
bool y 

if ( ( ( x < 5) && (y == true)) || (x > 5) )
{
   //Then do shit
}
mantidor
Member
(04-01-2011, 04:07 PM)

mantidor's Avatar
#108

Originally Posted by Feep:
Fun fact: All 33,000 lines of code in my indie game have no comments. Zero.

No one is ever taking my shit. I'm the only one who knows what's up.

Comments are also for you. I know there's no way I would understand the code on my thesis at first glance if I were to look at it today.
Drkirby
Corporate Apologist
(04-01-2011, 04:07 PM)

Drkirby's Avatar
#109

So, just use parentheses to make sure the statements are evaluated like I intend to, right?

A lot of times my comments are on why a formula works or just what is being used. Like I am not going to be able to spot the fact that that I am using the formula (X1+X2)^2 + (Y1+Y2)^2 < (R1+R2)^2 off hand, but if I write.

Code:
//"Two circles overlap if the sum of there radii is greater than the distance between their centers."
//(x1-x2)^2 + (y1-y2)^2 < (r1+r2)^2
//http://www.euclideanspace.com/maths/geometry/elements/intersection/twod/index.htm
I sure as hell going to know just what I am doing.
Last edited by Drkirby; 04-01-2011 at 04:15 PM.
ronito
got my tag in the OT
(04-01-2011, 04:09 PM)

ronito's Avatar
#110

Originally Posted by mantidor:
Comments are also for you. I know there's no way I would understand the code on my thesis at first glance if I were to look at it today.
Man, has anyone ever looked at code and thought

"Who was the idiot that did this?!"

Then proceeded to take it out and have everything fall apart. Then realize that not only was it you that wrote it, but you were pretty clever for doing so?
Complex Shadow
Cudi Lame™
(04-01-2011, 04:09 PM)

Complex Shadow's Avatar
#111

Originally Posted by Drkirby:
So, just use parentheses to make sure the statements are evaluated like I intend to, right?
yes. also there is another thread just for programing questions.
Kalnos
Member
(04-01-2011, 04:10 PM)

Kalnos's Avatar
#112

Originally Posted by Drkirby:
So, just use parentheses to make sure the statements are evaluated like I intend to, right?
I would yeah. First of all it makes it more clear what you're saying, and two you won't end up with any wrong evaluations (hopefully).
John_B
Member
(04-01-2011, 04:36 PM)
#113

I remember back in school we had a PHP project. I was in a group with a couple of dudes, and one of them was always sleeping in class because he stayed up late to play WoW. So we gave him some coding assignments and sent him home. He comes back a few days later with code that had variables named Paladin, Mage, Warlock, Rogue and shit like that.

The report came back with a lot of red question marks.
nickcv
Member
(04-01-2011, 05:13 PM)

nickcv's Avatar
#114

Originally Posted by ronito:
Man, has anyone ever looked at code and thought

"Who was the idiot that did this?!"

Then proceeded to take it out and have everything fall apart. Then realize that not only was it you that wrote it, but you were pretty clever for doing so?
sometimes even six months after i coded something if i take a look back at it i ask myself if i was on crack when i wrote it


the most stupid mistake i made when i started studying programming was when it took me about 30 minutes to notice that the reason because my query wasn't working was because i didn't start the db connection
mantidor
Member
(04-01-2011, 07:39 PM)

mantidor's Avatar
#115

Originally Posted by ronito:
Man, has anyone ever looked at code and thought

"Who was the idiot that did this?!"

Then proceeded to take it out and have everything fall apart. Then realize that not only was it you that wrote it, but you were pretty clever for doing so?

haha more than once. Since we use SVN you can use the blame function and it immediately tells you who wrote each line and in what revision. Nothing worse than doing blame and seeing your name on the line that is driving you nuts.
theJwac
Member
(04-01-2011, 07:43 PM)

theJwac's Avatar
#116

Originally Posted by ronito:
man I could write a book. And someday will.
Here's one:

"We need you to find out with this code right away!"
It was 32 pages long.
There was one, ONE, comment.
It came right before a huge 3 page for loop. It said:
//for loop
Brady?
Andrex
ὁ αἴσχιστος παῖς εἶ
(04-01-2011, 08:37 PM)

Andrex's Avatar
#117

Originally Posted by iapetus:
You think that's funny, try getting graduate Java devs to try to implement the equals() method for a simple data object. :( It's the interview question that most people I've interviewed have flunked on.
Would that be like using @Override? >.>
ronito
got my tag in the OT
(04-01-2011, 08:41 PM)

ronito's Avatar
#118

Originally Posted by nickcv:
sometimes even six months after i coded something if i take a look back at it i ask myself if i was on crack when i wrote it


the most stupid mistake i made when i started studying programming was when it took me about 30 minutes to notice that the reason because my query wasn't working was because i didn't start the db connection
Ha that's pretty good.

Mine was really dumb.
I was supposed look for all the data files within a directory. Then for every data file I was supposed to create two more files (1 log file, 1 error output file) then for every line in the data file (each data file had several hundred thousand rows) I was supposed to examine, do a bunch of stuff and output the results in the log file.

But I put the While in the wrong place. Instead of creating 2 new files for every data file I created 2 new files for every line in the data files. The server crashed trying to create hundreds of thousands of files.
ultron87
Member
(04-01-2011, 08:44 PM)

ultron87's Avatar
#119

We have a whole bunch of unit conversions we have to do for figuring out the Green House Gas emissions of things.

Where would be a good place to store these numbers? In a database? Naaaah.

Let's just make a switch statement with 149 cases for half of them and hardcode the other half directly into the queries. And naturally these queries are copy and pasted into the code of 4 different pages.

*swears at everything*
ronito
got my tag in the OT
(04-01-2011, 08:46 PM)

ronito's Avatar
#120

Originally Posted by ultron87:
We have a whole bunch of unit conversions we have to do for figuring out the Green House Gas emissions of things.

Where would be a good place to store these numbers? In a database? Naaaah.

Let's just make a switch statement with 149 cases for half of them and hardcode the other half directly into the queries.

*swears at everything*
0_o
Xelinis
Junior Member
(04-01-2011, 08:48 PM)

Xelinis's Avatar
#121

Was managing some Java code written by some guy in Germany.

if( s == null ) {
return null;
} else {
return s;
}
ephemeral garbage
Member
(04-01-2011, 08:56 PM)

ephemeral garbage's Avatar
#122

I am kind of the lead of the Android team where I work (I took on an Android project because nobody else here knew it and I was like hey, new platform, cool), and we're now trying to hire up on Android developers. We get TONS of applications from just general Javaheads. A depressing amount, when being phonescreened, fail the fizzbuzz test. :(
Haly
One day I realized that sadness is just another word for not enough coffee.
(04-01-2011, 08:59 PM)

Haly's Avatar
#123

What's the fizzbuzz test?

EDIT: Wow that's pretty simple.
ultron87
Member
(04-01-2011, 09:02 PM)

ultron87's Avatar
#124

Originally Posted by Halycon:
What's the fizzbuzz test?

EDIT: Wow that's pretty simple.
Yeah, I really don't understand how someone could consider themselves a programmer but not know how to do it.

Even if you don't know what modulo is it is still incredibly simple.
ephemeral garbage
Member
(04-01-2011, 09:05 PM)

ephemeral garbage's Avatar
#125

I think there are a lot of people have just spent so long connecting enterprise components that they can no longer do simple logic/math, and there are also a lot of people who aren't programmers but need a job and are like "I bet I could do that shit" and apply, hoping to bluff their way through an interview.
TheExodu5
Will use d3doverrider to force triple buffering instead of complaining about mouse lag in every PC game thread ever
(04-01-2011, 09:13 PM)

TheExodu5's Avatar
#126

Originally Posted by ronito:
I find it funny that developers outside of doctors are pretty much the only profession where it's pretty much expected you'll end up having to sleep in the office or work insane hours. You don't see accounting do that. Let alone sales and marketing.
Not as a developer for the government!
jiien
Member
(04-01-2011, 09:21 PM)

jiien's Avatar
#127

Originally Posted by TheExodu5:
Not as a developer for the government!
Depends on what you do for the government. For my particular project, my test environment is a military site. Some time, long ago, some douchey military dude decided that if they have to maintain security 24/7 with men stationed there, then civilians can certainly work all hours of night. And so here we are, working ridiculous test times.
mike23
Member
(04-01-2011, 09:32 PM)

mike23's Avatar
#128

Originally Posted by ronito:
Man, has anyone ever looked at code and thought

"Who was the idiot that did this?!"

Then proceeded to take it out and have everything fall apart. Then realize that not only was it you that wrote it, but you were pretty clever for doing so?
Clever solution to a problem that shouldn't exist? That happens to me a lot when I add a feature without planning it out well enough. I code myself into a corner, you could say.
Wads
Member
(04-02-2011, 05:48 AM)

Wads's Avatar
#129

Even though I am a really good programmer, I would probably get fired where most of you guys work as I'm most certainly never ever going to commit to working a 14 hour day let alone to spending the night in the office. I've never had a job where I had to work consistently over 50 and most of my jobs I was out the door a little over 40 most weeks. Perhaps it's the type of coding I do, but what you guys are describing is bullshit...
tafer
Member
(04-02-2011, 06:29 AM)

tafer's Avatar
#130

He he he... newbies, real men program WITH THIS:

Code:
  1  H                                                                    EXAMP7
  2  H*
  3  H* UPDATE STUDENT MASTER WITH GRADE INFORMATION
  4  H*
  5  FGRADES  IPEAF2080 104            TAPE         S
  6  FSTMASTR USEAF 250 250  7KI     2 DISK14       S
  7  FREPORT  O   F 132 132     OF    LPRINTER
  8  LREPORT    101 6012
  9  IGRADES  011 01           
  10 I                                        1   7 GIDENT  M1
  11 I                                        9  140C1N             11
  12 I                                       16  192C1G
  13 I                                       21  260C2N             12
  14 I                                       28  312C2G
  15 I                                       33  380C3N             13
  16 I                                       40  432C3G
  17 I                                       45  500C4N             14
  18 I                                       52  552C4G
  19 I                                       57  620C5N             15
  20 I                                       64  672C5G
  21 I                                       69  740C6N             16
  22 I                                       76  792C6G
  23 I                                       81  860C7N             17
  24 I                                       88  912C7G
  25 I                                       93  980C8N             18
  26 I                                      100 1032C8G
  27 ISTMASTR 011 02   1 CA
  28 I       OR   92   1 CD
  29 I                                        2   8 SIDENT  M1
  30 I                                        9  43 NAME
  31 C*
  32 C* COUNT RECORDS PROCESSED FOR SUMMARY AT END OF REPORT
  33 C*
  34 C   01      GCOUNT    ADD  1         GCOUNT  30
  35 C   02      SCOUNT    ADD  1         SCOUNT  30
  36 C   02 MR   UCOUNT    ADD  1         UCOUNT  30
  37 OSTMASTR D        02 MR
  38 O                         C1G      144P
  39 O                         C2G      153P
  40 O                         C3G      162P
  41 O                         C4G      171P
  42 O                         C5G      180P
  43 O                         C6G      189P
  44 O                         C7G      198P
  45 O                         C8G      207P
  46 OREPORT  H  201   1P
  47 O       OR        OF
  48 O                                   43 'STUDENT MASTER'
  49 O                                   29 'GRADES TO '
  50 O                                   19 'POST COURSE '
  51 O        D 11     01
  52 O                N14      C4G      111 ' 0.  '
  53 O                N14      C4N      105 '0  -   - '
  54 O                N13      C3G       95 ' 0.  '
  55 O                N13      C3N       89 '0  -   - '
  56 O                N12      C2G       79 ' 0.  '
  57 O                N12      C2N       73 '0  -   - '
  58 O                N11      C1G       63 ' 0.  '
  59 O                N11      C1N       57 '0  -   - '
  60 O                NMR                45 'STUDENT MASTER ***'
  61 O                NMR                27 '*** NO MATCHING '
  62 O                         GIDENT    11
  63 O        D  1     01
  64 O                N18      C8G      111 ' 0.  '
  65 O                N18      C8N      105 '0  -   - '
  66 O                N17      C7G       95 ' 0.  '
  67 O                N17      C7N       89 '0  -   - '
  68 O                N16      C6G       79 ' 0.  '
  69 O                N16      C6N       73 '0  -   - '
  70 O                N15      C5G       63 ' 0.  '
  71 O                N15      C5N       57 '0  -   - '
  72 O        D  1     02
  73 O                 MR                57 'UPDATED'
  74 O                         NAME      47
  75 O                         SIDENT    11
  76 O        T 31     LR
  77 O                         GCOUNTZ    7
  78 O                                   26 'GRADE RECORDS READ'
  79 O        T  1     LR
  80 O                         SCOUNTZ    7
  81 O                                   23 'STUDENT MASTER '
  82 O                                   35 'RECORDS READ'
  83 O        T  1     LR
  84 O                         UCOUNTZ    7
  85 O                                   22 'STUDENT MASTER'
  86 O                                   38 'RECORDS UPDATED'
(First RPG example I found)

Working for a bank... from time to time I have to fix 40k+ lines programs with 30+ years of patches over patches, referencing dozens of other equally long, old and poorly made programs.

Lots of those programs lack any kind of documentation, proper coding practices (it's old RPG!) and were made by people who should face charges of crimes against humanity.

I have to follow tons and tons of retarded normative. I'm also in the worse place of the entire office with super restricted internet access, 0 privacy and other crap I don't want to think about.

Every single day I wonder what the hell am I doing in this place.

Maybe is because of this situation that I get sick with the simple thought of writing some code at home.
Andrex
ὁ αἴσχιστος παῖς εἶ
(04-02-2011, 06:38 AM)

Andrex's Avatar
#131

I just had a stroke. x_x
hateradio
Member
(04-02-2011, 08:01 AM)

hateradio's Avatar
#132

I'm to blame for bad method and variable names. Typically it's just to ward code snoopers. :D

Case in point: http://userscripts.org/scripts/review/89544

I could see someone getting a little lost.
nickcv
Member
(04-02-2011, 10:39 AM)

nickcv's Avatar
#133

here's an article about how to write unreadable code i found some time ago.

The best part about writing code impossible to understand comes from your ability (well, it's more like a form of art) of finding crazy names for your variables, functions and methods.
Those names don't mean anything to the computer so you have the opportunity to use any possible technique to make the programmer feel stupid.

1. Use the Book of Names (ISBN-13: 978-0684039992)
Buy one right now and you'll never have to worry about finding a name for your variables.
"Cathie" is a great name, it's short, you can write it fast and gives you a bunch of other options (Cathy, Kathi, Kathie, Kate, Katee...) all similar and easy to mistake for each other.
If you are looking for easy "names" use "adsf" or "aeou"


2. Grammatical errors
If you are going to use descriptive names for your variables and functions forget about grammars and how to spell words.


3. Abstraction
Use heavy abstraction ("how" "that" "data" "manage" "do") and numbers:
how32, that19, data927


4. A.C.R.O.N.Y.M.S
use acronyms to clean your code. Always remember that real men never, NEVER, explain an acronym: they understand thanks to their genes.


5. Synonyms and Contraries
Avoid monotony and use a nice vocabulary. If you have a bunch of functions and variables whose meaning is the same using synonyms you'll imply that there is a difference between each other, but if you have functions that have some crucial difference between each other make sure to use always the same name.
ie: use "print" for a function that print a document with a printer, for one that writes on a file and for one that print some text on screen.


6. Use foreign languages.
"this script keep trace of the many statil returned by vaxen".
Esperanto, Klingon, Sindarin all qualify for this purpose


7. uPpeR caSE
Use upper case letters to identify single words into a long string, but do it randomly


8. Reuse names
Make sure to use the same variable for at least 3 different purpose and in multiple scopes in the same script.
You have to make sure that is someone search for that variable as many result as possible will be returned.


9. Accented (stressed) letters
use accents for variables names.
ie:
typedef struct {int i;} ìnt;

if you didn't notice the "i" of the last "int" is accented.


10. Take advantage of variables max length.
if your compiler supports just 8 character always use longer names, just changing the last part of it.
ie:
var_unit_dimension and var_unit_expression look different, but for your compiler they are the same thing.


11. Underscore is your friend
use both _ and __ as identifiers


12. Mix languages
Use as many languages as possible in your comments.
Who read it cannot say that you didn't comment but may be wondering why some of them are in german while others are in Thai.


13. ASCII code is made of 255 characters
and almost all of them can be used for variable names (§, ¿).


14. Use common names for variables
Choose the most common names for your variables, but make sure they are not related to what those variables are for:
marypoppins = (julieAndrews + starship) / mailbox;

In this way whoever read it will have an hard time trying to disconnect that name from it's usual context.


15. Typical variables
Never use "i" in a loop, use any varible but "i"


16. Ignore implicit conventions
If your language (ie Java) has some implicit conventions for name (classes start with upper case letters while variables don't) ignore them!
Make up your own conventions and rant about no one else using them.


17. 'l' (L) looks similar to '1' (one)
Two names like def1ab and deflab are similar but different.


18. Be creative with your function's arguments.
If you have a function named F that makes a call to function G passing an argument that inside F is named A, in G use a different name that's present inside F but not in G.
This will make much harder to understand what exactly G is doing and how is used it's returned value.
ie:
if you have a function CalcWidth(height, size), use height to contain the value that will be used as size into the elaboration.


19. Usng abbrvtn (Using abbreviations)
There's not just one way to abbreviate a word: be creative.


20. Under-estimate functions
Use for your functions names that won't give a precise idea of what the function exactly does.
If someone makes questions just tell them that the function got improved across time and you didn't change the name.
ie:
isValid( x )
should validate X but also converts it in binary and save it inside the database.


21. Hungarian Notation
Hungarian notation is the perfect weapon in the hands of the evil programmer.
If you don't know what hungarian notation is, it's the practice of prepending to the name of the variable a prefix that identify what that variable is for.
ie:
intValue, strText, objObject and so on.

all you have to do is use identical prefix with different meanings across the code.
ie:
intXXX = Integer not trusted...
intXXX = index number of transactions
intXXX = information not translated...
strXXX = status to remember...


22. Hungarian Notation part 2
Follow Microsoft example: the variable type changes but the name doesn't.


22. Recycle
If you defined a structure to contain data from a callback, define the structure in every single module of the program assigning to it always the same name.
That will drive crazy the debugger (especially the VC++ one), so when you'll request the content of a structure in the observation window the debugger will
have no idea about which one to show and will pick up a random one.


23. Use names that look similar to instructions
Null, cOnst, For and stuff like that.


24. Use names that don't have anything to do with whatever you are showing on screen.
Who said that a field named "Name" on screen must correspond to a variable named "Name"?


25. Be creative with your constants
who said you can't have a constant named FALSE contianing a boolean true value?
Last edited by nickcv; 04-02-2011 at 11:02 AM.
Feep
Second-hand Citizen
(04-02-2011, 10:46 AM)

Feep's Avatar
#134

Originally Posted by mantidor:
Comments are also for you. I know there's no way I would understand the code on my thesis at first glance if I were to look at it today.
(shrug) Seems simple enough to me. Maybe it won't in a few years, but this isn't the kind of project I'll need to maintain. (Once it's released...peace out)
An-Det
Member
(04-02-2011, 01:20 PM)
#135

I havent had any rant-worthy issues since I've graduated college (aside from the disaster that was parsing the old MA Legislature site files), but every so often coding in assembly comes up and people are amazed that I enjoy it. My intro CS course in college started us coding in binary (literally 0's and 1's) before switching to the corresponding assembly and then later to C, and so when we did assembly in my architecture course it was easy and fun. The project I remember most fondly was recursive Towers of Hanoi in MIPS assembly. The project was fun to do, and hearing people bitch about it was wonderful.

Also, fuck Powerbuilder. I have to learn it for my job, and while it isnt terrible (pretty good for certain things, really), all I'm thinking the entire time is how much better this would be in a .Net environment. Using it is awkward as hell, I'm told it is similar to VB (never used that though) and the IDE is shit compared to wonderful Visual Studio/Eclipse/etc. If you google a problem and google just gives you the finger instead of helping to find an answer, odds are you shouldn't be using that language; there is fuck-all out there for learning this shit.
SteveMeister
Hang out with Steve.
(04-02-2011, 01:33 PM)

SteveMeister's Avatar
#136

Originally Posted by Feep:
(shrug) Seems simple enough to me. Maybe it won't in a few years, but this isn't the kind of project I'll need to maintain. (Once it's released...peace out)
This is a bad attitude. You should always be in the habit of documenting your code. Imagine you were applying for a programming job and were asked for a code sample prior to going in for an interview. If you submitted uncommented code, you probably wouldn't even get invited to the interview.

The point is that you should treat all code as if someone unfamiliar with it will be working with it at some point in the future. It's better to always be in that mindset. Proper code documentation, kept up to date, is the responsibility of every programmer.
Feep
Second-hand Citizen
(04-02-2011, 01:41 PM)

Feep's Avatar
#137

Originally Posted by SteveMeister:
This is a bad attitude. You should always be in the habit of documenting your code. Imagine you were applying for a programming job and were asked for a code sample prior to going in for an interview. If you submitted uncommented code, you probably wouldn't even get invited to the interview.

The point is that you should treat all code as if someone unfamiliar with it will be working with it at some point in the future. It's better to always be in that mindset. Proper code documentation, kept up to date, is the responsibility of every programmer.
(shrug) Still don't care. I have no intentions of ever working as a programmer for another company, and if I did, I wouldn't be so blithely stupid as to not have prepared several pieces of documented code beforehand.

Properly documenting my code would have wasted up to 200 hours of my life, for no reason other than both make myself feel good about "practices" and to open myself up to code theft or personnel replacement. No thanks.
nickcv
Member
(04-02-2011, 02:07 PM)

nickcv's Avatar
#138

Originally Posted by Feep:
(shrug) Still don't care. I have no intentions of ever working as a programmer for another company, and if I did, I wouldn't be so blithely stupid as to not have prepared several pieces of documented code beforehand.

Properly documenting my code would have wasted up to 200 hours of my life, for no reason other than both make myself feel good about "practices" and to open myself up to code theft or personnel replacement. No thanks.
you are going to waste much more time to prepare some code for the interview, because you won't be able to use the one you already have if you won't remember it

doing it your way it would take you a couple of days to prepare the sample code to send.
Feep
Second-hand Citizen
(04-02-2011, 03:03 PM)

Feep's Avatar
#139

Originally Posted by nickcv:
you are going to waste much more time to prepare some code for the interview, because you won't be able to use the one you already have if you won't remember it

doing it your way it would take you a couple of days to prepare the sample code to send.
200 hours worth? Besides, what code is so complicated that I couldn't figure it out by tracing through it? I write GOOD code, which is close to self-commenting anyway. Makes it easy enough to figure out. I'm not breaking ground in advanced CS algorithms.

You guys are overblowing the problem.
SteveMeister
Hang out with Steve.
(04-02-2011, 03:17 PM)

SteveMeister's Avatar
#140

Originally Posted by Feep:
(shrug) Still don't care. I have no intentions of ever working as a programmer for another company, and if I did, I wouldn't be so blithely stupid as to not have prepared several pieces of documented code beforehand.

Properly documenting my code would have wasted up to 200 hours of my life, for no reason other than both make myself feel good about "practices" and to open myself up to code theft or personnel replacement. No thanks.
I suppose if you never work for anyone else, and nobody else ever needs to maintain your code, it's not as important.

What do you mean by "personnel replacement"? Are you coding obscurely for job security?
Zoe
(04-02-2011, 03:21 PM)

Zoe's Avatar
#141

Originally Posted by nickcv:
you are going to waste much more time to prepare some code for the interview, because you won't be able to use the one you already have if you won't remember it
Wait... how can you send code that belongs to your workplace?
Kinitari
Black Canada Mafia
(04-02-2011, 03:45 PM)

Kinitari's Avatar
#142

Originally Posted by ThoseDeafMutes:
Watching first years try to do their 101 java programming assignments is hysterical. I saw one guy a while back who had typed up:


public int 7;


... and he thought this was going to create an array of 7 elements numbered 0 through 6.
*spits out orange juice*

Was that first year or first day?

Damn this thread is interesting, finishing up my first year right now. I'm loving the hell out of it.
TheExodu5
Will use d3doverrider to force triple buffering instead of complaining about mouse lag in every PC game thread ever
(04-02-2011, 03:57 PM)

TheExodu5's Avatar
#143

Originally Posted by Feep:
(shrug) Still don't care. I have no intentions of ever working as a programmer for another company, and if I did, I wouldn't be so blithely stupid as to not have prepared several pieces of documented code beforehand.

Properly documenting my code would have wasted up to 200 hours of my life, for no reason other than both make myself feel good about "practices" and to open myself up to code theft or personnel replacement. No thanks.
First off, it doesn't take that long to properly document code. I find it often saves me time as I can write out most of the framework before I even code it. It helps give my code structure, and stops me from getting lost in it. It's like a proper link from design to coding.

Also, you're going to save others a lot of time by documenting your code. If someone has to waste an hour analyzing a bit of code to figure out what it's doing, then you've failed at your job. Of course, it's likely many people may have to go through your code in the future, and the problem is then compounded.
subversus
I've done nothing with my life except eat and fap
(04-02-2011, 06:53 PM)

subversus's Avatar
#144

I'm studying Javascript and PHP so I will be able to appreciate this thread soon.
Last edited by subversus; 04-02-2011 at 07:05 PM.
Feep
Second-hand Citizen
(04-02-2011, 10:37 PM)

Feep's Avatar
#145

Originally Posted by TheExodu5:
First off, it doesn't take that long to properly document code. I find it often saves me time as I can write out most of the framework before I even code it. It helps give my code structure, and stops me from getting lost in it. It's like a proper link from design to coding.

Also, you're going to save others a lot of time by documenting your code. If someone has to waste an hour analyzing a bit of code to figure out what it's doing, then you've failed at your job. Of course, it's likely many people may have to go through your code in the future, and the problem is then compounded.
No one is going through my code; I'm the only programmer. The game is out in two weeks. No one should ever, EVER see this source code but me. EVER. And if they do, it is illegal/extremely undesirable.

I understand this is a rare circumstance, but that's how it is. I would document my code properly in a larger, team-oriented project. But for now, there's no point.
hyduK
Banned
(04-02-2011, 10:39 PM)

hyduK's Avatar
#146

Fuck COBOL. Fuck CICS.

That is all.
Andrex
ὁ αἴσχιστος παῖς εἶ
(04-02-2011, 10:42 PM)

Andrex's Avatar
#147

Does anyone else like JavaScript or am I the only one? >.> Seems most people here are systems, backend, or hardcore game engineers.
Slavik81
Member
(04-02-2011, 10:50 PM)

Slavik81's Avatar
#148

Originally Posted by ronito:
Man, has anyone ever looked at code and thought

"Who was the idiot that did this?!"

Then proceeded to take it out and have everything fall apart. Then realize that not only was it you that wrote it, but you were pretty clever for doing so?
Apparently not clever enough to make its purpose clear...
I've done this too. I wrote such bad code when I first came out of school...

Originally Posted by ultron87:
Yeah, I really don't understand how someone could consider themselves a programmer but not know how to do it.

Even if you don't know what modulo is it is still incredibly simple.
Most of the example implementations in the comments are wrong, generally because they didn't read the requirements carefully enough.
rhfb
Member
(04-02-2011, 10:55 PM)

rhfb's Avatar
#149

Originally Posted by Andrex:
Does anyone else like JavaScript or am I the only one? >.> Seems most people here are systems, backend, or hardcore game engineers.
Love javascript when it works (been doing a ton of stuff with javascript/jQuery/google maps lately), but since I'm currently using it in an asp.net project coding in vs2008 I hate when I've missed something very very simple and the compiler doesn't catch or complain about it :(
Kalnos
Member
(04-02-2011, 11:02 PM)

Kalnos's Avatar
#150

How do you guys plan before starting a new project (to an existing project or a completely new project, w/e)? Simple 5 minute pencil and paper design, or do you go as far as UML diagrams?

Also, this describes my programming career, and it's currently KILLING me: http://en.wikipedia.org/wiki/Analysis_paralysis