1288
top 50 comments
sorted by: hot top controversial new old
[-] drew_belloc@programming.dev 150 points 2 years ago

It's time to show off my java hello world with 7 errors on line 34

[-] elvith@feddit.de 17 points 2 years ago

I don't know what I did wrong, but the bug must be somewhere in HelloWorldExampleClassForTutorialBuilderFactory.HelloWorldExampleClassForTutorialBuilderFactory(StringBuilderFactory myHelloWorldExampleClassForTutorialStringBuilder, int numberOfTimesToDisplayHelloWorld)

[-] AlmightySnoo@lemmy.world 106 points 2 years ago* (last edited 2 years ago)

I know the guy meant it as a joke but in my team I see the damage "academic" OOP/UML courses do to a programmer. In a library that's supposed to be high-performance code in C++ and does stuff like solving certain PDEs and performing heavy Monte-Carlo simulations, the guys with OOP/UML background tend to abuse dynamic polymorphism (they put on a pikachu face when you show them that there's also static polymorphism) and write a lot of bad code with lots of indirections and many of them aren't aware of the fact that virtual functions and dynamic_cast's have a price and an especially ugly one if you use them at every step of your iterative algorithm. They're usually used to garbage collectors and when they switch to C++ they become paranoiac and abuse shared_ptr's because it gives them peace of mind as the resource will be guaranteed to be freed when it's not needed anymore and they don't have to care about when that is the case, they obviously ignore that under the hood there are atomics when incrementing the ref counter (I removed the shared pointers of a dev who did this in our team and our code became twice as fast). Like the guy in the screenshot I certainly wouldn't want to have someone in my team who was molded by Java and UML diagrams.

[-] ForegoneConclusion@lemmy.world 77 points 2 years ago

Depends on the requirements. Writing the code in a natural and readable way should be number one.

Then you benchmark and find out what actually takes time; and then optimize from there.

At least thats my approach when working with mostly functional languages. No need obsess over the performance of something thats ran only a dozen times per second.

I do hate over engineered abstractions though. But not for performance reasons.

[-] declination@programming.dev 31 points 2 years ago

You need to me careful about benchmarking to find performance problems after the fact. You can get stuck in a local maxima where there is no particular cost center buts it’s all just slow.

If performance specifically is a goal there should probably at least be a theory of how it will be achieved and then that can be refined with benchmarks and profiling.

[-] CanadaPlus@lemmy.sdf.org 14 points 2 years ago* (last edited 2 years ago)

Writing the code in a natural and readable way should be number one.

I mean, even there it depends what you're doing. A small matrix multiplication library should be fast even if it makes the code uglier. For most coders you're right, though.

[-] Dohnakun@lemmy.fmhy.ml 7 points 2 years ago* (last edited 2 years ago)

Even then you can take some effort to make it easier to parse for humans.

load more comments (3 replies)
load more comments (1 replies)
[-] magic_lobster_party@kbin.social 34 points 2 years ago

I think many academic courses are stuck with old OOP theories from the 90s, while the rest of the industry have learned from its failures long time ago and moved on with more refined OOP practices. Turns out inheritance is one of the worst ways to achieve OOP.

[-] fidodo@lemm.ee 20 points 2 years ago

I think a lot of academic oop adds inheritance for the heck of it. Like they're more interested in creating a tree of life for programming than they are in creating a maintainable understandable program.

[-] einsteinx2@programming.dev 12 points 2 years ago

That’s the problem, a lot of CS professors never worked in the industry or did anything outside academia so they never learned those lessons…or the last time they did work was back in the 90s lol.

Doesn’t help that most universities don’t seem to offer “software engineering” degrees and so everyone takes “computer science” even if they don’t want to be a computer scientist.

load more comments (4 replies)
load more comments (1 replies)
[-] wolf@lemmy.zip 17 points 2 years ago

I fully agree about the damage done at universities. I also fully agree about the teaching professors being out of the game too long or never having been at a level which would be worth teaching to other people. A term which I heard from William Kenned first is 'mechanical sympathy'. IMHO this is the big missing thing in modern CS education. (Ok, add to that the missing parts about proper OOP, proper functional programming and literally anything taught to CS grads but relational/automata theory and mathematics (summary: mathematics) :-P). In the end I wouldn't trust anyone who cannot write Assembler, C and knows about Compiler Construction to write useful low level code or even tackle C++/Rust.

[-] Dohnakun@lemmy.fmhy.ml 6 points 2 years ago

OOP/UML courses

Luckily, i had only one, and the crack who code-golfes in assembler did the work of us three.

load more comments (3 replies)
[-] Coreidan@lemmy.world 67 points 2 years ago* (last edited 2 years ago)

This thread reminds me that most “developers” are terrible and don’t take the time to understand the language.

All of these Java developers you guys hate is the result of schools pushing out idiots. It’s not the language but rather the type of people you hire. These people will suck at writing in any language regardless of what order they try.

[-] cloudy1999@sh.itjust.works 7 points 2 years ago

Agreed, good tools can be used badly. Over the years I've written Java, C++, and PHP professionally, and I've seen excellent and horrible impls in each. Today, I mostly use Java and this thread is reminding me that I need to learn a new for-fun language.

[-] loutr@sh.itjust.works 6 points 2 years ago

Learn kotlin, it's awesome and runs on literally everything.

load more comments (2 replies)
[-] TrismegistusMx@lemmy.world 65 points 2 years ago* (last edited 2 years ago)

