0-255 was good enough for me an my grandpappy.
0-255 was good enough for me an my grandpappy.
I’ve worked on satellite command and control software that is literally using a 1970s OS. The code is limited for historical reasons and you have to work with the structure you are given.
When it has been compiled into assembly language
Yes, two of the most important things I see comments do is explain things like boundary conditions, “This is why we stop at 50 here.” and historical reasons “We have to return a 1 here because we still use calling func FOO for all of our calls still and it expects 1 as the default…”
Another helpful use is to describe the expected format of the input. “We expect a struct with this format here…” Stick in a small example too. It makes it so much easier to quickly scan the code’s flow.
And turn signals are giving information to the enemy
Could be worse, it could’ve been customer_ID, Customer_id, customer_Id…
I worked with a guy who was smart but “useless smart”. He was convinced that “code is self descriptive”, that is comments are not needed because the code speaks for itself. Well that is like saying DNA is self descriptive. Yes, I can sit there tracing the code, tracking the variables, etc or you could make a small effort to describe what is happening instead and save me a lot of time and risk missing subtle points.
Yes, you don’t need to comment “n++” to say it is incrementing it but you should mention why you are starting with 1 instead of 0, etc. Boundary conditions are notoriously tricky and need to be documented. Then there are historical reasons that are NEVER obvious, “This function has to return -2 as a default because we’ve been calling it using X for years and it expects a -1 as the error…”
deleted by creator
I like it when people rag on their own code in comments. “This line is a kluge but I can’t think of a better way to do it right now.” Comment is dated 10 years ago.
Better yet. Only guy who knew the code retires/quits. The next guy who inherits the code finds out nothing was documented and it was all in the previous guy’s head. Next guy has to spend weeks analyzing the code, asking coworkers who shake their heads and buying beers after work to get the previous guy to help him.
I could switch but I don’t see any need to. The lockin from apple apps and google play apps is far stronger.
Laziness or not giving a damn is a choice
No certs and degree isn’t in CS. I just have lots of experience.
My pathway was basically: