[17 / 0 / ?]
Quoted By:
I've come to realize that the best, sweetest, most readable syntax would be homogenous. That is, every line must have the same structure: either the meaning-defining token must always be at the front of the line, or at the back. And the first case is the best. That way you can always tell what is going on in a line of code by looking at just the first token. No more bullshit like that:
And no more bullshit like that too:
No, I want a language in which every line conforms to the most eye-soothing rule of all: explain yourself up front so I don't have to go on a missing persons searching expedition just to find out what you're doing.
Are there any languages with a syntax like that, /porg/?
int main() { // But it's not an int, it's a definition of a procedure!
double scores[3]; // But we're not doubling anything, we're defining something!
scores[0] = 1.5; // But we're not scoring anything, we're performing an assignment!
scores[1] = 2.5; // And we're not assigning to scores, we're assigning to its elements!
scores[2] = 3.5; // Same error as above;
// We're not couting anything! In fact it's hard to make out visually what is going on
// as we are calling array accesses, listing literals and calling the <<. This is
// an absolutely unreadable line.
cout << scores[0] << '\t' << scores[1] << '\t' << scores[2] << endl;
// Finally, an easily readable, well-syntaxed line!
return 0;
}
And no more bullshit like that too:
alloca $ \erroffset -> do
-- "pcre_ptr" is not what this line does, it shouldn't be up front!
pcre_ptr <- c_pcre_compile pattern (combineOptions flags) errptr
erroffset nullPtr -- This one's OK.
if pcre_ptr == nullPtr
then do
-- This is a clusterfuck! Not only is "err" unworthy of being at the front,
-- but also the order of calls is reversed the first call is "peek"
-- which comes almost last but not the last in the line! Absolutely unreadable!
err <- peekCString =<< peek errptr
return (Left err)
else do
reg <- newForeignPtr finalizerFree pcre_ptr
return (Right (Regex reg str))
No, I want a language in which every line conforms to the most eye-soothing rule of all: explain yourself up front so I don't have to go on a missing persons searching expedition just to find out what you're doing.
Are there any languages with a syntax like that, /porg/?