4 ms·
I've always felt like it was a bad first language because there's all of this type stuff going on under the hood that isn't really hidden from the user. I think
by jppittma 3y ago
I've always felt like it was a bad first language because there's all of this type stuff going on under the hood that isn't really hidden from the user. I think go/java are probably better first language because they're more explicit with the typing.
Java in particular, because the fact that it's so verbose and has so much boiler plate, I think, is actually good for a new programmer.
- version_five 3y agoWhy not C then? Java has more "just do this because it's the way it is". I think it depends on why someone is learning to program, generally I think python is fine for say a mechanical engineer that has to do some scripting, C is good for, as you say, understanding what's happening under the hood, exposing pointers in particular.
- jppittma 3y agoI think with C, learning how the pdp11 worked gets in the way of learning how to program. I think most people should eventually learn C, but control flow should come first, and java provides more guard rails. No `char *` and no segfaults.
- lenkite 3y agoThe array-pointer decaying magic in C requires too much mind-bending. Most of the standard library for string processing is insecure. No boolean types. No name-spacing. One-line if bugs (ridiculously common for beginners and even experts). I could go on and on. Frankly - I would have preferred to learn assembly as a first language rather than C in my college days.
- Kototama 3y agoNothing like a short class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } } to start a nice journey into programming, right?
- vitiral 3y agoYou forgot to declare the package name! How are you going to properly load the hello.world.example package?
- Kototama 3y agoAh ah :-) It has been so long I actually copied it from a website. But I had to look after your comment and Java can cope with no package declaration! https://stackoverflow.com/questions/2335211/what-is-the-default-package-in-which-my-classes-are-put-if-i-dont-specify-it https://stackoverflow.com/questions/2335211/what-is-the-defa...
- lenkite 3y agoDude, Java has changed. You don't need `public static void main` anymore. https://medium.com/@shwetha.hey/java-21-no-more-public-static-void-main-c90334d6d95e https://medium.com/@shwetha.hey/java-21-no-more-public-stati... Also you can do new { System.out.println("Hello, world!"); }
- roenxi 3y agoIn practice I assume Javascript is the leader language for onbording new people. The speed to go from learning-the-language to useful results has to be best in Javascript.
- abenga 3y agoEvery time I need to work in JavaScript (which happens only a few times a year), just getting build scaffolding to work is so very hard. The gulf from "you understand the language's syntax" to "you can build something useful following commonly-agreed conventions" is vast. Not to forget that these conventions significantly change every few months.
- lenkite 3y agoUse Deno. You don't need to deal with `package.json` and `node_modules`. You can have full programs in a single script that import their dependencies within the script. The build scaffolding can range from 0 to whatever you need. I actually returned to JS scripting after a long hiatus thanks to Deno. And now like the language a lot more.
- silent_cal 3y agoCouldn't disagree more. I don't know why programmers think there's merit in making things harder than they have to be. There's nothing wrong with learning about strong typing later on. Python is so much more readable and easier to understand than any strongly typed language.
- crabbone 3y agoThis is not about being "hard". Python is, actually very hard... except you don't know it well, and mistakenly think it's easy. You probably had never seen more than half of the functionality available in the "standard" library, i.e. you don't even know it exists, for example. Now, add to this that there isn't really one Python. There's a succession of similar languages, all called Python. But, can you tell in which version object of "module" type gained all the attributes of their alleged superclass -- "object"? How many facts like this one do you think exist? There are also different ways things can be hard. Some things are hard to understand once -- and then once you understand, no extra effort is required. You just go around knowing it. Some things could be hard because nobody can explain them to you, and you will be running up against the wall trying to figure them out. Some other things are hard because they are always in flux. You think you've understood them, but the next moment someone is pulling the carpet from under you, and you have to start understanding them all over again. I still remember my disappointment, for example, when after second semester of automata theory, we ended up constructing "mini machines" -- short sequences of instructions that could be combined to build bigger programs. And then we went straight to Java. There was no continuity. Nobody cared or even could explain how, if you wanted to build from the first principles could you get Java. The step between "mini machines" and Java was never explained. There was no explanation for why should Java have such and such feature, or what would have happened if it hadn't etc. People are masters of reconciling inconsistencies, and not in a good way. When something doesn't make sense, people will masterfully invent some cooked-up nonsense to replace the real explanation. And this is the case for most CS majors. When you ask them questions about basic things about their trade, what you hear back is some laughable excuse of an answer. We have several generations of programmers today who grew up with this nonsense, internalized it, made it into a cult. Python owes its popularity, in great part, to these generations of programmers with missing foundations, lacking ability of critical thinking which led to bizarrely distorted view of the world.
- phkahler 3y agoBoiler plate gets in the way of solving the problem you're writing code for. IMHO it's too much detail to force on someone new. There are reasons not to use python, but it's better to let people discover them than to try to explain it all up front.
- jppittma 3y agoIf you're just trying to hack something together and make it work, I'd agree that python is the best, even for somebody who's never written a line of code in their life. If you're trying to train somebody to be a software engineer, rather than just automating a particular data entry task as quickly as possible, I think boiler plate is good. It's better to force the details on the person at first than to have them be hidden, automatic, and mysterious forever.