DEV Community

Discussion on: Should programming languages be made for IDEs rather than humans?

Collapse
 
drbearhands profile image
DrBearhands

I've used matlab a little bit. I might have missed something but I think it made the problem worse by just turning everything into non-standard operators to stay within the ascii characters and monospace/text format.

LabView I know nothing about.

Why would you want to use spaces in variable names?

Why is snake Vs camel case a problem?

Because we create variable names composed of multiple words. fooBar is less readable than foo_bar is less readable than foo-bar is less readable than foo bar. Spaces are also easiest to write. The reasons not to use spaces is that it conflicts with syntax. Also some gestalt principles (characters of a variable are close together), but there's other options for that.

If you have a variable which holds the value for P(a|b), [...]

P(a|b) is a mathematical notation for "probability of a being true given that b is true". That's a lot of words to write out. This was a real-world problem I've had, especially because I also needed P(a|¬b) and many similar variables. The resulting code was unreadable using full-length variable names.
The meaning of P(a|b) is well understood by people who have a minimal background in Bayesian statistics. So, essentially, it is the right name.

More generally speaking though, because variable names are styling for humans, you could have multiple names for the same variable and use whatever suits you most in a certain situation, e.g. short or long. Although both at the same time sounds like a very bad idea :-P.

Collapse
 
mattconway1984 profile image
Matthew Conway

In terms of readability using camel vs snake I have to disagree as I've never had an issue reading either syntax, but everyone is different, so for you it's a fair point.

The point you make about naming variables is very true; it's very difficult to map mathematical names to human readable without being obtrusively long. So again, I guess if you do a lot of it being able to use reserved chars in a variable name could be useful...

Thanks for explaining what P(a|b) is, I've never come across that before :)