ColdFusion Guidelines/Standards what works for you and why

Today we had an interesting discussion on this very subject, now we already have one in place. Yet we have varying opinions on why we should do something, but nothing really concrete as the real truth as to why it should be this or that way. I personally have grown to love the fact that the beginning of a block is on the same line as the method, component class or loops etc. My logic behind this is that it is neater, doesn't clutter the workspace and fairly easy to read.

However my logic just doesn't end there.

In the days when languages where first really taking of like Pascal, Delphi, Visual Basic to name a few. The first thing one notices is that way back then it was neat and easy to read.

A sample of the older Visual Basic code.

Public Class SampleClass 
   Private defaultForA As String = "default value for a" 
   Private defaultForB As Integer = "42" 
   Private defaultForC As Double = "68.90" 
      
   Overloads Public Sub Execute() 
      Execute(defaultForA, defaultForB, defaultForC) 
   End Sub 
      
   Overloads Public Sub Execute(a As String) 
      Execute(a, defaultForB, defaultForC) 
   End Sub 
      
   Overloads Public Sub Execute(a As String, b As Integer) 
      Execute(a, b, defaultForC) 
   End Sub 
      
   Overloads Public Sub Execute(a As String, b As Integer, c As Double) 
      Console.WriteLine(a) 
      Console.WriteLine(b) 
      Console.WriteLine(c) 
      Console.WriteLine() 
   End Sub 
End Class
In the above code it is very clear that the same line with the method/function name is also the block beginning, and the end sub is the end of the block.

And in ColdFusion we would have

   <cfcomponent>
 
        <cffunction name="method1">
        </cffunction>
 
  </cfcomponent>

Same applies here the beginning of the block is also on the first line, and translate in to cfscript, if we followed the style of older and more established languages.

component {
  public function method1() {
  }
}

Now my question is that companies like Sun, adopt this way of thinking as well. Every JavaScript bit of code that I have seen in the last 15 years as adopted this style, even in the .Net world it seems to be preferred  to some degree. Way back in the C days it was this style of programming, and yet C#, seems to be the odd one out in some circles. Adobe even contradict their preference when going from ColdFusion to ActionScript as well, prefering to break from the norm and tradition of style over the years.

And yet IDE's like Visual Studio seem to not follow this rule, only a very small few but it appears that this is the Microsoft world only as far as IDE's go, standards vary depending on who you chat too.

So my question is what do you prefer and why.


ColdFusion Guidelines/Standards what works for you and why - http://cfbloggers.org/?c=45070 Oct 13, 2010