Tips for beginners
Posted: Wed Jan 22, 2014 7:52 pm
I was thinking we should compile a list of tips for beginners. They would be on the shorter side since these are not a replacement for reference documentation or tutorials. Also, it would be ideal to emphasize things that may not be obvious. For example, @help isn't commonly found in other languages/compilers and it's not like it's going to jump out at you.
Obviously that would go in the wiki, but we can start the discussion here. Some that come to mind:
-- You don't have to state the type of a local variable twice:
This shorter form is the same:
Cobra infers the type from the right hand side.
-- For IDE support with completion suggestions, parameter tips, breakpoint debugging, etc., use Xamarin Studio aka MonoDevelop.
-- In Cobra code, you can put @help before a type or method call to make the compiler generate an HTML file containing information about that type and/or method.
-- The @number directive can be used to set Cobra's default number type to decimal, float64 or float32. `decimal` is the default.
-- The `extend` feature can be used to add methods to existing types including String, int, etc.
What tips can you guys think of?
Obviously that would go in the wiki, but we can start the discussion here. Some that come to mind:
-- You don't have to state the type of a local variable twice:
results as List<of String> = List<of String>()
This shorter form is the same:
results = List<of String>()
Cobra infers the type from the right hand side.
-- For IDE support with completion suggestions, parameter tips, breakpoint debugging, etc., use Xamarin Studio aka MonoDevelop.
-- In Cobra code, you can put @help before a type or method call to make the compiler generate an HTML file containing information about that type and/or method.
-- The @number directive can be used to set Cobra's default number type to decimal, float64 or float32. `decimal` is the default.
-- The `extend` feature can be used to add methods to existing types including String, int, etc.
What tips can you guys think of?