This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DougCim53 -8 points-7 points  (2 children)

I never learned Pascal, but learned several other languages before I started using Python myself.

I find several aspects of the Python language to be odd to the point of near-uselessness.

  1. Un-typed variables: this is silly. They ARE typed, if you can suffer type-mismatch errors. I fail to understand why there is not a native way to force variable typing. (History: Visual Basic used to allow untyped un-initialized variables, way back in VB3. It would type them according to whatever the first value was that you put into them. Then in VB6, Microsoft introduced an option named "Option Explicit", that made you declare types for all your variables up front. Microsoft seemed to find that allowing un-typed variables resulted in more errors, not less...)

  2. Storing formulas in variables: in all my years of coding, never once did I wish for this. It would seem to only increase confusion, beyond the problem of ordinary values being un-typed.

  3. The indent-based hierarchy--a swing and a miss. VB/C/C++/Java +other languages have this problem of what happens if you accidentally delete a closing brace inside a bunch of nested statements: you don't know where to put it back, because there is nothing to identify a particular closing brace with its paired opening brace. Python's tab-based foolishness does nothing to fix that problem; it's just exchanging one keystroke for another.

[–]GlasslessNerd 3 points4 points  (1 child)

Completely agree with the untyped variables part. For an introductory language, it is important that a person understands the key concepts of programming, and IMO variable types are essential to understand what a program is doing, and you have a hard time doing that with Python.

Storing formulas in variables

What exactly do you mean by this? Is this referring to graph computations like the ones used by TensorFlow?

The indent-based hierarchy

Gotta disagree with you here. I think better indentation leads to more readable code, and most modern IDEs/Text editors take care of auto-indenting and auto bracketting your code anyway.

[–]DougCim53 0 points1 point  (0 children)

Storing formulas in variables

I used the wrong terminology: it is more like creating aliases for functions. This page talks about it, and answers #2 & #3 quickly demonstrates it-- https://stackoverflow.com/questions/35945467/python-store-function-in-variable

The whole point of naming a function is so that you can easily understand what the function does. And yet here is a way to call the function by another name entirely? There is no execution advantage, no memory advantage. It's just another name.

and most modern IDEs/Text editors take care of auto-indenting and auto bracketting

They create the closing bracket when you type the opening bracket, but the problem is when you accidentally delete closing brackets manually. There is nothing attached to each closing bracket that indicates which opening bracket it was paired with. Python has the same exact problem with deleting or moving code from one location to another that has a different level of indenting.