You might have some finite chance of changing programming languages. You've got zero of changing human languages.
i know. I'm just cranky
In all seriousness. I Find it weird that text input fields (or even programs. I'm just using the text input field here on the blog as an example) still can not properly capitalize things. They can spellcheck but capitalization is not there. (Neither is removing redundant space(s)or adjust comma position. But they can detect if you and when you make sentences that ramble on and on and where to put breaks... weird.
to give you an idea : i started typing this reply with the following:
i know. i'm just cranky.
the edit window underlines i'm and suggests me to change to "I'm". But not a peep about "i know" which should technically be "I Know".
how weird...
I'd say two reads is enough, though it's necessary to know what language you're looking at.
And therein lies the rub.
The intent of the example is indeed to assign x*2 + X to X and then compare X to x*3
just assuming you could look at it and understand it without study.
it should be simple enough so you don't need "study". i like verbosity over terseness. And make things non ambiguous.
You don't like using and knowing precedence levels, and you don't like parenthesised either. What do you like?
Parenthesis and simple things. The above was just an example of how i don't like it.
my ideal language would not allow for such constructions. it would need to be refactored to
b = (a*2) + b
if a*3 = b ...
notes :
You must write the parenthesis. My language has no operator precedence and executes left to right . i do this to force readability and reduce errors. many times bugs are caused by errors against this precedence.
the IDE's auto indentation prettifies (is that even a word?) it further. The IDE also colorizes variables and keywords . An undefined variable turns red. So you immediately see if you got it wrong or still need to define it.
Right mouse click on an undefined variable shows a pulldown menu-> define in scope , define global , define as function pass-in so you get a local variable in the function , a global variable or a declaration of the variable in the function header.
of course my language doesn't do header files and all functions are global by default. No need for such nonsense as forward declaration. Right click on a variable also allows you to change type easily. there are only two base types : strings ( which are a form of array : array of byte ) and numerals. i will allow to tighten numerals to int8 int16 and so on. but by default a numeral is unlimited in length ( ideally all arithmetic should be BCD arithmetic. so the numbers themselves can be stored into "string of nibbles" )
define x as string ' gives you a string of bytes. the keyword string is nothing but a shortcut to array of byte
define x as array of byte ' gives you also a string
define x as array of string ' pretty obvious. array is unlimited in length
define x as array of string(5) ' now string is limited in length
define x(3) as array of string(5)
define x(1970 to 2000) as array of string(5)
numbers :
define y as number ' unlimited , float bcd arithmetic packed as array of nibbles
define y as number(
' 8 digits float. this internally occupies 5 bytes. [sign][8digits][period]
define y as number(8,3) ' 8 digit , 3 digit exponent
define y as integer(
' 8 digit no float
bcd encode nibble :
0..9 :classic numbers
A = negative sign
B = positive sign
C = period (comma)
D = (dead, infinite)
E =exponent
F = fraction
123 is encoded as B123 so requires two bytes: 0xb1 0x23
-123 is A123
123E567 is B123EEB567
-123E-567 is A123EEA567
the encoder treads exponent and mantissa as byte aligned
-12 becomes AA12
-123 is A123
-12E-99 becomes AA12EA99
-12E-9 becomes AA12EEA9
so the non-numerals can repeat to make sure we have an even number of nibbles.
define y as signed (bitcount). if i need a 128 bit number : define x as signed(128)
AD = underflow ( negative infinite)
BD = positive infinite
B1F3 = +1/3
if a result cannot be stored 'exact' it is retained as a fraction so precision is not hampered.
This isn't a problem of the syntax, it's a problem of the programmer not having a correct mental model of the computer.
no, what i meant is remembering what syntax means the contents, the address
i would use addressof or locationof ( or indexof, treat it like an array. your entire memory is a huge array of bytes)
C let's you write things like
int* x;
int *x;
int * x;
These are all interchangeable. Some programmers use one style, other different style. it confuses things.
same thing for declaration grouping. only like types can be grouped
int* x,y;
x is a pointer .. y is not ... that is confusing.
so i would flip that around to
define x as pointer to number
define y as number
if both were intended as pointers you can write
define x,y as pointer to number
anyway. unfortunately i am neither a programmer ( 99% of what i write are so called run-once programs to solve a problem, the rest is tools that are very specific to one field ) nor a good keyboard jockey ( two finger typer)
but it is fun to think about programming languages and try to remove ambiguity and make them more humanly readable.
the ideal language should need no manual other than a list of keywords. the syntax should make the language self documenting with no scope for 'interpretation' or guessing