I don’t think weakly- or dynamically-typed languages are a good thing to base computer science curriculum around. Yes, it’s “easier”. But you will genuinely have a FAR better understanding the language and the logic you’re writing in it if you work in the scope of strong and static typing - or, at least have linters that force you to (e.g. mypy for Python)
Comment on Java at 30: How a language designed for a failed gadget became a global powerhouse
kirk781@discuss.tchncs.de 3 weeks ago
Java was also my first introduction to programming as it was included in Computer Science in final year of school (at college, we did the trusty C).
I think they have replaced Java with Python now in schools because of the latter’s popularity and also because many would argue, Python is slightly easier to learn than Java.
gravitas_deficiency@sh.itjust.works 3 weeks ago
padge@lemmy.zip 3 weeks ago
The argument I agree with is that Python is the best language to learn if it’s your only language, and Java is the best first language if you’re going to learn others. The syntax from Java is shared across so many other languages and it forces you to learn about things like objects and types. You could make an argument for C or C++ but Java’s handholding is more beginner friendly imo
taladar@sh.itjust.works 3 weeks ago
Python isn’t really strict enough to be a good learning language and Java has too much accidental complexity that literally matters in no other language.
jaybone@lemmy.zip 3 weeks ago
First learn C, then learn C++, then learn Java. In that order, each will make you appreciate what the previous one lacks. From there, you should pretty much be able to learn anything.
HandMadeArtisanRobot@lemmy.world 3 weeks ago
Help. I’ve been stuck learning c++ for almost 10 years. :(
jenesaisquoi@feddit.org 3 weeks ago
You can’t learn C++. Some parts of it maybe.
MolecularCactus1324@lemmy.world 3 weeks ago
I learned C++ as my first language and it was a great way to understand the core issues of a programming language — like memory allocation, memory freeing, and the difference between memory addresses and the memory contents themselves. Java obscures these nuances to a degree, but Python is too friendly and makes it hard to understand them.
I believe if you learn C++ you can easily learn any other language. After C++, I learned Python, JavaScript, and Java in a few days each without formal instruction. If you learn Python first, you’re probably going to struggle learning those other languages because you haven’t grasped the lower level concepts yet and may never if you’re not in a formal setting that forced you to learn them.
No one disagrees that Python is easier, but if your goal is to get a foundation in programming that allows you to easily pick up other languages, you should start with C++.
pycorax@lemmy.world 3 weeks ago
Imo people should start with C first since it is a lot simpler than C++ while still providing a lot of what you mentioned. C++ adds a lot of things like name mangling, templates, L & R value references that can quickly make things a bit more daunting for beginners.
I also generally find error messages for C a lot more parsable for beginners than C++ ones.
jenesaisquoi@feddit.org 3 weeks ago
C++ is a monster. I’d suggest C instead to learn about these basic ideas.
MolecularCactus1324@lemmy.world 3 weeks ago
C++ has classes though and if you start with C and then try to go to other Object-oriented languages then you’ll be a little lost. But, by learning C++ first, you’re pretty much learning C at the same time, you just need to avoid using classes.
chakan2@lemmy.world 3 weeks ago
They did, but it makes me sad. Python is becoming the next JavaScript because of its ease of use.
The Java guys simply don’t understand how to code without the gang of 4 crutch to lean on.
gedhrel@lemmy.world 3 weeks ago
Some of the GoF patterns over-emphasise inheritance, but by-and-large, you don’t build large systems without either using or rediscovering software patterns, whether they’re OO, FP, or what-have-you.
atomicbocks@sh.itjust.works 3 weeks ago
Python is interpreted where Java is compiled. They aren’t going to be able to be used in the same cases all the time.
jenesaisquoi@feddit.org 3 weeks ago
Not true. They use the same model, executing compiled bytecode. It just feels like directly running a script because Python compiles it to bytecode on the fly, and because it is embarrassingly slow.
MrRazamataz@lemmy.razbot.xyz 3 weeks ago
In a first year computer science course at uni I can say they teach us Python, Java, and C, all with slightly different use cases.
kescusay@lemmy.world 3 weeks ago
Python is easy, but it can also be infuriating. Every time I use it, I’m reminded how much I loathe the use of whitespace to define blocks, and I really miss the straightforward type annotations of strong, non-dynamically typed languages.
masterspace@lemmy.ca 3 weeks ago
Most overrated language imho. I actually enjoy Java more.
sugar_in_your_tea@sh.itjust.works 3 weeks ago
You can annotate types in Python, and it’s actually pretty nice when used with Pyright/Pylance.
kescusay@lemmy.world 3 weeks ago
Oh, I know you can, but it’s optional and the syntax is kind of weird. I prefer languages that are strongly typed from the ground up and enforce it.
sugar_in_your_tea@sh.itjust.works 3 weeks ago
Python is strongly typed, it’s just not statically typed. Python with consistent type hinting is extremely similar to a statically typed language like C#.
JackbyDev@programming.dev 3 weeks ago
But nobody else does, and I need it more on code I am consuming than producing. In fact, many functions rely on being able to send various types for different behavior. Dynamic programming is crazy to me. It’s like guessing. I don’t know what type your code is accepting and I have to guess based on the name of read your code directly.
sugar_in_your_tea@sh.itjust.works 3 weeks ago
I have the opposite experience, a ton of libraries I use provide optional types, and the handful that don’t often have a good reason for it (e.g. numpy). Our projects at work have types almost everywhere, and it’s pretty nice to work with.
TerHu@lemm.ee 3 weeks ago
use bython, python with braces XD
kescusay@lemmy.world 3 weeks ago
Hasn’t been updated since 2018. Does it still work?
TerHu@lemm.ee 3 weeks ago
i honestly don’t know. i’ve read about it here and there but never actually tried it
Enkimaru@lemmy.world 3 weeks ago
Try ‘Nim’. It is Pythonic language with static typing.
rottingleaf@lemmy.world 3 weeks ago
I hated something about Python, and avoided it, until encountering Tcl which for me fulfills the same role that Pythons seems for many people, but Tcl is really much more pleasant. IMHO.
LedgeDrop@lemm.ee 3 weeks ago
Preach it! 🙌⛪