Case Sensitivity

Monkey Archive Forums/Monkey Discussion/Case Sensitivity

gekkonier(Posted 2012) [#1]
I would like to ask whats the point about the case sensitivity in monkey code? For a basic like language its very rare to find this. Maybe difficults in parsing case insensitive? Dunno. I like the syntax of blitzmax much much more - it's a lot easier to code in blitzmax for me. What do you think?


tOmzone(Posted 2012) [#2]
General code conventions of many programming languages rely on case sensitivity. It makes code more readable/consistent.
You should try to avoid writing variables (or whatever) different on several positions in your code, even in BlitzMax.


gekkonier(Posted 2012) [#3]
I know about coding guidelines in teams, etc. - but I for myself like it my way formatted, especially if I'm coding for myself.


tOmzone(Posted 2012) [#4]
Yes, I understand your opinion. Writing case sensitive code was just meant to be a hint for you in relation to readable code etc.
I think the majority here do want to follow that principle so an update which turns it off is unlikely.


Paul - Taiphoz(Posted 2012) [#5]
gekkonier are you dyslexic ?


therevills(Posted 2012) [#6]
Where does it say that Monkey is a BASIC like language?

I'm pro case-sensitive, I like doing the following:
Local gamescreen:GameScreen = new GameScreen()



Paul - Taiphoz(Posted 2012) [#7]
Sorry that might come off as being a little rude....

I ask because I am dyslexic, and when I moved from blitz3d and max to monkey, case and capitalization was about 90% of my error's.

I always followed , albeit loosely camal case or pascal case, mixing in my own thing every now and then, but I really didnt notice just how much I mixed it until I hit monkey.

It really makes you stick to a standard, for me I now only drop a capital in the first letter of each word in a variable, like ShipSprite or EnemyBullet I always make methods lower case and any and all class's start with a small c followed by a capital cShip for example.

and that's about it if you pick a nice simple convention and then just try and stick to it, your problems with case will vanish.

I still have the odd dyslexic slip up but for the most part its not an issue any more.


NoOdle(Posted 2012) [#8]
I make all variables start lowercase and then upper for any extra words e.g. playerX. For class names i always use a single capital letter followed by a capital word like TPlayer, method names are capitalised as well e.g. MovePlayer() and the same for functions. Consts I make entirely capital e.g. ID_MOVE. I always use spaces between everything except double brackets pX = ( x + PositionX()) and comments I always do '/ Comment.

Each to their own, but capitalisation is good in my opinion. Consistency helps readability.


Neuro(Posted 2012) [#9]
I prefer the case sensitivity.


Jesse(Posted 2012) [#10]
^^ Ditto.


degac(Posted 2012) [#11]
I still prefer case Insensitivity: faster typing, less production time, less error, major focus on the result than the 'lexic' itself...
But I'm a minority.


Xaron(Posted 2012) [#12]
Yes you are. ;) "Less error" must be a joke I guess. *g*


therevills(Posted 2012) [#13]
At the end of the day, Monkey is case sensitive, the main reason I guess is that all the target platforms are also case sensitive. It was a pain to get case sensitivity to work (and it looks ugly) for the BlitzMax target.


gekkonier(Posted 2012) [#14]
The case sensitive Targets makes sense to me.

Local gamescreen:GameScreen = new GameScreen()


I would never name an object the same as a class - with case as the only difference. I prefer to mix Prefix and camelCase. Prefix to make it absolutely clear what type of token it is, and camelCase to make it better readable. But I don't like it to have to write Print instead of print, if you know what I mean. I'm curious.


Gerry Quinn(Posted 2012) [#15]
I regularly name an object as a camelCase version of a class, same as above. It just seems logical not to have to think of a new name, especially for something unique such as a game screen. With case insensitivity you'd have to call it MyGameScreen or TheGameScreen or something.

I must admit having to type Print is a nuisance but I think that just stands out because you half expect Print to be a Monkey keyword.

My biggest typo in Monkey comes from having written so much C++: I am always writing things like:

For Local int i = 0 until 10

Every new piece of code I try to compile has a bunch of those.