this post was submitted on 05 Feb 2025
342 points (97.2% liked)

Greentext

4975 readers
1017 users here now

This is a place to share greentexts and witness the confounding life of Anon. If you're new to the Greentext community, think of it as a sort of zoo with Anon as the main attraction.

Be warned:

If you find yourself getting angry (or god forbid, agreeing) with something Anon has said, you might be doing it wrong.

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Gutek8134@lemmy.world 40 points 9 hours ago* (last edited 9 hours ago) (3 children)

My Java classes at uni:

Here's a piece of code that does nothing. Make it do nothing, but in compliance with this design pattern.

When I say it did nothing, I mean it had literally empty function bodies.

[–] ICastFist@programming.dev 2 points 4 hours ago

Mine were actually useful, gotta respect my uni for that. The only bits we didn't manually program ourselves were the driver and the tomcat server, near the end of the semester we were writing our own Reflections to properly guess the object type from a database query.

[–] boletus@sh.itjust.works 20 points 8 hours ago* (last edited 37 minutes ago)

Yeah that's object oriented programming and interfaces. It's shit to teach people without a practical example but it's a completely passable way to do OOP in industry, you start by writing interfaces to structure your program and fill in the implementation later.

Now, is it a good practice? Probably not, imo software design is impossible to get right without iteration, but people still use this method... good to understand why it sucks

[–] e8d79@discuss.tchncs.de 6 points 8 hours ago (1 children)

So what? You also learn math with exercises that 'do nothing'. If it bothers you so much add some print statements to the function bodies.

[–] Gutek8134@lemmy.world 1 points 4 hours ago

I actually did do that. My point was to present a situation where you basically do nothing in higher education, which is not to say you don't do/learn anything at all.