What differentiates you as a programmer?

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.

Thanks

[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?

LOL (sorry Oliver). REM is the original BASIC keyword to denote REMarks

’ this is a comment
REM this is also a comment

code statement for remark…old school :slight_smile:

Don’t feel bad Gavin I still find myself every now and then putting a $ in front of string variables :stuck_out_tongue:

or putting $ AFTER a variable name to denote it is a string

Dim A$
A$=“this is a string”

I googled REM and found REM in Xojo docs so I know what REM is now but thanks to those who answered anyway.

I couldn’t comprehend that Gavin actually used rem because I was in disbelief.

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)

Or the auto line numbering:

10 Dim A$ 20 A$="this is a string"
Oh, those were the days!

[quote=109398:@Simon Berridge]Or the auto line numbering:

10 Dim A$ 20 A$="this is a string"
Oh, those were the days![/quote]
I seem to recall PHP and BlitzBasic both use a dollar sign to declare strings.

[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 :slight_smile:

[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!

Where is my old commodore 64 with 8k memory :stuck_out_tongue:

8K? Was yours damaged? :wink:

In php, the dollar sign before a name indicates a variable. Not especially a string variable. A variable of any kind.

Oh right. I am pretty sure BlitzBasic use dollar sign for strings exclusively now I have read the docs.

Did anyone here ever use Liberty Basic? or Free Basic?

A$ is standard “old school” method to designate a string Variable
A# was double
A! was Single
A% was Integer

$A is PHP and not typed… so the $ just indicated a variable not a specific type.

Oliver, here are some random things I do - most of these are just personal preference.

  • parentheses for all method calls, whether there are parameters or not
  • loop counters declared as part of the loop construct
  • capitalized Class names
  • camel-cased method names
  • lower-cased keywords
  • folders in the Navigator for Windows, Classes, graphics files etc
  • Labels that aren’t going to be changed (accessed in code) are put into a Control Set, to clean up the Navigator
  • I use a Note within Xojo as a coding diary, documenting exactly what I did during that session, plus exactly what I have to do in the next session
  • any globals are declared in a Module, as little as possible goes into App
  • properly encapsulated classes