5 ms·
When I took my first programming course, one of things I was most surprised by was case sensitivity. It's kind of funny thinking about it now my perspective is
by djrtwo 12y ago
When I took my first programming course, one of things I was most surprised by was case sensitivity. It's kind of funny thinking about it now my perspective is entirely different -- "D" and "d" aren't the same value so why would they mean the same thing?
Is case sensitivity a bad artifact? It doesn't seem like it is to me anymore, but my former self sure thought so.
- bjeanes 12y agoSalesforce's Apex language is case insensitive. It leads to a a lot of confusion, frustration, and distress when different programmers have their personal preferred style of referring to a class or var or when the lazy ones just write everything in lowercase. Never again.
- pja 12y agoWould the best of all possible worlds be a case sensitive language where once you defined a name all other names that differed only in the case of the characters would be impossible to define? That way names would have to be referred to as written, but you would avoid the potential confusion of having multiple names that differed only in the case of their characters. Lots of programmers would probably regard this as some terrible infringement on their freedoms but, like python's whitespace indentation, I think it might work out OK.
- claudius 12y agoI like there to be a difference between a variable “p” and a variable “P” (the former, for example, might be a vector, whereas the latter could conceivably be a projector onto this vector). Especially when doing numerical work, I found it to be extremely helpful to stick to established notation in the field also in the code intended to implement the algorithms written in this notation. In this sense, I find it sometimes sad that C++ doesn’t allow boldface/curly variable names :)
- marcosdumay 12y agoBesides using the field's notation (why we still can't werite greek letters easily?), I also like it a lot to use case to differentiate between kinds of elements. For example, let's say you want to write code that communicates with an arduino. You can define a class named "Arduino", that'll be instantiated on other classes, and the instances can be called "arduino", with no problems at all. On case insentive languages one has to resort to worse names, like "arduino_t", or "arduino_instance".
- TheLoneWolfling 12y agoWhat if it was only for things in the same "class" (wrong word, but I'm not sure what to actually call it)? So variables only with variables, classes only with classes, functions only with functions? (I.e. you can define a class called Arduino (bad name, by the way) and a variable named arduino, and it won't complain, but if you then try to define a class called "ARDUINO" or a variable named "ARDUINO" it will error out.)
- marcosdumay 12y agoThat would make a class of error impossible, at the cost of losing consistency (in most modern languages, the class name is just a variable that holds a class value). I'm not decided if I like it or not.