Care to share your interesting preferences? This thread is not particularly to discuss tips for others but I would imagine people would have some things to share which are interesting and help people.What are your general coding preferences that differentiates you as a programmer?
Some of mine:
I rarely use the false keyword to determine if the value is false instead I prefer (in general) to use the not keyword. For example:
if value = false then
end if
instead of:
if not value then
end if
I probably do this because it seems more English-like but I don’t really know why.
I rarely ever write if statements in one line. I find multi-lined if statements cleaner and more consistant. I also occasionally would write something like ‘if value’ and then press shift+enter which adds the ‘then’ and ‘end if’ for me. This means that it saves time rather than making me use more time to write ‘end if’ and feed in the returns.
I use the apostrophe symbol for all code comments and ‘//’ for all non-code comments. I also start comments without a capital letter or a space like a lot of programmers do.
[quote=109362:@Oliver Scott-Brown]
I use the apostrophe symbol for all code comments and ‘//’ for all non-code comments. I also start comments without a capital letter or a space like a lot of programmers do.[/quote]
I use the apostrophe for temporarily commenting out code. // for all other comments (I finally got away from using REM a couple of years ago!)
But the most important thing, in my opinion, is to have a consistent coding style with consistent naming conventions.
[quote=109368:@Gavin Smith]I use the apostrophe for temporarily commenting out code. // for all other comments (I finally got away from using REM a couple of years ago!)
But the most important thing, in my opinion, is to have a consistent coding style with consistent naming conventions.[/quote]
What is REM?
[quote=109368:@Gavin Smith]I use the apostrophe for temporarily commenting out code. // for all other comments (I finally got away from using REM a couple of years ago!)
But the most important thing, in my opinion, is to have a consistent coding style with consistent naming conventions.[/quote]
You mean writing ‘rem’ instead of using code symbols?
When I (and maybe Gavin) started… you had no choice but to use REM… there was no other option
As a nod to the past, I am still including REM (as well as ’ // and /* */) as comment designators in BASSET
(BASic to Swift Editor Translator)
[quote=109398:@Simon Berridge]Or the auto line numbering:
10 Dim A$
20 A$="this is a string"
Oh, those were the days![/quote]
Ah yes, this might blow Oliver’s mind! And if you used up the numbers, you could get going again after a quick RENUM
[quote=109395:@Dave S]When I (and maybe Gavin) started… you had no choice but to use REM… there was no other option
As a nod to the past, I am still including REM (as well as ’ // and /* */) as comment designators in BASSET
(BASic to Swift Editor Translator)[/quote]
Oh Dave,
BASSET ([b]BAS[/b]ic to [b]S[/b]wift [b]E[/b]ditor [b]T[/b]ranslator)
to quote the now sadly deceased Rick Mayall - Woof!