174 votes
Accepted

Coding standard for clarity: comment every line of code?

Michael Durrant's answer is IMHO not bad, but it is not literally answering the question (as he admitted by himself), so I'll try to give an answer which does: I also understand that comments should ...
Doc Brown's user avatar
  • 207k
160 votes
Accepted

What's the phone number equivalent of example.org?

The North American Numbering Plan reserves 555-01 numbers for fictitious purposes. If you want an example Seattle number, for example, +1 206 555 0100 - +1 206 555 0199 would do. In the United Kingdom,...
Frank Shearar's user avatar
154 votes

Coding standard for clarity: comment every line of code?

Major anti-pattern leading to poor quality code with less clarity btw readers, the title was originally "comment every line of code?" and you can imagine the instinctive reaction of many of us, ...
Michael Durrant's user avatar
62 votes

Should UTF-8 CSV files contain a BOM (byte order mark)?

Not for UTF-8, but see the various caveats in the comments. It's unnecessary (UTF-8 has no byte order) unlike UTF-16/32 and not recommended in the Unicode standard. It's also quite rare to see UTF-8 ...
Kayaman's user avatar
  • 1,950
40 votes

What's the phone number equivalent of example.org?

An oft-used example phone number is the numeric progression. (123) 456-7890 It's widely understood that this doesn't mean you should call that number -- it's an example. Additionally, according ...
Cullub's user avatar
  • 525
32 votes

What is actually the difference between the GNU C Library and the C standard Library?

The C standard library is part of the C programming language, so it is a specification (written in English in some technical report). For example, the n1570 document is explaining what is malloc and ...
Basile Starynkevitch's user avatar
24 votes

Coding standard for clarity: comment every line of code?

I don't think a coding standards document is the place to specify what is already common sense. The purpose of a coding standard is to guarantee consistence (and avoid arguments) about issues where ...
JacquesB's user avatar
  • 59.5k
20 votes

Coding standard for clarity: comment every line of code?

It is not possible. What you are essentially trying to do is nearly to mechanize good judgment. When writing critical software such as for life supporting medical systems, huge amounts of checklists ...
whatsisname's user avatar
  • 27.7k
19 votes
Accepted

When should new C projects target very old C standards (>20 years old, i.e. C89)?

... "older and standardized is always more portable and better" which is ridiculous ... That statement reached ridiculous when it got to better, which is completely subjective. You don't select a ...
Blrfl's user avatar
  • 20.4k
14 votes

The meaning of "function blocks of limited size of coding" in ISO 13849-1

It means that you should have a standard for how many lines of code are allowed to be in a function before it has to be broken into sub-functions. It means you're not allowed to have a 10,000 line ...
pjc50's user avatar
  • 13.4k
13 votes

Coding standard for clarity: comment every line of code?

There are two different things you allude to when you talk about comments. They're not the same, and the distinction is important. Documentation tells you about the outward-facing bits of a piece of ...
user52889's user avatar
  • 1,693
13 votes

Coding standard for clarity: comment every line of code?

Update My response in quotes for emphasis: It is my belief the answer that states the comments should not be addressed in Coding Standards and then lists a set of defensive questions to fight it, is ...
Andrew T Finnell's user avatar
12 votes

Why isn't the C standard free?

ISO's position ISO claims that the revenues from standards are required to finance the work of the technical working groups producing them, and the overhead costs. It also claims that this financing ...
Christophe's user avatar
  • 77.2k
11 votes

When should new C projects target very old C standards (>20 years old, i.e. C89)?

When portability across a wide range of platforms is important. That may include obsolete platforms, and many embedded processors for which only a minimalist compiler is available. There's also a ...
Simon B's user avatar
  • 9,621
11 votes

Should UTF-8 CSV files contain a BOM (byte order mark)?

There still is no widespread convention AFAIK, though certainly UTF-8 is now generally accepted. The BOM is an awful artifact: It is invisible (zero-width space). Some software might break on the ...
Joop Eggen's user avatar
  • 2,051
10 votes

Coding standard for clarity: comment every line of code?

You can't codify a commenting standard, because you can't know what the important comment will be in advance. But you still want to make sure the code is commented correctly, since this is life ...
jmoreno's user avatar
  • 10.9k
10 votes

Does the implementation of GDPR compliance per site make sense in terms of good practises?

GDPR is about end-to-end privacy. There's no way to implement it only on the browser's side. Every site has to do the work to make sure the personal information is treated with respect for privacy, ...
Joeri Sebrechts's user avatar
10 votes

Consequences of not doing a REST API the "right" way?

what are the software engineering concerns for not implementing my REST API the "right" way? The primary one, to my mind, is the ability to delegate out work to generic components that know ...
VoiceOfUnreason's user avatar
10 votes

Why follow standards of a voluntary organization?

Network effects, almost literally in the case of the IETF. There's little point me building an "e-mail" client if it can't communicate with people using a different client. There's little ...
Philip Kendall's user avatar
10 votes
Accepted

The meaning of "function blocks of limited size of coding" in ISO 13849-1

I don't have this ISO standard at hand, so my answer is based on your citation and some publicly available information (such as the table of contents). What I found out about the standard is Its ...
Doc Brown's user avatar
  • 207k
9 votes

Coding standard for clarity: comment every line of code?

The question: Given all this is it even possible to write good coding standards that capture this idea? Ones that will be relevant in a peer review but won't turn into a mindless checklist activity ...
Aaron Hall's user avatar
  • 5,945
9 votes

Coding standard for clarity: comment every line of code?

Comment every line of code? No. The purpose of the others rules you talk about is precisely to avoid that. Comments to a readable code are at best redundant, and at worst will throw a reader off ...
luk32's user avatar
  • 400
9 votes

Why shouldn't you create a custom uri scheme?

Custom URI schemes require your app to be already installed. There are other methods available that do not, such as Universal Links or App Links. You can't prevent another app from stomping on your ...
John Wu's user avatar
  • 26.5k
9 votes
Accepted

Are tables inside tables a good idea in the right circumstance

Semantic HTML is about accurately describing the semantic structure of your document. If your document contains tabular data, then use a table. If your document contains tabular data which is itself ...
Jörg W Mittag's user avatar
9 votes

What time horizon and level of abstraction is the right for the maintainable and evolvable software?

My rules of thumb are: I drive my code with Unit tests to keep it focused on the actual requirement, it also means as I evolve the code through each these following steps I can be confident it will ...
Martin Spamer's user avatar
8 votes
Accepted

How do you deal with external sources that do not conform to service standards and protocols?

This depends entirely on the role of your company and its software. In some models, you simply need to estimate the cost of making your integration layer flexible and adaptable and weigh it against ...
svidgen's user avatar
  • 14.7k
7 votes

Should compilers follow the defined language standard?

The point is : what does "error" means in that particular standard. It might be explained in some introduction or glossary. Perhaps it is close to undefined behavior (and the implementation ...
Basile Starynkevitch's user avatar
7 votes
Accepted

When were unsigned types first introduced in programming languages?

According to Wikipedia, the concept of signed numbers appeared during the Han dynasty in China (~200 BC to ~200 AD), and wasn't accepted in the west until the 17th century. While that may seem like a ...
kdgregory's user avatar
  • 5,250
7 votes

How to answer someone who says that quality standards in code are irrelevant?

You seem to be conflating "quality standards" with consistent style. Your colleague is right that consistent style is much less important than readability and other relatively subjective measures. ...
Karl Bielefeldt's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible