Skip to content

Instantly share code, notes, and snippets.

@DominicWatson
Last active December 25, 2015 21:39
Show Gist options
  • Save DominicWatson/7044600 to your computer and use it in GitHub Desktop.
Save DominicWatson/7044600 to your computer and use it in GitHub Desktop.
Example code to show tabs and spaces being used for indentation and alignment. To see why tabs don't work for alignement (and spaces do), go into edit mode and change the indent size setting. Watch how the first example breaks and the second does not. The second examples show the advantage of TABS for INDENTATION without breaking alignment when …
<!--- TABS FOR BOTH INDENTATION *AND* ALIGNMENT --->
<cfquery>
select column_a,
column_b,
columb_c
from some_table
inner join another_table on another_table.id = some_table.another_table
</cfquery>
<cffunction name="blah">
<cfargument name="blah" type="string" required="true" />
<cfargument name="excellent" type="boolean" required="false" />
</cffunction>
<!--- TABS FOR INDENTATION, *SPACES* FOR ALIGNMENT --->
<cfquery>
select column_a,
column_b,
columb_c
from some_table
inner join another_table on another_table.id = some_table.another_table
</cfquery>
<cffunction name="blah">
<cfargument name="blah" type="string" required="true" />
<cfargument name="excellent" type="boolean" required="false" />
</cffunction>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment