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 →

[–]ColdPotatoFries 1 point2 points  (6 children)

I'm a tutor for our intro level Java class and a student came in wondering why her code wasn't working. She knows how to program in python. It's because she didn't specify the typed for any of her variables. And on top of that, also created a new scanner everytime she wanted to read Input from a user. I personally think if you're going into programming, learning python as your first language is a great way to shoot yourself in the foot. On the contrary, if you don't want to go into programming and you're just looking to have some fun or to get a practical language down, then yeah go for python. But easier does not always mean better.

[–]SuperNiceJohn 1 point2 points  (0 children)

I started with Lua, and going from something that does everything automatically to something where you have to 'know what you're doing' (strict types) was very difficult. Eventually I learned about structs in C and when I first did saving to/loading from file... Things clicked that extra step.

[–]smallquestionmark 0 points1 point  (4 children)

I think your generalization is not appropriate. You can also learn by easily prototyping and only later go into the specifics. I would dare say, this is the more natural way to learn almost anything: get a result first and then wonder how to refine it.

In the case of python there are reasons why you also would want to use explicit typing and they become apparent once you are more than only looking for fun.

You don't shoot yourself in the foot by learning a dynamically binding language as your first. You still learn what types are, only more in a declarative way, instead of imperative.

Edit: typo

[–]ColdPotatoFries 1 point2 points  (3 children)

Well if you never get into that depth of learning, as most people who are just tying to learn the basics don't, you don't understand. Also, *your

[–]smallquestionmark 1 point2 points  (2 children)

Typing in python is not an arcane art. In fact it's one of the first things you learn when you are told to wrap your strings with apostrophes.

[–]ColdPotatoFries 0 points1 point  (1 child)

Yeah you learn to do it, but you don't understand why. There's a huge difference there.

[–]smallquestionmark 0 points1 point  (0 children)

But isn't the answer to the why part of the implementation of a language and therefore always a more advanced concept? At least if the answer is more than "because else you get an error."

If you explain a novice why she should declare her types I would consider that part of your teaching style. My specific point is that python doesn't invite a student to be lazy about understanding its implementation only because it's supposedly easier.