-- Leo's gemini proxy

-- Connecting to freeshell.de:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini;lang=en-GB

White space

(Obvs differs from Whitespace!)


I read that Go enforces code layout, so I'll probably never use Go. I'm not bothered where the curlies go or whether indentation is tabs or spoaces. It makes no difference. But if I can use whitespace to make structure explicit, I'm all for it.


Consider a C-style function:

int someFunc(char* someStr, int someInt, someStruct* magicBeans){
    // do stuff
}

Often the list of parameters is pretty un-readable. And here there are really two lists, one of types and one of names. You can make that structure pop out at you:

int someFunc(
    char*       someStr,
    int         someInt,
    someStruct* magicBeans
){
    // do stuff
}

Here's another example of hidden lists. There's one of member names and one of values...

record.name = "Alex";
record.wibbleIdentifier = 23;
record.foo = bar;

...so let's make that visually explicit:

record.name             = "Alex";
record.wibbleIdentifier = 23    ;
record.foo              = bar   ;

I'd say that the punctuation that the compiler requires is almost melting away, leaving names of things and values


So just leave the code where I put it! Sadly I may be alone in this view.


Addendum

As a thought experiment, imagine a langauge which avoided punctuation altogether and just used names and values. Is that even possible?



#CodeLayout


back to gemlog

-- Response ended

-- Page fetched on Fri May 3 23:51:44 2024