Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

One question

Name: Anonymous 2007-09-13 12:32 ID:H7xDLSxb

Why is forced indentation of the code a bad thing? I mean, are there people who don't indent their code?

Name: Anonymous 2007-09-13 12:36 ID:WySsaAWg

Why is rape a bad thing? I mean, are there people who don't enjoy sex?

Name: Anonymous 2007-09-13 12:52 ID:Tob8N/Hs

>>2
Rape is good for one person and bad for another. The forced indentation of code is good for both.

Name: Anonymous 2007-09-13 13:10 ID:X7oto4p4

Because you are forced to do it

Name: Anonymous 2007-09-13 13:12 ID:Heaven

>>3
NO, WRONG

Name: Anonymous 2007-09-13 13:12 ID:Heaven

>>4
No, you're not. You can write your unreadable ``1337 h4x0r'' oneliners in Python too. If you're going to not indent properly, that's what you're going after, anyway.

Name: Anonymous 2007-09-13 13:19 ID:yMqVHrFS

Telling people "you must indent your code" is like telling kids they have to finish their dinner before they can have dessert. In much the same way as kids might enjoy skipping dinner and just eating cookies -- whatever their reason -- script kiddies, for some bewildering reason, like to make their code look like ground-up cocks by not indenting it. But they're forced to eat their dinner because it's good for them, goddamn it.

Later on in life, they move out, and start to fend for themselves, and they realize, hey, if I want cookies for dinner, I'll have cookies for dinner. And then what happens? They become fucking fatasses and die at 40 of heart failure, because all they ever had for dinner was cookies.

Shut the fuck up and indent your fucking code, fatass.

Name: Anonymous 2007-09-13 13:19 ID:wc/HM9Vx

Who cares about forced indentation (big deal); I'd rather that Python had end delimiters.

Name: Anonymous 2007-09-13 13:22 ID:Heaven

>>8

if whine:
    print "whine less"
# end if

Name: Anonymous 2007-09-13 13:53 ID:Tob8N/Hs

>>7
Later on in life, they move out, and start to fend for themselves, and they realize, hey, if I want cookies for dinner, I'll have cookies for dinner.
Not in my house, not in my development team. The cookies example is not really valid, because if you have cookies for dinner, you're just hurting yourself by becoming a fat American, but if somebody in my team doesn't indent his code, he'll be fucking with me when I have to read and fix his crap.

If you want to write quick hacks and find Python very uncomfortable, use Perl. For real work, there's a language where you know you won't have to deal with morons' code.

The forced indentation of code is a non-issue. If you write proper code, it doesn't bother you in the very least, because you're already indenting it. It comes at no cost; it's not like static typing or anything that could be seen as a pain in the ass. OTOH, if you write shittily, it does you and others good by forcing you to work properly.

I'm far more willing to maintain Python code than any other language, not only because it's guaranteed to be properly indented, but because the forced indentation of code keeps Perl and similar faggots away. It's the same reason why Linux Tarballs would choose C: besides of the language's benefits, it's good because it keeps C++ faggots away.

Name: Anonymous 2007-09-13 14:17 ID:eqX2y2Mk

I couldn't care less whether script kiddies indent their code, but there are a lot of "professionals" who don't do it either. Eventually I end up having to maintain their shit and having it indented makes that slightly less horrid.

On the other hand there is plenty of tooling to do code indentation automatically.

Still I don't see the downside to making decent indentation mandatory. Yay Python.

Name: Anonymous 2007-09-13 14:32 ID:Heaven

I just miss the curly braces around blocks. Makes code more readable IMHO.

Name: Anonymous 2007-09-13 14:35 ID:Heaven

>>12
I have written C for over ten years and Python for just a bit over one year, and I think the lack of those fucking braces is a great thing. I fucking hate those ugly things cluttering MY code.

Name: Anonymous 2007-09-13 16:06 ID:Kos7Zxrf

Whatever it was, I'm rambling.

Name: Anonymous 2007-09-13 17:07 ID:V2eoxi1h

>>10 For real work, there's a language where you know you won't have to deal with morons' code.
You mean Lisp? It tends to scare the morons away....

Name: Anonymous 2007-09-13 17:38 ID:j48YQp3Y

C++ has voluntary indentation of code, and everyone uses C++. Therefore, C++ is a really good language.

Name: Anonymous 2007-09-13 17:47 ID:Heaven

>>15
It scares away everybody because it's useless. Morons and intelligent people alike.

Name: Anonymous 2007-09-13 17:52 ID:xVCpxQO9

>>8

Go away

Name: Anonymous 2007-09-13 18:15 ID:wc/HM9Vx

>>13
This is why I like end delimiters. It usually results in more vertical whitespace.

And then there's list comprehensions, which I see Python dweebs abusing so the code goes waaaay that way ->

Learn a thing or two from typography. Dense code vertically and horizontally isn't prime grounds for readability.

Name: Anonymous 2007-09-13 19:13 ID:0xuX2pD7

>>12
With proper indentation of code, they're kinda useless. It's obvious where does a block end; I don't rely on braces to tell because it's (or it should be) properly indented. Anyways, you can use braces in Python too:
if x < 5: #{
    print x
    x -= 1
#}


>>15
Yes, that's a good reason to use Lisp.

