Lol... My Comp Sci teacher...
So, showed him my sorting algorithm and he was just like "Yeah, I'm sure that will get you a job." and then I showed him a Quine I made, and he was just like "Oh yeah." like he didn't even know what it was.
I'm pretty sure he has like no interest in professional and real computer science, only in teaching his crappy Java :/ He didn't even know some of the more advanced Comp Sci algorithms I was naming that are SUPER common.
I didn't know what a Quine was until you mentioned it. :x
Sounds like a Comp. Sci. high-school teacher. University/College professors usually have a doctorate degree and are very interested in the field. They are usually also familiar with common and advanced algorithms depending on their concentration.
My computer science teacher couldn't understand my code. He would just give me an A no matter what I turned in. The students came to me for help, and even he did a few times. He had me write a program that would convert two strings to unique numeric representations, add then together, and then output one of an array of values such that those two strings would always produce that same value.
Pretty easy. I wrote it in a language I didn't know yet (BASIC). A language he taught. To other students besides me. Asked me to do it. Did. Easy program.
But yeah. For some reason, programming professors don't seem to be... well... programmers.
It's like they memorize languages as if it was a history class.
But then again, there's probably a reason they teach programming instead of, you know, programming.
Pretty sure someone not understanding your code isn't a good thing.
You would think so. He was just an idiot. He asked me if I used a for loop once, while looking at my code.
I didn't.
It went something to the effect of:
"I see what you did here. You used a subroutine."
"No?"
"Oh. A for loop?"
"... No."
"Ah. Uh huh." and then he walked to his desk and didn't say anything else.
I have witnesses.
Lol. It's quite funny looking at the different conventions used by different professors at college/uni/highschool. I actually had a professor last year who taught that it was bad practice to comment your code. His theory was if you couldn't understand the code from looking at it, it's poor code and needs to be rewritten. That's fine in small, simple programs, but when you start building massive applications, particularly in a team environment, if nobody documents their code, you're going to be in for a bad time :p
>every single line
:facepalm:
You shouldn't comment every single line of your code. That just looks messy. It is enough to point out noteworthy things, for example, noting that there must be a delay of 0.5s in order to avoid a race condition (or stuff like that). You could also use extensive documentation when you are implementing an algorithm that is confusing. Things like that are OK to comment extensively, every line if needed.
On a regular basis, you should not have to comment every line. You should be fine just commenting in the purpose of a block of code (functions, classes, etc) with a standard documentation format for the target language.
@Arti: That's simply retarded.
1. Create a class that spans a thousand lines.
2. Document in the header the available functionalities and the purpose of said class.
3. Avoid the massive amount of scrolling and save time reading a bunch of lines of code by reading the couple of lines in the header.
4. Profit???