5 ms·
> Python’s increased dominance appears to be largely at the expense of smaller, more specialized, languages. It has become the jack-of-all-trades language—and t
by crims0n 3y ago
> Python’s increased dominance appears to be largely at the expense of smaller, more specialized, languages. It has become the jack-of-all-trades language—and the master of some, such as AI, where powerful and extensive libraries make it ubiquitous.
Python being described as a jack-of-all-trades and master of some is a really succinct way of explaining it's dominance. One of my kids is about old enough to start learning to program. At this point, I can't see a reason to teach her anything but Python.
- jppittma 3y agoI'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.
- pretext 3y agoNot in a position to advise anybody how to bring up their children, but I would focus on ideas, not languages. So for me Racket is evident choice in teaching how to program.
- candiddevmike 3y agoSeems like a good way to make someone not want to program. That's jumping into the deep end a little too fast, especially for kids. Early learning requires "easy wins", in my experience. code.org, sparkfun stuff, maybe even Factorio allow kids to experiment with learning programming constructs in a fun sandbox.
- crabbone 3y agoOne of, if not the most important aspect of learning anything that has a lasting effect is honesty between the teacher and the student. I couldn't with a straight face advise anyone to learn Python. It's just the absolute trash of a language in any aspect you choose. Playing stupid games with someone's ego and the ability to self-assess is a sort of insidious evil. Just to give you as an example, a story of one Polish naive artist who was led to believe he was a big deal by some newspaper publishing an article about him. It was in the 80s, I think, when the world went through an infatuation with naive art phase (again). Excited about the newly-earned fame, the guy applied to Krakow's art academy, and... was basically laughed out of it for not being a "conventional" good craftsman. He committed suicide short afterwards. In a less dramatic way, the other thing that comes to mind is the scene from Kung Pow! Enter The Fist, where the protagonist was "taught wrong, on purpose, as a joke". I cannot imagine telling someone who knows nothing about programming that Python is a good way to do anything or to learn anything. It's just a pile of trash made popular by the network effect. If anything, anyone with a drop of common sense should work hard to prevent the next generation from using it.
- phkahler 3y ago>> At this point, I can't see a reason to teach her anything but Python. Agreed. If you start in any other language, you'll be spending less time teaching programming and more time teaching the language.
- apricot 3y agoI started my son on Python but he switched to Java because that's what you need to write Minecraft mods. That lasted for two or three years. Now, thanks to Advent of Code, he's coming back to Python again, as well as assembly language (he did the Nand to Tetris course and is very interested in designing his own CPU on FPGA). Eventually I'm going to show him Scheme and SICP.
- vitiral 3y agoLua is also a good choice as a first language because it's a super small well-defined language that let's you transition easily to JavaScript (which has a similar object model but is a dumpster fire) or python. Lua also integrates with C extremely well, so it can help with that transition.
- crabbone 3y agoPython is not a master of anything... just popular garbage. The reason not to teach Python is the same reason you'd use for preferring home-cooked meal to McDonald's take-out. And I'm saying it as a parent who has to compete with this food enterprise... I think, I'd be a horrible parent if I didn't allow any McDonald's food ever, but I certainly don't encourage it. Similarly with Python: if you want to give your child something good: there are plenty of options that are better than Python. But, Python will be the inevitable garbage they will have to face due to its popularity. It would be counter-productive not to prepare the next generation to deal with it.
- sixstringtheory 3y agoAs someone who expounds often on the merits of statically typed languages for production code, I couldn’t disagree more with the sibling comments discouraging teaching children programming with Python. I think it’s the best choice. I remember when I was a TA teaching CS 101 with C++. People constantly stumbled with types and compilation. Just the concept of storing a value in a variable and retrieving it again was too much for some people. That is where Python will shine for youngsters. Variables, control structures, functions. I bet they will get to the point on their own when they’re like “what’s the deal with numbers and letters being different”? and then you can take their hand and say “grasshopper, you are ready to learn about C/integers/ASCII/floating point”.
- machiaweliczny 3y agoYeah but you need online IDE to have sandboxing if you try to build something more fancy as global deps by default bite so hard in python. I like JS for it’s node_modules solution. In python you end up with libs conflicits and segfaults that you cannot debug unless you are deliberate about deps management.