4 ms·
If you want to make it easy for high schoolers, just don't use java in the first place...
by greatgib 3y ago
If you want to make it easy for high schoolers, just don't use java in the first place...
- franga2000 3y agoHaving learned Java in high school and later taught Java, Python and C++ to high-schoolers, things have improved greatly in Java. The days of memorizing the entire BufferedReader try-catch snippet are over. The new file and stream APIs are almost as clean as in Python and making GUIs (Swing for basic and JavaFX for advanced) is even easier than Tk in Python. For me, it boils down to a choice between typed and "non-typed" languages, where the best typed option is Java and the best "non-typed" are Python or maybe JavaScript (NodeJS). Everything else is some combination of not mainstream enough, not powerful enough out of the box or requires too much knowledge to get started. Java and Python read like English, have most of what you'll need included and are very useful languages for students to get their first internships/summer jobs working with.
- rootlocus 3y agoWe learned borland pascal and borland c in high school. Java is perfectly fine.
- 62951413 3y agoDon't get me wrong, I miss Turbo Vision-based UIs and an IDE that fits onto a single floppy disk. But the JVM is a professional tool to begin with. So if you cannot start with a toy such as golang or python at least go with Kotlin. Borland Pascal already had reasonable static types, classes, pointers, modules with a public API, and blinding compilation speed in the early 90s. All the basic building blocks to grok. Golang seems to be the closest modern-day approximation.
- bedobi 3y agoI went to a university where Java was the main language for most of the basic programming courses I've been making a living coding in Java for 10+ years I'm a strong believer in types etc etc I still don't think Java is a great language to teach programming lol too much pointless boilerplate and abstraction to achieve the simplest things lots of footguns and objectively bad standard practices built into the language and the native libraries to me Python and Kotlin seem like probably better choices (though they too have massive flaws)
- esafak 3y agoWhat's Kotlin's massive flaw?
- bedobi 3y agoTo me the whole point of Kotlin is fixing all the things that are wrong with Java lol But idiomatic Kotlin is still too close to Java, they call it "direct programming style" and it's basically already obsolete Null safety is great but the way they've implemented it with weird syntax like ? and ?.let is not great, it would have been a lot better to just have a regular Maybe type in the native library from the start. Like sure the nullable type is in some ways functionally equivalent, but it doesn't implement map, flatMap, applicative etc like a Maybe does, and when it behaves like it does, it's mostly kind of by accident, not by any real understanding of those operations (and, fatally, it's completely disconnected from map, flatMap etc on lists etc - those should be interfaces that everything that can be mapped, flatmapped etc on implements, not methods that get hurr durr added here and there, sometimes as a regular method called map, sometimes built into the compiler called let) They've completely dropped the ball on error handling - they don't even know themselves whether the language or people using it should use sealed classes, exceptions or their shitty Result class (which, again, this is a solved problem, they could have just included Maybe, Either, Try etc in the native library from the start) Coroutines and structured concurrency are powerful but their API is so extremely confusing and full of footguns that virtually no codebase using them ever uses them correctly to reap the benefits I could go on - don't get me wrong, I love a lot about Kotlin and it's a massive massive improvement on Java but it's not a great language unless you run it with Arrow and learn to completely sidestep large parts of the language (just like you had to do with Java)
- shadowgovt 3y agoI've written enough Java at this point to think of it as the assembly of OOP languages. You can write code in it, but in industry almost everything I see is basically a DSL built out of annotations that tries as hard as it can to not involve writing actual Java. When more of your application is annotations than lines of Java code, the language is probably a bad fit for the problem domain.
- shadowgovt 3y agoI learned assembly in high school, and programmed my first FRC machine in NBASIC (a variant of BASIC built specifically for the robot controller back in the day that, among its other delightful quirks, had if statements that were only allowed to be followed by a label and no else clause). Java is "fine" in the sense that NBASIC was "fine." There's definite room for improvement in matching the abstraction to the problem domain.
- bvisness 3y agoThe only officially supported languages for the competition are C++, Java, and LabVIEW. When those are your educational options...you stick with Java. (We've now switched to Lua, integrated with the official C++, but it's a lot more work behind the scenes.)
- hgsgm 3y agoIf it is that flexible, can you have a C++ program that runs a python interpreter as a module?
- mcv 3y agoWhy not Python? I thought that was the popular language for learning these days. My son gets quite a bit of Python in school.
- heffer 3y agoPython is slated to become a choice for the 2024 season: https://wpilib.org/blog/bringing-python-to-frc https://wpilib.org/blog/bringing-python-to-frc
- ralphc 3y agoWhat's the hardware/OS stack you have for the autonomous part? Can you go wild and use unsupported software as long as it fits in the official hardware?
- bvisness 3y agoWe can use whatever software we want as long as we use the specified hardware (the NI roboRIO), FIRST's latest firmware, and comply with the match system and safety systems that enable and disable the bot at different times. Many teams have been using a community Python alternative called RobotPy for a long time despite it not being officially supported and FIRST had no problem with it.
- shadowgovt 3y agoThe largest constraint on this (in the context of the FIRST competition) is that community matters at least as much as technology. If you're using Java (or C++ or LabVIEW, to a lesser extent), you at least have a hope of posting to a forum and going "Hey, we think our robot should be doing X and it's doing Y, here's our code, any insights?" If you use <bespoke language X> and your own custom bindings, you're on your own.