New to Python - block grouping (spaces)
sohcahtoa82 at gmail.com
sohcahtoa82 at gmail.com
Fri Apr 17 14:13:15 EDT 2015
On Friday, April 17, 2015 at 10:06:13 AM UTC-7, BartC wrote:
> On 17/04/2015 17:28, Grant Edwards wrote:
> > On 2015-04-17, Michael Torrie <torriem at gmail.com> wrote:
>
> >> However, it may be that people recognized that you likely had made up
> >> your mind already, and posted accordingly.
> >
> > I think most of us just assumed he was just trolling and were playing
> > along for the fun of it.
>
> What was troll-like about it? The OP made it clear he didn't like the
> way Python made use of tabs, but he didn't want an argument about it or
> to be persuaded to change his mind or change anyone else's.
>
> He wanted to know if there was a simple syntax wrapper for it. That
> seems reasonable enough.
>
> (Actually *I* would quite like to know why languages don't have
> switchable syntax anyway to allow for people's personal preferences.)
>
> --
> Bartc
Allowing a switchable syntax only makes the fight even worse. If you made braces in Python an option to use instead of whitespace block delimiting, then there'd be a ton of infighting among Python developers over which to use. Just look at C/C++ developers fighting over where the opening brace goes.
By having the language itself forcing a specific style, it requires everyone using it to either shut up and get over it, or just don't use the language.
Personally, I like the Python style. It forces people to write code that is at least somewhat good to look at. Not like monstrosities like this that I see from newbie (hell, even professional) C/C++ programmers:
if (something > something_else)
{
result = do_something();
if (!result){
printf("Error!\n")
return 0;
}
do_other_stuff();
}
Can someone still write ugly code in Python? No doubt about it. But at least code blocks will be easily deciphered.
More information about the Python-list
mailing list