When I was in the military, the shooting instructors said they preferred training females because they haven't been trained poorly by somebody else.

EDIT: Designating recruits as male and female is the way the military does things. I don't use the terms male and female when referring to groups of humans. I felt the need to clarify since somebody already took offense.

[-] Kryomaani@sopuli.xyz 27 points 2 years ago

they preferred training females

It's "women".

[-] TrismegistusMx@lemmy.world 19 points 2 years ago
[-] Kryomaani@sopuli.xyz 6 points 2 years ago* (last edited 2 years ago)

“They said”

If only there was some generally agreed upon symbol to denote direct quotes as opposed to paraphrasing an idea in your own words. If only...

[-] TrismegistusMx@lemmy.world 35 points 2 years ago

If only there were fewer dickheads looking for a fight online. If only.

[-] Coreidan@lemmy.world 14 points 2 years ago

You sound like a miserable person

[-] Kryomaani@sopuli.xyz 6 points 2 years ago

I'd rather sound miserable than incel.

[-] Coreidan@lemmy.world 10 points 2 years ago

Really? You sound both miserable and incel. You failed.

[-] BigBootyBoy@sh.itjust.works 8 points 2 years ago

Go back to reddit

[-] JackGreenEarth@lemm.ee 8 points 2 years ago

I don't understand what you're saying

load more comments (1 replies)
[-] ScrimbloBimblo@lemmy.dbzer0.com 12 points 2 years ago

You've obviously never been in the military, because it's definitely "females".

[-] Kryomaani@sopuli.xyz 6 points 2 years ago* (last edited 2 years ago)

I'm from a country with mandatory conscription for men, so yes, I've been in the military and I've seen the misogyny (among countless other varieties of bigotry) rampant in that system from front row seats. We had a handful of female volunteer conscripts, as well as one of my NCOs was a woman, and it was blatantly obvious they were not recieving the same treatment as the majority of us who were men (and not in a good way, if there was any room for confusion).

Experiences like that are among the key reasons I'm not happy to see people keep perpetuating that kind of behavior, especially in other traditionally male-centric contexts like the IT industry and even here on this forum.

[-] ScrimbloBimblo@lemmy.dbzer0.com 8 points 2 years ago* (last edited 2 years ago)

Whether or not you personally agree with the military's choice of language is not relevant. You're assuming the trainer agrees with your political views, but you weren't there, so you have no idea what they said or didn't say.

[-] grandkaiser@lemmy.world 9 points 2 years ago

Nah. In the military, you aren't "men and women" you are "soldiers" (or sailors, Marines, or airmen). If you are referring specifically to a specific gender such as a "female" soldier, then that's what you call them.

No one says "women soldiers" except maybe a civilian.

[-] Kryomaani@sopuli.xyz 7 points 2 years ago

No one says “women soldiers” except maybe a civilian.

And I'm not telling you to, stop putting words in my mouth. Female as an adjective is fine, "female soldier" is fine, calling a group of human women "females", as in a noun, is demeaning and incel lingo.

load more comments (10 replies)
[-] nxtsuda@lemmy.world 26 points 2 years ago

OOP does things to a person

[-] cosmicboi@lemmy.world 8 points 2 years ago

a PersonImpl, you mean? :P

[-] rustydrd@lemmy.world 23 points 2 years ago

I, too, would like the winter winds to teach me about Rust.

[-] flashgnash@lemm.ee 20 points 2 years ago

Man if I were in the US I'd apply for that job in a heartbeat, looks like that was written by a head dev who actually knows what he's talking about rather than some recruiter

[-] deadly4u@lemmy.ca 14 points 2 years ago

That's really interesting. Maybe it's like @nxtsuda@lemmy.world said. For a lot of folks, OOP was the way we learned and operated for years

Could they have just asked it differently? Or do they just have Java hate.

[-] SpaceNoodle@lemmy.world 25 points 2 years ago

It's obviously an embedded role. Java and its developers are notorious for throwing memory and compute usage out the window.

load more comments (1 replies)
[-] Sanchokan@kbin.social 9 points 2 years ago

Ool about it. Where does the java hate come from?

[-] serinus@midwest.social 48 points 2 years ago

OOP is fine. It's particularly Java culture that's terrible.

I never want to see the word Factory in a class name ever again.

When a Java dev writes in any other language, you can tell. Too many layers of abstraction is a key indicator. They make simple problems complex.

I once inherited a C# website project from a Java dev. I couldn't even figure out how to modify the CSS. And I'm a C# dev.

[-] magic_lobster_party@kbin.social 25 points 2 years ago

Factories can be good in moderation. If you make factories for every class, maybe you need to rethink your practices.

load more comments (2 replies)
[-] topperharlie@lemmy.world 7 points 2 years ago

lol, last time I switched jobs some years ago I did the same but in the other side, I had a side small section with level of expertise on programming languages and explicitly added java with 1/10 to send a clear message xD

(is not that radical giving that I've been a embedded/graphics programmer most of my career, but still, funnier than not mentioning it)

[-] shotgun_crab@lemmy.world 6 points 2 years ago* (last edited 2 years ago)

I've seen horrible messes made in all of the languages listed above, it doesn't matter anymore

load more comments
view more: next ›
this post was submitted on 16 Jul 2023
1288 points (100.0% liked)

Programmer Humor

34106 readers
78 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS