News for hackers. Stuff that matters.
Re:I don't like Python. Does that make me a bad person? by melling on Saturday June 26, 2010 @08:13AM (#1463566)
I indent my Perl code. Not everyone does, however. It's a trivial task to reformat it in an editor. I guess the only complaint I might have is why bother thinking about indentation, ever? Throw in a couple of {} and now the tools can provide additional help.
Re:I don't like Python. Does that make me a bad person? by edanm on Saturday June 26, 2010 @08:53AM (#1463612)
The point is, I've never met a programmer who doesn't think of indentation. I've never seen a (real) project which doesn't have indentation. So if everyone is doing it anyway, why not take advantage of it and make it a part of the language? This way programmers learn to use indentation from the start (which any real programmer uses anyway), and indentation is always correct, nothing to ever think about.
Re:I don't like Python. Does that make me a bad person? by util on Saturday June 26, 2010 @10:40AM (#1463731)
It makes it harder to correctly do operations on code as text, eg, inserting a chunk of code from elsewhere or moving it out from or under an "if" statement. I have trouble with this occasionally working in emacs at least.
Re:I don't like Python. Does that make me a bad person? by edanm on Sunday June 27, 2010 @02:36AM (#1465091)
This does get to be a problem with people not indenting consistently. I.e., some code using tabs and some using spaces, and then copying between them.

Technically, your editor should take care of that for you, but some of them don't do it properly (and sometimes can't do it properly), and it really sucks.

Well, everything has a downside :)

Re:I don't like Python. Does that make me a bad person? by melling on Saturday June 26, 2010 @02:37PM (#1464064)
Shouldn't tools take care of that before a commit to svn, git, etc? Java has formatters, the Go language has one.

Do any exist for Python or Perl?

Re:I don't like Python. Does that make me a bad person? by edanm on Sunday June 27, 2010 @02:35AM (#1465089)
Take care of indentation, you mean?

1. People don't indent consistently. There are a lot of (imo, pointless) arguments about where to place the braces, etc. One of the advantages of the language forcing a style is that arguments about it are no longer necessary.

2. Why should tools be taking care of this? People indent to understand the code better. Everyone agrees that you have to do it. So what's the problem with the language forcing you to do it? I'd rather it be part of the language than an external tool enforcing it.

Re:I don't like Python. Does that make me a bad person? by jsankey on Saturday June 26, 2010 @09:02AM (#1463617)
I indent my Perl code. Not everyone does, however. It's a trivial task to reformat it in an editor.

But in Python, you don't even have to worry about other people not indenting their code!

I guess the only complaint I might have is why bother thinking about indentation, ever? Throw in a couple of {} and now the tools can provide additional help.

When you edit Python, the tools can already help as much. The start of a block is obvious (def, if, for, etc), so tools indent for you. To dedent, just hit the right key (e.g. a backspace on an empty line in emacs) -- no harder than hitting the brace key.

Re:I don't like Python. Does that make me a bad person? by dmn001 on Saturday June 26, 2010 @11:54AM (#1463821)
You do have to worry as their Python code produces errors if they do not indent it properly!

I don't like Python either and prefer Perl. (In Python I did not like indentations, dicts, tuples, lists, and the IDLE gui.)