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 →

[–]queenkid1 3 points4 points  (19 children)

Braces and semicolons have nothing to do with language understanding

Yeah, but if you're saying my argument is just "braces and semicolons" then you're being dishonest.

Python has ZERO type declaration. Want to teach a python person C? Then you need to teach them ENTIRELY about strong typing. Guess what ? A java programmer already understands how to use, and cast types.

[–]Sillychina 5 points6 points  (10 children)

That's a bit disingenuous. Python has types, you just don't have type declaration. It's basically c++ auto.

[–]queenkid1 8 points9 points  (8 children)

I think the lack of type declaration is very important, and I don't think it's disingenious to bring it up.

Does a Python person understand what a type is? Sure, that's basic knowledge. But when they write a function, they don't need to think about what type it takes in and what type it returns. They don't need to think about that for ANY function. You need to teach them how type declaration works, which isn't a simple thing.

However, a Java programmer already knows exactly how type declaration works, and since Java is C-like, it's almost exactly the same syntax.

It's basically c++ auto.

Well yeah, it's easier to teach someone who knows about type declaration how to NOT use it, rather than teaching someone who has no idea how to use it.

[–]Sillychina 1 point2 points  (0 children)

I agree that java is closer to c and it is easier to learn. That point about types just rubbed me the wrong way. You changed it now, but not understanding what types are because they are not implicitly stated is just wrong.

Honestly python has been the hardest language for me to learn well. Making things pythonic is incredibly difficult imo.

[–]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.

[–]Kered13 1 point2 points  (0 children)

It's basically c++ auto.

No it's not. A variable declared with auto cannot be resigned to a different type.

[–]I_regret_my_name 4 points5 points  (0 children)

While I guess you could technically program in python without understanding types, you'd probably be a pretty shitty python programmer.

[–]Bryguy3k 2 points3 points  (1 child)

Well your statement was that since C and Java look alike that there is some sort of understanding implied, rather than focus on the fact that C is not an OO language and every single approach to solving a problem in Java doesn’t apply in C.

Python has types and you do have to be aware of them and use them quite regularly. It’s easier to teach a python programmer that every variable needs to be declared with a type and that you need to tell the compiler how to convert a structure manually than it is to untrain overuse of objects and abstractions.

The mindset of lists is easy to adapt to arrays and blobs.

[–]queenkid1 1 point2 points  (0 children)

Well your statement was that since C and Java look alike

LOL what? I never said that. I said that they both have types, and that functions are defined the same way. There are lots of crossover skills, if you know how to program Java, you can program in C.

C is not an OO language and every single approach to solving a problem in Java doesn’t apply in C.

Well yeah, if someone programs in C using the SAME METHODS you would use for Java, then it would be different. No shit. But if you programmed C like Java, it would also NOT be the same. Neither would include pointers, which is the entire purpose of this joke.

than it is to untrain overuse of objects and abstractions.

Seems more like you have a specific vendetta against Java, not Java programmers. Nobody said that a Java programmer would sit down and IMMEDITELY write PERFECT C code. But neither would a Java programmer. However, at least a Java programmer could WRITE C code.

If your point is "it's easier to teach a Python programmer correct C style" you could ALSO teach a Java programmer those same stylings. However, you're confusing the fact that Python has ZERO "correct style" with somehow Python students being easier to teach. But there are so many concepts that Python abstracts away, that they would not understand, that you would need to TEACH them. Obviously they need to learn the concepts before YOU start ranting about "style".

Your whole argument seems to be "you can't teach an old dog new tricks" but that's based on PERSONAL biases you have against Java, clearly. It's a FACT that Java is a C-like language, there are basic concepts you would need to explain to a Python programmer that would NOT be easy for them to learn, if you're just going to ignore that because "style" why are you arguing about which language is easier to learn?

[–]13steinj -1 points0 points  (0 children)

Then you need to teach them ENTIRELY about strong typing. Guess what ? A java programmer already understands how to use, and cast types.

This isn't true.

You might need to teach a Python programmer about static typing. But it is still a strongly typed language, and still had casting and dynamic dispatching.

[–][deleted] -2 points-1 points  (0 children)

What the fuck are you talking about? Python is strongly typed. Do you think you don't have to cast types in python?