Top "Conventions" questions

Python __str__ versus __unicode__

Is there a python convention for when you should implement __str__() versus __unicode__(). I've seen classes override __unicode__() more frequently …

python string unicode conventions
What's the best way to do string building/concatenation in JavaScript?

Does JavaScript support substitution/interpolation? Overview I'm working on a JS project, and as it's getting bigger, keeping strings in …

javascript string concatenation conventions
Where to place private methods in Ruby?

Most of the blogs or tutorials or books have private methods at the bottom of any class/module. Is this …

ruby conventions
Swift: guard let vs if let

I have been reading about Optionals in Swift, and I have seen examples where if let is used to check …

swift swift2 optional conventions control-flow
Where to define custom error types in Ruby and/or Rails?

Is there a best practice for defining custom error types in a Ruby library (gem) or Ruby on Rails application? …

ruby-on-rails ruby conventions
Python "private" function coding convention

When writing a python module and functions in it, I have some "public" functions that are supposed to be exposed …

python python-2.7 coding-style naming conventions
Is it pythonic to import inside functions?

PEP 8 says: Imports are always put at the top of the file, just after any module comments and docstrings, and …

python conventions
How do you USE Fortran 90 module data

Let's say you have a Fortran 90 module containing lots of variables, functions and subroutines. In your USE statement, which convention …

module fortran conventions fortran90
Lisp commenting convention

What is the Lisp convention about how many semicolons to use for different kinds of comments (and what the level …

comments lisp common-lisp conventions
Is it a good idea to typedef pointers?

I looked through some code and noticed that the convention was to turn pointer types like SomeStruct* into typedef SomeStruct* …

c++ c pointers typedef conventions