If you want express your plea for help in Java it's really easy:
RequestDispatcherSubsystem.getCurrentDispatcher().DispatchRequest(
RequestFactory.getAbstractFactoryInstance(
new RequestMedium(RequestMediaType.Plea),
new RequestTransport(RequestTransportType.CRY),
new RequestTargetDestination(TargetManager.getRoutingInfo(
PersonLocation.NEAREST))),
RequestReasonCode.IM_SLOWLY_DYING);
Not completely. (Warning, opinionated) Even if you can work around the entire existing Java community and avoid using all the popular existing tooling and libraries that expose an API that forces you to do this, the Java language itself is very proper and inflexible by design in comparison.
If programming languages were Lego sets, Java would be a Lego set that refuses to incorporate any "specially shaped" pieces, only allowing full-sized blocks. No rods, no wedge pieces, no thin flat pieces -- the smallest unit allowed must be a Proper Lego, a full height NxM, to guarantee every piece properly locks into the global grid.
So to make anything interesting like a Lego person with a flower, you can't just use... a Lego person with a Lego flower. You can only use Proper Lego pieces, so to depict organic shapes, the person and flower you would build needs to be gigantic. It's a high level language that often asks you to code as if it were low level. And so it has been for decades.
In the last few years, the committee relented, and started adding a wedge piece here and a thin piece there, but everything built of Java Lego is already 100x bigger (why heavy IDE refactoring tools are de-facto necessary in the first place), and those tiny additions aren't going to make a difference until maybe several more decades have passed.
IMO Java's biggest usability shortcomings are not having things like the following built-in:
Convenient-to-use String, Map, Regex, etc implementations and syntax
Powerfully expressive collection library
Concise alternatives for tons of little things like aliasing, null handling, operators, basic static metaprogramming
Coherence between a community that wants "safe by default" and a language that needs boilerplate declarations to "protect you" against its "dangerous by default" parts (nulls, mutability, shared state)
Some of these can be mitigated by libraries or annotations, but many of these are also made worse by libraries and annotations, so kind of a toss-up.
try {
// Use same EntityManager for further JPA operations within the transaction.
// Thread-bound object will get removed by synchronization at transaction completion.
emHolder = new EntityManagerHolder(em);
if (synchronizedWithTransaction) {
Object transactionData = prepareTransaction(em, emf);
TransactionSynchronizationManager.registerSynchronization(
new TransactionalEntityManagerSynchronization(emHolder, emf, transactionData, true));
emHolder.setSynchronizedWithTransaction(true);
}
else {
// Unsynchronized - just scope it for the transaction, as demanded by the JPA 2.1 spec...
TransactionSynchronizationManager.registerSynchronization(
new TransactionScopedEntityManagerSynchronization(emHolder, emf));
}
TransactionSynchronizationManager.bindResource(emf, emHolder);
}
catch (RuntimeException ex) {
// Unexpected exception from external delegation call -> close EntityManager and rethrow.
closeEntityManager(em);
throw ex;
}
So you're saying Spring is a terrible project and no one should use it? :)
I hope you mentally used an AestheticFactory to build an instance of (AestheticAppreciation) Aesthetic before implementing aestheticAppreciation.like(AestheticModifier.QUITE)
It's this or admit there's nothing wrong with singletons
Fuck I hate people who think the gang of four are programming prophets and their book is some sort of bible, I become extremely judgy to anyone who shuts down conversation with "have you read gang of four? I think you should read gang of four, I have and you'll find this in gang of four, did I mention I know design patterns? It's because I've read gang of four, have you...?" and they go on.
View all comments
387
u/Frptwenty May 29 '20
If you want express your plea for help in Java it's really easy: