So, just to recap if you missed the last few episodes. I've been a web developer for years. But I decided to get a degree and go to uni.

Also I am firmly on the fewer comments side of the debate about self-documenting code. Even though I usually rephrase it and say method and variable names are comments. Basic idea: something is unclear, you should leave a comment. But, before you leave a comment, take a good look at your method. Can you rename a variable? Maybe the method name? Maybe extract a method into smaller methods so it doesn't need a comment? And only if you fail to do so, leave a comment.

Alright, now that we rehashed that, uni coding makes no bloody sense.

There is code that is abbreviated to the max (or min).

And then, they need everything commented. I mean, why do that? Why call the parameters a and b instead of base and exponent. And then say:
"But write a whole article about it above the method". Like:

a is the base for a power operation.
b is the exponent for a power operation.
return int representing a to the power of b

How about just do this:

public static int power(int base, int exponent).

How is this not the same documentation?

Is it because we're at a uni, a place for smart people and smart people shouldn't have an issue keeping a mental map between the variables and their meaning?

Or is it because they are all mathematicians. All respect to applied mathematics. I mean, the function about exponent calculation, I was not aware that it could be that effective. But on the other hand, keep mathematicians away from programming. I get it, writing maths per hand doesn't have intellisense and therefore you don't want to write long variable names. It's and old tradition. Yada yada, yah.

But programming is not maths. And maths shouldn't be maths like that. Right naming makes it simpler. It might still be a while until we all LaTeX rather than handwrite and be able to give maths right naming schemes, but programming is beyond the point. Calling the array you handing in a function A and the one that you're returning D makes no fucking sense.

  • 2
    If you do not like math in coding then I don’t know if you will like the rest of your CS classes lol. The purpose of the degree I feel is to unravel all of the abstractions that we have used up until today. So a lot of it is going to be that old math-programmer vibe.

    I would approach it like learning a new paradigm but definitely challenge the profs on their material - they need it.
  • 2
    People at uni don't use ide/language servers. Most of them don't know what intellisense/copilot are. I guess single character variable names are easier to type when there is no auto complete.
  • 2

    Don't get me wrong, I like maths. But that's not a good reason to make programs unreadable.

    Old-timey is another way of saying traditions. Traditions isn't a good argument. Professors are free to write them better. Funnily enough, our maths professor does a better job making maths readable than our programming professor does making his programs readable.


    Rubbish, of course they use Intellisense. I have seen professors and TAs use vim, notepad++, Eclipse and IntelliJ. And only the vim professor hadn't set up Intellisense. The others had it set up. A pity, many students would have been amazed what a good ide vim can be.
  • 1
    @TheCommoner282 Try Haskell without language server. No type inference. No code navigation.

    Everyone uses single chars as variable names in Haskell. My guess is that people have been coding Haskell without language server forever.
Add Comment