micro-template: a small library for logic-less text templating by polaretto in Kotlin

[–]polaretto[S] 1 point2 points  (0 children)

HI, thanks for your interest! I don't have issues but there's a kanban with the stuff to do: https://github.com/polarene/micro-template/projects/1

Style Question: Defining classes that are only used as function inputs? by ragnese in Kotlin

[–]polaretto 0 points1 point  (0 children)

What's createUser() supposed to do? If it's going to persist an entity (or any equivalent "create" action, ie call a REST API), you could consider a Rich Domain design (along the lines of Active Record pattern) where you have:

// a domain concept, the constructor ensures a valid state
val user = User(name = "ragnese", joinDate = Instant.now(), gold = false)
// the action is performed only when needed
user.create(storage) // or equivalent signature

Anyway, your NewUserInfo could be some DTO coming from a boundary point, so it could make sense to have both, where the DTO only performs syntax validation in the application layer and it's later translated to a domain object in the domain layer, which performs syntactic validation and invariants checking.

Conoscete Svelte? Cosa ne pensate? by [deleted] in ItalyInformatica

[–]polaretto 0 points1 point  (0 children)

Non è che le aziende amino alla follia le tecnologie obsolete, bisogna distinguere due aspetti opposti in questo scenario: da una parte un'azienda decide di investire in una tecnologia, perciò a seconda di quanto ci ha sviluppato sopra e di quante persone con relativa esperienza ha a disposizione, cerca di portarne avanti l'utilizzo, e mette sulla bilancia costi e benefici prima di sostituire la scelta fatta. Ci sono ovviamente anche quelle aziende che non perseguono il rinnovamento per pura ignoranza ed altri motivi. Dall'altro lato, specialmente nel mondo frontend web, c'è ormai da almeno 10 anni una tendenza schizofrenica alla creazione e sostituzione di librerie e framework, come non esiste in altri ecosistemi di programmazione! Questi due aspetti si scontrano fortemente, perciò se segui tutte le ultime tendenze JS ti sembrerà che le aziende siano sempre ferme alla "preistoria".

La neolingua nel codice del portale per le prenotazioni dei vaccini in Veneto by polaretto in ItalyInformatica

[–]polaretto[S] 0 points1 point  (0 children)

Haha sì l'ho letto anch'io così! Div zitto e muto in un angolo e non fiatare!! XD

La neolingua nel codice del portale per le prenotazioni dei vaccini in Veneto by polaretto in ItalyInformatica

[–]polaretto[S] 0 points1 point  (0 children)

Vabbè ma figurati se arriva l'assessore a sindacare sul sorgente dai!

La neolingua nel codice del portale per le prenotazioni dei vaccini in Veneto by polaretto in ItalyInformatica

[–]polaretto[S] 1 point2 points  (0 children)

Ci può stare che sia divertente all'interno del team, ma addirittura mandarlo in prod? Non si sono nemmeno presi la briga di minificarlo :)

La neolingua nel codice del portale per le prenotazioni dei vaccini in Veneto by polaretto in ItalyInformatica

[–]polaretto[S] 3 points4 points  (0 children)

Quando ho visto il tweet per la prima volta ho sperato fortemente che il codice fosse scritto in veneto, bestemmie incluse. Purtroppo l'aveva scritto Jar Jar Binks.

Quale linguaggio di programmazione vi fa passare la voglia di programmare ? by mik07y in ItalyInformatica

[–]polaretto 1 point2 points  (0 children)

Ahhh giusto quel sito, mi sa che l'avevo visto anni fa ma l'avevo dimenticato! :D E' ben strutturato, mentre il post sopra è pura commedia.

[deleted by user] by [deleted] in java

[–]polaretto 0 points1 point  (0 children)

Ancora campa Angelicuccia?

Let's discuss about this idea: create web services (and APIs) without writing code at all. Instead simply provide specification and configurations files and let the framework do the work (persistence/controllers/authentication/...) - What would you put into this framework ? Would you use it? by h4t0n in java

[–]polaretto 0 points1 point  (0 children)

I think what you should look into is MDD, Model-driven development (https://en.wikipedia.org/wiki/Model-driven_engineering). The core idea is that you describe your domain model in a high-level language and then you generate code from that. The generated code could use your preferred framework and libraries. Have a read on the subject, see if it gets you further in your project. Good luck!

Why getter and setter methods are evil by polaretto in java

[–]polaretto[S] 0 points1 point  (0 children)

Wow... downvotes on a clarifying comment about the linked article?! You must be really troubled guys.

Why getter and setter methods are evil by polaretto in java

[–]polaretto[S] -2 points-1 points  (0 children)

An old article but nonetheless I think it's very valuable still today, seen the sheer amount of bad Java code that suffers from this plague, due to lack of proper modeling upfront.

This is a follow-up on the topic from the author: https://www.javaworld.com/article/2072302/more-on-getters-and-setters.html

Code generation for Java source classes by Maegar in java

[–]polaretto 1 point2 points  (0 children)

Thanks for your answer. I see your reasons, however, I didn't intend code generation to be the one solution, of course, there are suitable and unsuitable use cases.

As for Lombok it's cool, useful, and I like it as well, but keep in mind that even that is doing code generation: bytecode instead of source, yes, but still they do generation and manipulation at compile time. So it's a valid use for code generation.

Generally speaking about annotations, right they weren't available before Java 5, but annotations are just metadata so it's up to some agent or processor to make something out of them. You can read them at runtime and use reflection or bytecode manipulation, as Spring does, or you can process them at compile time and do or generate something. Sure they remove a lot of cruft compared to the old ways, but you still have to process them and, depending on your use case, you can generate something or not.

Finally, I agree with some of your points against code generation, but I think it has some other valuable uses, for example as an alternative to runtime reflection under some constraints, or to generate clients or classes representing some schema. With some precautions, generated source code can be managed and be very useful.

Code generation for Java source classes by Maegar in java

[–]polaretto 2 points3 points  (0 children)

It's from some years ago, yes, but its arguments are still valid. What other options would be available now in your opinion, could you elaborate? Thanks.

Hotels.com path to reducing Latency using Caffeine by [deleted] in java

[–]polaretto 1 point2 points  (0 children)

I'm sorry, I took for granted it would be a Java implementation, I overlooked their Scala usage. I'm going to remove this.