Top "Coding-style" questions

**DO NOT USE!

Ignoring return values in C

Lately, I started using lint for static code analysis. One of the warning I get sometimes is regarding this issue. …

c coding-style return-value lint
Does PEP 8 require whitespace around operators in function arguments?

I have this code: some_list = range(a, b+1) After checking my coding style with pep8 plugin for vim, I …

python coding-style pep8
Any reason to clean up unused imports in Java, other than reducing clutter?

Is there any good reason to avoid unused import statements in Java? As I understand it, they are there for …

java eclipse coding-style import
how to make clang-format add new line before opening brace of a function?

I'm interested in putting an opening brace for functions (but not if statements and other contexts). For example void foo() { ... } …

coding-style clang clang-format
Where should I put @Transactional annotation: at an interface definition or at an implementing class?

The question from the title in code: @Transactional (readonly = true) public interface FooService { void doSmth (); } public class FooServiceImpl implements FooService { ... } …

java spring annotations coding-style
How to get smart tabs ("indent with tabs, align with spaces") behavior in Xcode?

I used to use tabs for indentation and spaces for alignment. Like so (arrows show tabs and dots show spaces). …

xcode coding-style alignment indentation
What does it mean when a variable equals a function?

Possible Duplicate: JavaScript: var functionName = function() {} vs function functionName() {} In JavaScript, what's the purpose of defining a variable as a …

javascript function coding-style convention
Opaque C structs: various ways to declare them

I've seen both of the following two styles of declaring opaque types in C APIs. What are the various ways …

c coding-style struct typedef opaque-pointers
JavaScript braces on new line or not?

At work, we place braces on the next line, but at home, I do the opposite. Which one do you …

javascript coding-style conventions
Why does one often see "null != variable" instead of "variable != null" in C#?

In c#, is there any difference in the excecution speed for the order in which you state the condition? if (…

c# coding-style