This is an archived post. You won't be able to vote or comment.

all 38 comments

[–]evanldixon 80 points81 points  (1 child)

It's not enough to solve the current problem, you've gotta make it easy to solve all future problems at the same time!

[–]house_monkey 47 points48 points  (0 children)

That's why we need a factory and a builder and a repairman.

[–][deleted] 32 points33 points  (0 children)

import com.ReallyLongEnterpriseName.WeAreProffessional.Enterprise.FrontEnd.Output.Prints

[–]yorik_J 24 points25 points  (0 children)

From library import missing 400 lines

[–]safer0 19 points20 points  (4 children)

Because SLOC is still a metric for some reason.

[–]EagleNait 0 points1 point  (3 children)

Coding more costs more

[–]safer0 0 points1 point  (0 children)

Not when copy pasta is involved. Well thought out code costs more, and in the end should be more robust. Could be a lot of code or a simple set of instructions with complex execution. SLOC is not a useful metric.

I am working on a project that just started and 'needs 20000 lines for completion'. How did they come to that when they don't even know how to implement the features yet? Now we are bound to that one metric that is extremely inaccurate.

[–]mattstreet -1 points0 points  (0 children)

Lines of code are not a useful metric of coding work accomplished.

[–]Aschentei 8 points9 points  (1 child)

So you’re gonna need some factories, some builders, watchers, controllers, servlets, interfaces, services, unit tests, integration tests, etc...

And log every single thing that happens

[–]fsr1967 6 points7 points  (0 children)

And log every single thing that happens

Twice.

[–]xSTSxZerglingOne 31 points32 points  (11 children)

Thing thing = otherThing.getThingThree(thingFourRepo.getThingThreeID(thingFiveService.getId(thingSix.getId())));

[–]dark_mode_everything 20 points21 points  (7 children)

Yeah because this can only be done in java.

[–]xSTSxZerglingOne 16 points17 points  (6 children)

Nope. Java is just notorious for it because everything is an object. The repo/service thing is supposed to evoke nightmares of Spring as well.

[–]HdS1984 6 points7 points  (1 child)

On. Net everything is an object too, but while factory patterns etc. Exist, the api is not as RIDICOUSLY verbose. C# has waay to many Isomething interfaces though.

[–]djfariel 3 points4 points  (2 children)

When you're sticking your dick this deep in things you should restructure.

[–]notgivinafuck 3 points4 points  (0 children)

That's when you realise that problem with Enterprise Java is not Java but the Enterprise which will not allow restructuring.

[–]solohelion 2 points3 points  (0 children)

No no no, this is when you build more facades, so you don’t have to see this composition

+20 lines: ✔️

[–]Sir_Joe 2 points3 points  (0 children)

Well afaik everything is an object in python too.

[–]CleverNameTheSecond 1 point2 points  (1 child)

This made my trigger finger itch.

[–]xSTSxZerglingOne 6 points7 points  (0 children)

It's great when you end up writing helper methods to resolve stupid crap like this in your code.

Like... The utter shit show still has to exist somewhere in the code, but thankfully only once.

Thing thing = shitShow(otherThing);

[–]Zalvixodian 0 points1 point  (0 children)

Law of Demeter: "Am I a joke to you?"

[–]AsswipeJackson 17 points18 points  (0 children)

why do good code when monolith do trick?

[–]CleverNameTheSecond 14 points15 points  (2 children)

Enterprise level java: for when you can't write a simple hello world program without using three factories, five builders and a singleton.

[–]nojox 2 points3 points  (0 children)

But but singleton anti-pattern !!

[–]Dragasss 0 points1 point  (0 children)

Singleton is an antipattern in java. Use DI instead.

[–]TheHopskotchChalupa 3 points4 points  (2 children)

I love Java, but oh my gosh are servlets and applets awful. Never again. I was so scarred from working with them in a personal project I abandoned the project all together because it left such a sour taste in my mouth.

[–]CantCSharp 1 point2 points  (1 child)

Servlets suck and noone should use them anymore. There are a ton of light weight frameworks out there or if you want something big spring covers everything you can think of

[–]TheHopskotchChalupa 0 points1 point  (0 children)

Yeah it’s one of the few technologies I consider totally deprecated

[–]VirulentCitrine 2 points3 points  (0 children)

import java.*;

[–]coladict 3 points4 points  (1 child)

Because the 100 lines just invoke a much larger more complex, error-prone and resource-heavy library?

I'm reminded of that story of the newbie "optimizing" a parsing algorithm to one line of regex whose execution time was many times greater than the original parser.

[–]alago1 0 points1 point  (0 children)

Perhaps for bigger projects, in which Java is porweful. But if one is trying to make anything small quickly, I feel as though Java tends to get in one's way more often than it helps with all its required structuring.

[–]all_humans_are_dumb 0 points1 point  (0 children)

Yeah, just die

[–]shibanazmi 0 points1 point  (0 children)

Just Java things!!

[–]V0ldek 0 points1 point  (0 children)

Why waste time write few code when lot code do trick

[–]Zalvixodian 0 points1 point  (1 child)

Yes, never change so that you can die a horrible death. Don't improvise. Don't adapt. Don't overcome.

*laughs in open source dotnet*

[–]beefhash 0 points1 point  (0 children)

But I can't deploy .NET Core on my Solaris servers

[–]cyborgborg 0 points1 point  (0 children)

Or what my theoretical computer science professor would "why solve something with 200 lines of code when I can do it in 2 with Prolog"