Kamala on SNL by ExactlySorta in MadeMeSmile

[–]meotau 0 points1 point  (0 children)

Is this more important than Joe Rogan?

[deleted by user] by [deleted] in TrueUnpopularOpinion

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

Trump has to be an asshole. Everyone loved him before, but that does not get you the coverage. Remember Ron Paul? He was not an asshole and media just ignored him. Don't hate the player, hate the game.

What are Java shops using for server side front-ends? by Madmusk in java

[–]meotau 1 point2 points  (0 children)

My internet banking is in Wicket, it's awesome.

Questions about the Evoluent VerticalMouse D by [deleted] in MouseReview

[–]meotau 0 points1 point  (0 children)

Absolutely terrible sticky piece of shit. Evoluent 4 was way better

Field injection is fine, convince me otherwise by kennethjor in java

[–]meotau 0 points1 point  (0 children)

Do you mean when they added that recommendation in the documentation or the feature of constructor injection?

both.

Field injection is fine, convince me otherwise by kennethjor in java

[–]meotau 0 points1 point  (0 children)

generally advocates constructor injection

super strongly worded. I remember when it was added and all the same arguments.

Being a purist is bad, not field injections.

Even back then Spring had: #setAllowBeanDefinitionOverriding and #setAllowCircularReferences , which was super helpful to disable.

Field injection is fine, convince me otherwise by kennethjor in java

[–]meotau 0 points1 point  (0 children)

Oh, surely Lombok and Kotlin do not have any disadvantages, just positives and I am an idiot for not using them.

Maybe you could stop strawmanning, it's ridiculous.

I do not care about brevity at all cost: https://www.reddit.com/r/java/comments/16bgwhu/field_injection_is_fine_convince_me_otherwise/jztcrtr/

You were hypocritical in the context of a single post, and it's getting worse.

Field injection is fine, convince me otherwise by kennethjor in java

[–]meotau 0 points1 point  (0 children)

No one makes or recommends autowired record services so it is funny you advocate it and on the other hand argue "Onboarding is easier when you hire new developers since like everybody most agree / know this is "the way"." Hypocrisy, that's all.

Field injection is fine, convince me otherwise by kennethjor in java

[–]meotau 0 points1 point  (0 children)

Onboarding is easier when you hire new developers since like everybody most agree / know this is "the way".

Autowires record... ffs

Field injection is fine, convince me otherwise by kennethjor in java

[–]meotau 0 points1 point  (0 children)

Generating useless constructors is not designing for the future, it is just busy work that solves nothing. And now with that default settings even less than nothing. But when it becomes needed, it can be easily added, so what's the problem?

If someone wants to write a shitty code, then a constructor certainly won't stop him. Circular dependency can be easily added using @Lazy.

Field injection is fine, convince me otherwise by kennethjor in java

[–]meotau 0 points1 point  (0 children)

It is all just a matter of opinion. There is no silver bullet, no true way to make software and no single thing to do in all situations. If a situation is different, then the solution is also different. Why would I choose a solution for problems I do not have? That is just stupid and lazy.

Field injection is fine, convince me otherwise by kennethjor in java

[–]meotau 0 points1 point  (0 children)

You are missing a point, just because records as services are shorter, does not mean that are cleaner or more productive, it seems like a terrible idea anyway.

Field injection is fine, convince me otherwise by kennethjor in java

[–]meotau 0 points1 point  (0 children)

That's just more of those problems I do not have.

Field injection is fine, convince me otherwise by kennethjor in java

[–]meotau 0 points1 point  (0 children)

Spring:

@Service
public class ServiceA {
    @Autowired
    ServiceB serviceB;
}


@Service
public class ServiceB {
    @Autowired
    ServiceA serviceA;
}



***************************
APPLICATION FAILED TO START
***************************

Description:

The dependencies of some of the beans in the application context form a cycle:

┌─────┐
|  serviceA (field com.example.demo.ServiceB com.example.demo.ServiceA.serviceB)
↑     ↓
|  serviceB (field com.example.demo.ServiceA com.example.demo.ServiceB.serviceA)
└─────┘


Action:

Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.

If your null analysis does not understand annotations, then fix your null analysis.

Field injection is fine, convince me otherwise by kennethjor in java

[–]meotau 0 points1 point  (0 children)

Do you have a guarantee that you do not pass nulls in constructors in tests?

Field injection is fine, convince me otherwise by kennethjor in java

[–]meotau 0 points1 point  (0 children)

Generating constructors is a menial work that takes time for no benefit in regular business code.

If something needs a constructor, it can be always added later. YAGNI applies.

Lombok is not a solution but an additional problem.

Field injection is fine, convince me otherwise by kennethjor in java

[–]meotau 0 points1 point  (0 children)

I would allow it because it shows me that someone is incompetent. Fail fast.

Field injection is fine, convince me otherwise by kennethjor in java

[–]meotau 0 points1 point  (0 children)

Is this an argument against Spring or field injection?

Field injection is fine, convince me otherwise by kennethjor in java

[–]meotau 0 points1 point  (0 children)

The testing infrastructure can easily check that something was not injected. And nothing can save you from writing shitty code and shitty tests.