For the record, the whole issue of multiletter variables in maths could be worked around by using cursive (where letters are always joined together), then you'd know if two letters are separate variables or not by whether the letters themselves are separated. Heck, it already has multiletter stuff for some operators (e.g. sin).
That's the least of the problems with math though, especially since the meaning of each letter is usually explained in a paragraph next to the equation. The bigger problem is just how horribly complex they can get with all those symbols (while programming normally only uses the most basic operations, using actual words for more complex ones). That certainly can make any even remotely complex equation a pain to read unless you're a mathematician (and possibly even if you are).
Brendan wrote:
Displaying numbers properly requires internationalisation. Programmers have been "perverted" by prolonged use of crappy programming languages and crappy standard libraries, which have traditionally failed to accept properly formatted numbers as input (in the source code itself, and in functions like "atoi()" used at run-time) and failed to convert numbers to strings (for display, etc) properly.
As usual, this is a problem harder than it sounds, since numbers meant for computers (e.g. stored in a file) are different than numbers to be shown on screen. And when it comes to separators, different regions have different requirements (not just . vs , there's also other symbols, or how many digits to group, or how to show the sign, or even which characters are to be used for digits, etc.). And that's ignoring stuff like padding and such, or the fact your program may be using a different language than the system's (e.g. because it wasn't translated into it yet), so you may need to explicitly set the formatting locale.
All this really should just be part of a formatting string.
...incidentally, the standard C library
already handles all this (look up the locale stuff, most of the lconv structure is dedicated to number formatting in fact). It's just that nobody bothers to use it.
Brendan wrote:
It's relatively easy to split a number into groups using "number % 1000" and "number / 1000";
Eh, depends on how long is the number, I suppose that for your average number is OK, but if the number is huge then it may be better to just count characters as you generate the string. Either one works, I guess (use whichever is easier for the case).
MichaelFarthing wrote:
That's rich coming from a representative of a community that has added to that initial ambiguity by adopting yet another symbol for multiplication (*)
Blame ASCII for that. And many early programming language
did use either × or · instead.
Kind of wishing some of the ASCII control codes were just more glyphs. Turning FS/GS/RS/US into ↑↓←→ would have been great (and we could be using ← instead of = for assignment, yes I know other languages use := but it looks awkward).