Top "Coding-style" questions

**DO NOT USE!

Jquery - How to get the style display attribute "none / block"

Is there a way to get the style: display attribute which would have either none or block? DIV : <div …

jquery coding-style attributes
Which comment style should I use in batch files?

I've been writing some batch files, and I ran into this user guide, which has been quite informative. One thing …

batch-file coding-style comments
Checking for NULL pointer in C/C++

In a recent code review, a contributor is trying to enforce that all NULL checks on pointers be performed in …

c++ c if-statement null coding-style
Declaring multiple variables in JavaScript

In JavaScript, it is possible to declare multiple variables like this: var variable1 = "Hello, World!"; var variable2 = "Testing..."; var variable3 = 42; ...…

javascript variables coding-style performance declaration
What is the most effective way to get the index of an iterator of an std::vector?

I'm iterating over a vector and need the index the iterator is currently pointing at. AFAIK this can be done …

c++ iterator coding-style
How can I set multiple CSS styles in JavaScript?

I have the following JavaScript variables: var fontsize = "12px" var left= "200px" var top= "100px" I know that I can …

javascript coding-style
Should a function have only one return statement?

Are there good reasons why it's a better practice to have only one return statement in a function? Or is …

language-agnostic coding-style
Vim 80 column layout concerns

The way I do 80-column indication in Vim seems incorrect:set columns=80. At times I also set textwidth, but I …

vim coding-style
Check if a string contains an element from a list (of strings)

For the following block of code: For I = 0 To listOfStrings.Count - 1 If myString.Contains(lstOfStrings.Item(I)) Then Return …

c# vb.net list coding-style performance
Is nested function a good approach when required by only one function?

Let's say that a function A is required only by function B, should A be defined inside B? Simple example. …

python coding-style nested-function