When I worked at a company writing C# the coding standard was to use underscores before variables which were members of a class. This should have avoided using this.variable = variable and made it clearer which variables belonged to the class and which were local variables. The code style also said though that the this keyword should also be used when accessing variables which belonged to the class. I found that retarded and argued with the manager over development that the underscore should be used or the this keyword but not both as it was redundant.
There was a code style which stated null checks should have taken the form of if (null == variable) which coming from Java I said was unnecessary however it turns out that due to .net support for implicit casts there are some fringe cases where if (variable == null) will behave differently to if (null == variable) apparently. Most of the developers used if (variable == null) though in spite of the coding standard because it was more intuitive. On May 3, 11:31 am, Moandji Ezana <[email protected]> wrote: > On Tue, May 3, 2011 at 10:40 AM, Casper Bang <[email protected]> wrote: > > I used to use underscore in Java code, but got > > converted and aligned over the years by the conservative Java > > community. > > I thought using the underscore was more conservative than not using it. > > In JavaScript, the underscore is often used to indicate private members, > when you're feeling too lazy to implement function scopes. > > Moandji -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
