this post was submitted on 25 Nov 2023
115 points (97.5% liked)

Technology

59106 readers
3391 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related content.
  3. Be excellent to each another!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be removed

Approved Bots


founded 1 year ago
MODERATORS
 

An After-School Program Teaches Teens Java and Python::The students also learn how to design board games and video games

all 41 comments
sorted by: hot top controversial new old
[–] Linkerbaan@lemmy.world 12 points 11 months ago (5 children)

PUBLIC STATIC VOID MAIN STRING ARGS

[–] onlinepersona@programming.dev 2 points 11 months ago

INT MAIN INT ARGC CHAR POINTER ARGV ARRAY BODY

[–] floridaman@lemmy.blahaj.zone 1 points 11 months ago

you know how it goes

[–] WindowsEnjoyer@sh.itjust.works 1 points 11 months ago (1 children)

Say it with me:

PUBLIC STATIC VOID MAIN STRING ARGS

[–] ultra@feddit.ro 1 points 11 months ago

PUBLIC STATIC VOID MAIN STRING ARGS

[–] eerongal@ttrpg.network 1 points 11 months ago (1 children)

As of java 21, you can actually just use:

void main()

[–] morrowind@lemmy.ml 2 points 11 months ago

You'll definitely get to use Java 21 in whatever job you get.

[–] bionicjoey@lemmy.ca 1 points 11 months ago

It feels like some arcane spell when you first learn it, but once you are familiar with Java, each token in that declaration feels totally justified. Like yeah, the args are an array of strings. Yeah, the main function needs to be static and public. Yeah, it doesn't return anything inside the JVM, so it's void.

[–] mothattack@lemmy.ml 9 points 11 months ago

The world can be so cruel.

[–] Hovenko@iusearchlinux.fyi 6 points 11 months ago

“Python::The” That looks like Perl tho.

[–] pivot_root@lemmy.world 3 points 11 months ago (1 children)

Back when I was in school, corporal punishment was the norm. I would still prefer that over Java.

[–] Fades@lemmy.world 4 points 11 months ago (2 children)

We get it, you have no idea what modern Java looks like

[–] ____@infosec.pub 5 points 11 months ago (1 children)

I know exactly what modern Java looks like, and it could be beautiful. But… legacy cruft and lazy devs make it painful. And tech debt, let’s be honest.

I’d view a greenfield project rather differently, but those are unicorns.

[–] pivot_root@lemmy.world 2 points 11 months ago

I’d view a greenfield project rather differently, but those are ~~unicorns~~ written in Kotlin.

[–] pivot_root@lemmy.world -1 points 11 months ago (3 children)

I get it, you have no idea what trying to optimize around an ever-changing JIT recompiler looks like

[–] kaffiene@lemmy.world 2 points 11 months ago

It looks like something that doesn't happen

[–] Valmond@lemmy.mindoki.com 0 points 11 months ago (1 children)

Found the guy thinking java can be as fast as C/C++

[–] pivot_root@lemmy.world 1 points 11 months ago (1 children)

The just-in-time compiler isn't bad, but the rest of it is. An optimized hot loop has the potential to emit better instructions than a C/C++ compiler not using PGO, but you're never going to see that in any real workload.

If you could rip out/avoid the garbage collector, give it the ability to use escape analysis to avoid heap-allocating every single object, and prevent it from implicitly making every function virtual, then maybe. But at that point, you might as well just a different language.

[–] Valmond@lemmy.mindoki.com 1 points 11 months ago (1 children)

Ha I love it when I'm right 😁😉

[–] pivot_root@lemmy.world 1 points 11 months ago (1 children)

There's a difference between the JIT being able to emit better native code than an unguided compiler, and the language being as performant as another language. Java is never going to be as fast as C or C++, and that's something you can blame its design for.

[–] Valmond@lemmy.mindoki.com 2 points 11 months ago

They traded speed for safety, that's why, not something right or wrong that you should "blame" anything for IMO.

[–] onlinepersona@programming.dev 2 points 11 months ago (1 children)

Kids in Asia are way ahead of that. Some countries have had programming on their curriculum for more than a decade

[–] realharo@lemm.ee 1 points 11 months ago* (last edited 11 months ago) (1 children)

I had programming (Pascal) in school in a random-ass country in Europe 20 years ago (I was like 14).

This has been widespread all over the world for a long time.

[–] onlinepersona@programming.dev 1 points 11 months ago

At 14 I could barely get a for loop and if statement working properly. Pascal then VB for me, once a week for 2 years. Only really started programming in uni. Some Asian countries start in primary school at as early as 3 years old. It's as important as languages to them. By 14 they're already doing robotics and writing social media clones.

We are quite far behind in the west.

[–] netchami@sh.itjust.works 1 points 11 months ago (2 children)

Java... I started with Java myself when I was a teen. It's not a good idea.

[–] aluminium@lemmy.world 7 points 11 months ago* (last edited 11 months ago) (1 children)

I think Java is still a good language for beginners. The tooling around it is really good and it catches lots of issues at compile time.

[–] netchami@sh.itjust.works 0 points 11 months ago (3 children)

I'd recommend Python or JavaScript to beginners. Also, Java is dying out right now.

[–] aluminium@lemmy.world 8 points 11 months ago (2 children)

I seriously don't get why Python is so popular for learners. Its a weird ass very isolated language syntactically. The libraries for it are great but still.

[–] netchami@sh.itjust.works 2 points 11 months ago

JavaScript sometimes can be weird as hell. That's why I prefer Python. I don't know, for me it seemed logical from the beginning. Java definitely ain't better.

[–] Linkerbaan@lemmy.world 2 points 11 months ago

Because it dared to change the shitty syntax of bad syntax languages so humans can actually read it.

[–] bionicjoey@lemmy.ca 1 points 11 months ago (2 children)

"Java is dying" is what people who've never actually worked as a dev for a big company think.

[–] netchami@sh.itjust.works 1 points 11 months ago

The company I work at is currently replacing all of their legacy Java shit with Go

[–] MonkderZweite@feddit.ch 1 points 11 months ago

You say legacy code?

[–] FourThirteen@lemmy.world 0 points 11 months ago* (last edited 11 months ago)

Java is absolutely not dying... unfortunately. Billions of people depend on spaghetti code written by corporations every day. I think Java will be the next COBOL. It won't die and it's unfortunate.

[–] kaffiene@lemmy.world 4 points 11 months ago

Java is a great language. Still one of the most used languages in the world. Ditto python

[–] soulfirethewolf@lemdro.id 1 points 11 months ago (2 children)

Java is a good language if you're a beginner, but if you've already coded before in other languages, it's going to suck.

[–] sebsch@discuss.tchncs.de 2 points 11 months ago

Especially for beginners its a bad language. You have the understand artificial concepts about classes, objects, abstract states before you re able to learn the important stuff like if/else, looping etc pp.

I would always give beginners a language which is at least in their way as possible.

[–] realharo@lemm.ee 1 points 11 months ago* (last edited 11 months ago)

They should've just picked Kotlin.

It also encourages good basic habits, such as not making a variable mutable unless you specifically need to (val is way more common than var, the IDE makes them very visually distinct).

[–] pineapple_pizza@lemmy.dexlit.xyz 0 points 11 months ago (1 children)

Why after school? I was able to take programming classes in highschool in 2010. In the us

[–] jasondj@ttrpg.network 1 points 11 months ago

2002, but it was Visual Basic. I got a fucking C in that class because I spent more time helping other kids figure out the assignment than spending time putting worthless clutter in my interfaces to the teachers standards.

Oh well. At least I learned how to write a GUI to track the hackers IP address.