>>19
This is why I like end delimiters. It usually results in more vertical whitespace.
I love vertical whitespace (even though it's kinda useless). However, what of Python prevents you from using blank lines, which look even better than brace lines?

And then there's list comprehensions, which I see Python dweebs abusing so the code goes waaaay that way ->
You don't have the forced indentation of code in list comprehensions. If they get complex you can do something nice like:
[i, j, k for i in whatever
               for j in whatever
               for k in whatever]

Name: Anonymous 2007-09-13 19:24 ID:HLACdTGv

the forced indentation is ok. It's not forced because "yay the morons cannot indent", but because it saves you from typing and having to look at braces. Me? I don't care much, but I also understand that voluntary indentation languages also have automatic indentation in most of the cases so you can rely on that too.

Name: Anonymous 2007-09-13 19:39 ID:00Wq+3eL

ONE WORD, SOURCE CODE IS STILL FUCKING STREAMS OF BYTES WHERE FAGGOT SHIT LIKE SPACING AFFECTS THINGS, THREAD OVER.

Name: Anonymous 2007-09-13 19:42 ID:Yc8VPAhI

>>17
thread was over here

Name: Anonymous 2007-09-13 21:45 ID:CVzytUjV

☠ Girls not allowed on Interweb ☠

Name: Anonymous 2007-09-13 21:46 ID:CVzytUjV

☠ Also, wrong thread. ☠

Name: Anonymous 2007-09-13 23:23 ID:yMqVHrFS

The problem with braces is you end up with two ways that blocks of code are delimited -- there's the visual delimiter, which humans recognize, and there's the "real" delimiter, which the computer does. This is redundant, and if you're not paying attention you can introduce subtle bugs that way.


for (i = 0, j = 2; i < 10; i++, j++) {
    if (i == 4) {
        printf("Oh my god, i is four.\n");
    if (j == 3) {
        printf("Zounds, j is three.\n");
    }
    for (k = 0; k < i; k++)
        if (a[k] == j) {
            printf("cocks\n");
        }
    }
}

Obviously this code doesn't do anything super-important, but it probably took a moment to figure out what it actually does when you look at the braces -- versus what it *should* do considering the indentation. Maybe the programmer missed a close brace at the top, the compiler complained, and he stuck it in the wrong place. Or maybe that 'if' really was supposed to be nested. Who knows.

The point I'm making here is, even if your language doesn't use indentation (which most don't), *you* are most likely still using it as a perceptual block delimiter, and that is a Bad Thing. When the language is interpreting the whitespace, that's GOOD because it means what you see is what you get.

Name: Anonymous 2007-09-13 23:28 ID:HLACdTGv

and >>26, that's when you press the button called "indent". And the ide does it for you. Or better, the ide may indent as you type. anyway, I've yet to see this problem in real code. And what about the copypasta problem in indentation based syntax?

Name: Anonymous 2007-09-13 23:55 ID:yMqVHrFS

>>27
The mere fact that you need an "indent" button is testament to the fact that braces are a bad idea.

Name: Anonymous 2007-09-14 1:09 ID:1HOzbDWi

However, what of Python prevents you from using blank lines, which look even better than brace lines?
You're right, you don't. Only problem is that in production code I've rarely seen it. The Python programmers I've met (although they loved Zope, so who knows!) wouldn't know a code paragraph if it raped them in a back alley repeatedly.

You don't have the forced indentation of code in list comprehensions.
You're right, but that's something I haven't seen a great deal of in practice either.

Honestly I don't know why Python has list comprehensions. Guido doesn't want lambdas, and there's this whole "there's only one way to do it" ethos, but for some utterly random reason there's list comprehensions. List comprehensions are good for parallel programming, but thanks to the GIL that ain't happening any time soon.

If he's gonna stick with the GIL, at least he could have wasted his time on asymmetric coroutines instead of list comprehensions and half-baked generators.

Name: Anonymous 2007-09-14 1:10 ID:Heaven

Uh, shit, I went on a tangent there. Ignore me.

Name: Anonymous 2007-09-14 6:49 ID:ql3H6t1M

>>28
Truth

Another bad thing about braces is the holy K&R-style vs. shitty-style vs. even-shittier-GNUfag-style war.

>>29
they loved Zope
Then they are not Python programmers, they are ENTERPRISE PYTHON PROGRAMMERS. I'm saddened that some ENTERPRISE programmers make it to Python and fag it up, maybe we should move to Erlang or something like that.

Anyways, perhaps we need the forced vertical separation of code?

I don't know why Python has list comprehensions.
Because Guido wanted an excuse to kill map and filter. But I'm glad we got them, they're a valuable feature.

List comprehensions are good for parallel programming, but thanks to the GIL that ain't happening any time soon.
In CPython.

Name: Anonymous 2007-09-14 7:16 ID:QTZertJO

In CPython.
Too bad Jython is ENTERPRISE as fuck

Name: Anonymous 2007-09-14 8:37 ID:ql3H6t1M

There's also Stackless and IronPython

Name: Anonymous 2007-09-14 14:00 ID:ahM4/EQO

>>31
I'm saddened that some ENTERPRISE programmers make it to Python and fag it up
Indeed. Zope was supposedly the flagship webapp framework for Python for a long time. I think it did Python a great deal of hurt. I had to suffer with Zope at a previous job and... The terror! The TERROR! Make it stop, mommy!

But I'm glad we got them, they're a valuable feature.
Useful? To some degree. Valuable? I disagree.

I think it demonstrates how arbitrary GvR's thought processes are. It's trivial to get rid of map or reduce: get rid of them. You don't need a substitute when you have normal loops, unless you just gotta have them one-liners (helo 2 u Perl).

So much for consistency.

Anyways, perhaps we need the forced vertical separation of code?
An interesting idea. I have no idea how you'd do it though.

>>33
There's also Stackless and IronPython
Given that the Stackless, Psyco, and other interested parties are working on PyPy, I think PyPy is probably the future of Python. They're not afraid to add useful features either, unlike tightass GvR with his somewhat random ideas.

Name: Anonymous 2009-03-06 7:31

The length bothers you   that much just   say code bind.

Name: Anonymous 2009-03-06 12:57

Python in the post you were replying.

Name: Anonymous 2011-02-04 14:55

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List