LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Dollar sign in coding (https://www.linuxquestions.org/questions/programming-9/dollar-sign-in-coding-928998/)

hololeap 02-12-2012 02:09 PM

Dollar sign in coding
 
I am from the United States, so I never gave it much thought until now, but I was wondering if the use of the dollar sign ($) in so many programming languages bothers people from other countries. It must feel odd, just like if I were inserting the Yen sign (¥) into my code constantly.

millgates 02-12-2012 02:49 PM

Hmm... It doesn't bother me. Most programming languages (all I know actually) are based on English so it doesn't seem so odd there. I don't usually even think of it as a DOLLAR sign, but rather a 'value' sign because that's more or less its meaning in most programming languages I've seen. I actually encountered this symbol in the context of programming much sooner than as a symbol of USD ( I didn't have much interest in economy when I was 8 :) ). Actually I used to wonder why the americans chose to use 'that programming character' as a symbol for their currency (history was never one of my talents either). :) I have been seeing '$' in programs for so long that it doesn't seem odd to me at all.

TobiSGD 02-12-2012 03:41 PM

Quote:

Originally Posted by millgates (Post 4600732)
I don't usually even think of it as a DOLLAR sign, but rather a 'value' sign because that's more or less its meaning in most programming languages I've seen.

I learned to program on the Commodore 64, Microsoft Basic V2. In that language the $-symbol was used to declare a variable as a string variable. Since then I never think of dollars when I see it in program code.

millgates 02-12-2012 04:36 PM

Quote:

Originally Posted by TobiSGD (Post 4600766)
I learned to program on the Commodore 64, Microsoft Basic V2. In that language the $-symbol was used to declare a variable as a string variable. Since then I never think of dollars when I see it in program code.

Hmmmm, BASIC... :) My first programming experience was BASIC on ZX Spectrum. Had a lot of fun with that. Then I started with pascal, which I didn't like after my previous exposure to BASIC (I mean, you don't number your statements in pascal?!? How do you tell goto where the loop begins?). My BASIC programs kinda looked like those Dungeons & Dragons kind of books (If you rolled 16 go to page 138).
I don't even remember what meaning the dollar sign had there. I actually don't remember anything about BASIC. I guess my mind just blocked those memories to protect itself or something... The only thing remaining is those freaky, creepy flashbacks I see whenever I eat spaghetti. :)

TobiSGD 02-12-2012 04:42 PM

Quote:

Originally Posted by millgates (Post 4600794)
I mean, you don't number your statements in pascal?!? How do you tell goto where the loop begins?

Exactly what I thought when I saw a friend on his Amiga coding in Amiga Basic (I think that was what it was called). Gave me serious problems when I later tried to port a program to my Atari ST with Omicron Basic.

Cedrik 02-12-2012 05:28 PM

Me either, I don't think of $ as dollar sign in programming, same with @, when I declare array in perl script like @my_array, I don't think I am sending email to my_array host


All times are GMT -5. The time now is 04:01 AM.