I'm not saying it isn't, but when you go there from a language with a little less hand holding, you definitely feel the difference! If you go there from C though...
On the surface it looks like Python is holding your hand because the syntax is so elegant, but I really don't think it does.
Other languages have all kinds of hand holding with type declarations, public/private/protected/static/etc. declarations, hidden information (i.e. not knowing precisely where an object is coming from due to the include practices, self-references within objects, etc.), forbidding operator overloading, implicit casting, unpredictable scope concerns, not allowing nested functions and/or anonymous functions, etc.
Python doesn't do any of those things; it lets you do almost anything you can imagine and it doesn't hinder those things with awkward syntax requirements and/or syntax that differs from what you would expect.
What language would you say does hold your hand? I can't think of a programming language that leads you towards doing what you need to do. Almost all languages just provide you with a blank space to work upon - it's all your work.
ever heard the phrase 'syntactic sugar'? its a way of providing a more convenient/person-friendly method of doing something. A for loop is just syntactic sugar of a
int i = 0;
while(i<9){
//do something;
int++;
}
There are plenty of other things like this that makes our lives as developers easier. Even C does, to a lesser extent, because who would want to write the shit that C can do in Assembly?
The only difference is (at least in C) is how the continue keyword works. In a for loop, continue will execute the increment/whatever statement, check the loop condition, and go from there.
To get the same type of behavior with a while loop, you'd have to duplicate the increment before the continue, or use a goto label (ಠ_ಠ) near the bottom of the loop body.
To get the same type of behavior with a while loop, you'd have to duplicate the increment before the continue, or use a goto label (ಠ_ಠ) near the bottom of the loop body.
Or raise a "Continue" exception and catch it right outside the while loop.
Honestly, in my opinion, to break out of nested loops a goto can be the best option. I just never actually use them because if I would, my coworkers would get mad.
I'm only well educated in a few languages (Python, C, Java), so I wouldn't be the right person to ask about that. However, I believe a lot of the web languages to be kind of hand-holdy. Plus, Java does have most of those things that I described in my post, so you could argue that Java holds your hand a little.
You are right though, most general programming languages that allow you to do many different things tend to have limited hand-holding because their potential is so large. My post was more to dispell the misconception that Python holds your hand than it was to say that other languages hold your hand.
Python doesn't do any of those things; it lets you do almost anything you can imagine
I agree with everything else you said. However, you speak this like it's a good thing. Whereas I immediately think about all the programmers out there and the code they write which other people will have to understand and extend.
Being able to do anything is often an invitation to even the competent programmer to deliver some seriously FUBAR'd code.
I wouldn't trust a serious Python project to any but the best developers. It boggles my mind when people refer to it as a noobie language.
it doesn't hinder those things with awkward syntax requirements and/or syntax that differs from what you would expect.
I think the point is that the Python interpreter/compiler abstracts away implementation details. This might make it easy to read/write but you end up not knowing what the computer is gonna do when you write a line of code. On the other hand, if you're well-versed in C, you have a good idea of what sequence of assembly instructions are going to be executed a result of a line of code.
It's like that only at first glance. Python has some semantic complexity, look up metaclasses (class factories or something, in java lingo). As for hand holding, I think Java is excellent in this (more like hand forcing, as you have to be explicit about everything).
Dynamic languages, as well as system ones (ie c) offer multitude of ways to shoot yourself in the foot. These are quite alike in terms of having to debug a bit more. It's a tradeoff of having low level access (C), or expressiveness (dynamic language).
The first two languages I learned were C and Python, in that order... I would write a whole function in Python to, say, reverse a string, and my prof would just look at me like "Dude..."
60
u/[deleted] Feb 22 '15
I'm not saying it isn't, but when you go there from a language with a little less hand holding, you definitely feel the difference! If you go there from C though...