Top "Coding-style" questions

**DO NOT USE!

Is it good style to explicitly return in Ruby?

Coming from a Python background, where there is always a "right way to do it" (a "Pythonic" way) when it …

ruby coding-style return-value
return statement vs exit() in main()

Should I use exit() or just return statements in main()? Personally I favor the return statements because I feel it's …

c++ c coding-style return exit
Should enums in C# have their own file?

I have a class which uses an enumeration, the enum is currently in its own file which seems wasteful. What …

c# coding-style enums
Java - when to use 'this' keyword

What is the best practise for using the this keyword in Java? For example, I have the following class: class …

java coding-style this
Indentation in Go: tabs or spaces?

Is there a standard Google Go coding conventions document somewhere that sets whether tabs or spaces are preferred for indentation …

go formatting coding-style indentation
Naming "class" and "id" HTML attributes - dashes vs. underlines

<div id="example-value"> or <div id="example_value">? This site and Twitter use the first style. …

html coding-style naming-conventions
Why are dashes preferred for CSS selectors / HTML attributes?

In the past I've always used underscores for defining class and id attributes in HTML. Over the last few years …

html css coding-style naming-conventions
Java constructor style: check parameters aren't null

What are the best practices if you have a class which accepts some parameters but none of them are allowed …

java constructor null coding-style
Tool to convert Python code to be PEP8 compliant

I know there are tools which validate whether your Python code is compliant with PEP8, for example there is both …

python coding-style pep8
What does a good programmer's code look like?

I am a hobbyist programmer (started with VBA to make excel quicker) and have been working with VB.NET / C#.…

coding-style