Re:Math Intuition Cheatsheet
by TheLoneWolfling on Friday July 25, 2014 @11:05AM
(#8085558)
What 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.)
Re:Math Intuition Cheatsheet
by marcosdumay on Friday July 25, 2014 @04:49PM
(#8087576)
That 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.
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".