ethz-asl / programming_guidelines

This repository contains style-guides, discussions, eclipse/emacs auto-formatter for commonly used programming languages
139 stars 38 forks source link

Private class variables should have underscore suffix. #4

Closed simonlynen closed 11 years ago

simonlynen commented 11 years ago

What about python? I prefer suffix underscore

stephanemagnenat commented 11 years ago

I find this convention a bit heavy, as most variables in a class would be private in general.

furgalep commented 11 years ago

I like the underscore prefix for a few reasons:

  1. it clearly denotes the variable as a member variable when you are programming
  2. it causes the private member variables to show up sorted in an IDE (the suffix loses this trait)

Anyone else have comments?

simonlynen commented 11 years ago
  1. Not needed for Eclipse (and Visual Studio) as members are grouped automatically
simonlynen commented 11 years ago

As with other things we will do this on a per project basis as too much legacy code is there already.