And your colleagues are probably correct with respect to this sort of «what it does» commenting. That can be counterproductive because if the code changes and the comment isn’t updated accordingly, it can be ambiguous. Better have the code be the singular source of truth. However, «why it does it» comments are another story and usually accepted by most as helpful.
I meant doesn’t change with respect to time zones. Leap times are still relevant in that scenario as each solar rotation doesn’t divide into a whole number of days and leap seconds due to variance in rotation.
With respect to the meridian I envision it rotating around the earth once per year, hence sidereal. So 0000 would rotate around the earth through the course of the year. Each day it would be one degree farther.
Most likely is I’m just completely full of shit.
Like with everything, context matters. Sometimes it can indicate poorly structured control flow, other times inefficient loop nesting. But many times it is just somebody’s preference for guard clauses. As long as the intent is clear, there are no efficiency problems, and it is possible to reach the fewest branches necessary, I see no issues.
I guess I’m just lucky, but I’ve gotten nothing but thoughtful support on Arch forums and Stackoverflow. If you read the article How do I ask a good question?, it works very well. It seems harsh but coming with poorly thought out questions without debugging details makes it impossible to help.
I’ve seen this before but don’t accept it myself. There are cases where you just wanted to cat. In this case, maybe to review the problem. Then you want to extend the command. Preserving it in the next commands where you start stacking on pipes is useful since it can be fewer strokes and maintain a habit.
I’m curious which language and which model, because I have had several of the models write programs like the sieve of Eratosthenes quite successfully. You can find this report in my GitHub of the same name.
I don’t know what bias you’re on about. I was just reporting that those phone numbers are in fact the correct numbers given by those organizations. Are you implying they aren’t? Because, you might want to go to the primary source and check for yourself.
First, it just copy pastes much in the same way animals do; a neural network with outputs weighted by experience. Secondly it posted it twice because both of those organizations are real and are references for the topic it mistakenly meant to reply about. The same way of asking what to do when a house burns one might reply:
- Contact x city fire department. 911
- Contact y county fire and rescue. 911
Third, and most importantly, I’m not saying it invalidates the message completely… but it does undercut it. As in, there would have been a much stronger case for just randomly outputting garbage information that it hopes sounds correct if the information had not been, you know… correct.
There was something like that on Reddit but I can’t remember the sub. I haven’t seen one here. The best way to get reviews of open source is via contributions to larger projects. That of course doesn’t answer your question directly but is worth noting.
I’d recommend joining some discord or matrix servers for the language you work in or likeminded folk. They tend to have channels for that, and some have really helpful communities.
eta: I just checked my local instance and saw a community with very few subs and zero posts called /c/reviewmycode. Somebody has to post first.
100%, but my understanding is that most often applies to fields of engineering outside of computer science like mechanical, chemical, structural engineering etc. But there are licensing bodies for achieving Professional Engineer of FE in some cases for CS.
I am not a lawyer but I presume most laws apply to claims of such certifications rather than job titles. In either case most people don’t pick their own job titles. Just don’t put PE, after your name, same as you should not just randomly throw BSN or MD unless you have a registered licensure.
I rarely read comments in code, that is from within source code anyway. I of course write comments explaining the behavior of public facing interfaces and otherwise where they serve to generate documentation, but very rarely otherwise. And I use that generated documentation. So in a roundabout way I do read comments but outside of the code base.
For instance I might use godoc to get a general idea of components but if I’m in the code I’ll be reading the code instead.
As others have said, your code generally but not always should clearly express what it does. It is fine to comment why you have decided to implement something in a way that isn’t immediately clear.
I’m not saying others don’t read comments in code; some do. I just never find myself looking at docs in code. The most important skill I have cultivated over the decades has been learning to read and follow the actual code itself.
Poorly defined nomenclature. Simple as that. I’m an “automation engineer”, have had many other titles, but anytime I write what I do, like LinkedIn or such, I write “programmer”, because it is simple, descriptive, and I like it. I’m old, but I used to like ”hacker” until it came to imply nefarious programming.
In general it should not be checked in, but as with everything there are exceptions. If you need it to be deterministic and evaluate all changes to the generated code it can be useful; precisely for the reason you site in opposition. A small change in your build environment can change what was generated. If that isn’t diffed against preceding versions I think we could contrive cases where that would be an issue. Seems sufficient to me to caution that there are always exceptions.
I didn’t say the source of failure. I said a source of ambiguity. And having also been in the industry for decades, I have encountered it many times, where a junior programmer or somebody new to a project read some documentation and assumed a behavior which in fact did not match the current implementation. So you may have been fortunate, but your experience is certainly not ubiquitous.
With respect to variable names, I’d suggest those too should absolutely be updated too if the name is given in a way that adds ambiguity.
I’m not saying comments are bad; rather that bad comments are bad, and sometimes worse than no comment.