-2

First, why there is no end in python? Second, the fact that there is tabs and there is no end make python the best readable/beautiful language, why they do not introduce these characteristics in other languages?

drzbir
  • 419
  • 1
  • 6
  • 15
  • FYI, this doesn't really belong in Stack Overflow, so you may get a bunch of downvotes. There is someplace on Stack Exchange where this would be a good question, so if you want an answer to this question, look elsewhere. –  Jun 24 '15 at 03:01
  • possible duplicate of [As a language, is Python limited due to no end statement?](http://stackoverflow.com/questions/13345191/as-a-language-is-python-limited-due-to-no-end-statement) – Bhargav Rao Jun 24 '15 at 03:02

1 Answers1

4

You'll have to ask Guido van Rossum about why he didn't introduce an end construct, since it's a language design issue - but as you say, there are aesthetic reasons not to do so.

The reason this isn't introduced to existing languages is that there are already billions of lines of code written in them, and you don't want to force people to change all of that just for some aesthetics.

Why not have it as a backward-compatible change, such as e.g. allowing languages with C-like syntax to have the opening { but not the closing }? Probably because programmers in those languages are very used to it and might actually prefer it to not having closing marks, and probably don't see this as a useful feature. Also, it would be necessary to make it a per-file decision, as a mixture of explicit and implicit block ends would be extremely confusing and probably not parseable.

As a matter of fact, Python itself contains a joke about this, which I believe reflects the authors' opinion on the matter:

>>> from __future__ import braces
  File "<stdin>", line 1
SyntaxError: not a chance

(__future__ is a module which you can use to import certain pieces of functionality that were introduced in newer versions of Python and have been backported to older versions.)

Aasmund Eldhuset
  • 37,289
  • 4
  • 68
  • 81
  • 1
    As an add-on to the first part of the question; Van Rossum worked on the ABC programming language, which has statement nesting by indentation. [In a interview with Bill Venners](https://www.artima.com/intv/pythonP.html), he states that "I made my own version of the various ABC parts that I liked. I created a basic syntax, used indentation for statement grouping instead of curly braces or begin-end blocks,...". In another interview with [Lex Fridman](https://www.youtube.com/watch?v=ghwaIiE3Nd8) he mentions that to work efficiently he wanted to remove details that one had to get right. – Moritz Apr 09 '19 at 16:31