Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Great story! It is sad to hear he passed away, I wonder how many good programmers came out of his classes.
My professor was a twat that did not taught one real thing, always making unfunny puns about C-perts. -
th3113397y@iSwimInTheC Hah, then take it as a rant that all my other professors suck at programming!
-
vaaesh1517yIt's sad that he passed away. What were some of his rules you still follow while programming today?
-
I come back to this Rant on dull days. It's truly amazing!.
You need a medal man!. -
th3113397y@vaaesh @RealKC I'm about to sleep now but here's the ones just off the top of my head. Some are standard good practice, some are just opinions and good tips.
Leave three new lines between every function. I find this makes it way easier to scroll through your code and stop it all flowing into one.
Don't let lines go over 80 characters. This is an old number from when terminals were 80 characters wide. But I find it's great for having multiple files open and them all looking nice without being too wide. Line wrapping is ugly and nobody likes horizontal scrolling!
Every function must start at the top, and finish at the bottom. No early returns, and obviously (but it needed saying for some of the first years) no gotos. There may be exceptions though (very small functions).
He always advised never doing anything was wasn't part of the language standard. Even if every compiler you know does something one way, don't rely on it working that way. Someone will find one that doesn't. -
th3113397yI'm pretty sure he gave a list of rules, I'll let you know if I find it and see some more good ones, might be good for me to read again too.
-
th3113397y@liquid-dev That's awesome, I'm glad you got something out of it, I didn't expect such a great reception of a rant like this.
-
jamlam15177yThis is really bizarre, because this sounds exactly like a lecturer I had, what uni did you go to?
-
samir11807yThe best teacher in college i had was in engineering mechanics.
If only he had been teaching programming. Sigh. -
Huuugo25207yThis story was great until I read those rules. Returning at the end only is a rather bad idea IMHO. Return as fast as possible. Keep the logic circuits short. Three newlines are negotiable I guess, but no popular style guide has that
-
th3113397y@Huuugo Yeah well they're all his opinions. The point wasn't that I follow him like a religion, but he taught the importance of following whatever rules you do have strictly.
Also the returning at the end point is designed to make code easy to debug and much easier to read. Both of which I think it does. There aren't many times where any performance benefit of returning instead of branching on a condition is worth it. Obviously it depends on what you're making.
Related Rants
-
neelgeek32In my second year, I told my teacher I can code in in C#(c-sharp). She replied : C-sharp ? Oh you mean C-hash...
-
linuxxx30A little ago, a devRant user drew something awesome (fantasy stylish) of another devRanter. I said in the com...
-
linuxxx15When someone's calls and completely loses his shit (swearing etc etc) because we HAVE TO FUCKING HELP HIM BECA...
I want to pay respects to my favourite teacher by far.
I turned up at university as a pretty arrogant person. This was because I had about 6 years of self-taught programming experience, and the classes started from the ansolute basics. I turned up to my first classes and everything was extremely easy. I felt like I wouldn't learn anything for at least a year.
Then, I met one of my lecturers for the first time. He was about 50~60 years old and had been programming for all of his career. He was known by everyone to be really strict and we were told by other lecturers that it could be difficult for some people to be his student.
His classes were awesome. He was friendly, but took absolutely no shit, and told everything as it was. He had great stories from his life, which he used to throw out during the more boring computer science topics. He had extremely strict rules for our programming style, and bloody good reasons for all of them. If we didn't follow a clear rule on an assignment, he'd give us 0%. To prove how well this worked, nobody got 0%.
We eventually learned that he was that way because he used to work on real-time systems for the military, where if something didn't work then people could die.
This was exactly what I needed. In around one semester I went from a capable self-taught kid, to writing code that was clear, maintainable and fast, without being hacky.
I learned so much in just that small time, and I owe it all to him. So often when I write code now I think back to his rules. Even if I disagree with some, I learned to be strict and consistent.
Sadly, during the break between our first and second year, he passed away due to illness. There was so many lessons still to be learned from him, and there's now no teachers with enough knowledge to continue his best modules like compiler writing.
He is greatly missed, I've never had greater respect for a teacher than for him.
rant
thank you
wk73