You are not logged in.
Pages: 1
I am in a very long "internal conflict" about a very simple question and I keep switching sides with no reason:
Should one end sentences/words in comments with dot or not? (in Bash)
My dilemma:
In long phases it makes perfect sense:
# Some very important detail about this line.
vs
# Some very important detail about this line
In very short ones not:
# Core.
vs
# Core
I am already mixing them a lot as I already mentioned, was just wondering if any of you actually came to a standard?
Haec inconstantia, mutabilitasque mentis, quem non ipsa grauitate deterreat?
Offline
without the dot it looks better
Offline
If the sentences are proper English sentences, the they should end with a full stop.
Offline
I have the same dilemma. Usually solve it like this: if it's a single sentence like a title or chapter name in a book, then no dot. If there are multiple sentences, then separate them with dots and dot in the end.
Offline
Comments are passive statements.
I believe it doesn't matter how you make them
Offline
I just learned not to care \o/
Usually I don't use sentence periods in one-liners
Only commas if necessary for clarity (and also probably wrongly) and exclamation points (in bulk) or question marks (dto)
And "fuck" and other curses. Also usually in bulk.
If you're writing a meaningful, lengthy comment that's supposed to be read by other developers you should care about proper English and punctuation.
If it's just an off-hand remark it's enough if everybody seeing it gets the message.
Offline
Ok so my "internal conflict" is actually the standard, good to know
Thanks for the inputs I'll keep free-styling it then!
Haec inconstantia, mutabilitasque mentis, quem non ipsa grauitate deterreat?
Offline
See comment section in Google Shell Style Guide.
Whatever you do, be consistent ![]()
Read lots of code, especially projects. Most have standards and guides, for example Linux kernel coding style.
Offline
I normally do punctuate, influenced by my time reading config files... /etc/postfix/main.cf and the like tend to come with rather lengthy explanations that can stretch to multiple sentences. I'm the only one reading the vast majority of my code but it feels like good "discipline" to write code as if it'll be read by others.
At least compared to the disaster that is how I name files (why.txt, UGH, and ineedsleep are all in my personal documents archive).
Some people prefer to comment more tersely (a few words), and I've even seen the opinion that code shouldn't have comments at all—everything should be clear from variable names and the structure of the program. Though that feels unrealistic to me.
Offline
I'm the only one reading the vast majority of my code but it feels like good "discipline" to write code as if it'll be read by others.
I generally feel like quality code is very important, even if you're the only person who will be reading this code.
A vast majority of time, effort and other resources usually are spent maintaining the code than actually developing it.
If you do the math, then becomes quite clear that good coding habits are actually worth the time.
Offline
mesaprotector wrote:I'm the only one reading the vast majority of my code but it feels like good "discipline" to write code as if it'll be read by others.
I generally feel like quality code is very important, even if you're the only person who will be reading this code.
I am always amused when I read my own code several years later and I find a comment written to my future self reminding me of why I did something a particular way.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
At least compared to the disaster that is how I name files (why.txt, UGH, and ineedsleep are all in my personal documents archive)
I imagined a folder with a lot of UGH files on it, more like UGH1 UGH2 and so on and so on with a low voice pitch complaining sound and neuron synapse delay on it. Make me laugh a bit while imagine it while instantly reading your post
Nobody has been so annoying to put in the code format guidelines of a project that you should end your comments with a dot or without it ? I mean the Linux kernel have an standard and your PR can be the most beautiful PR ever made to the project but if it does lack the "standard in how the things are done in the Linux Kernel development" is gonna be rejected probably with someone telling to adjust to the code "standard". I never heard about anyone denying a PR because it lacks the dot at the end or no over here we don't make the comment ending with a dot
I guess is not important, and probably over commenting the code is far more worse. But I do tend to put the dot in long comments. I think is more like a signal to other like: Hey the reading about the comment has ended you are going to see again more code. But i think the most important thing is to find people who want to think with the code with you and questing you why are you doing the things that way if you can do it in another way, and add value to the project because of that. Instead of just: Here are the features, just do it i don't care how.
Last edited by Succulent of your garden (Yesterday 00:31:41)
str( @soyg ) == str( @potplant ) btw!
Offline
Pages: 1