Hacker News new | ask | show | jobs
by debok 911 days ago
In my experience, this is mostly a JVM issue. When I code in the JVM, I feel like I fight my frameworks and libraries more often than writing actual code. Looking at you in particular, Spring Boot.

I had similar experiences in C#.NET and Python (especially SQLAlchemy), albeit less often and less frustrating.

In Golang, the frameworks and libraries tend to stay out of your way. I feel way more productive.

The trade-off is that I am writing more boilerplate. IMO that is a worthwhile tradeoff, especially since things tend to then be more explicit. More explicit is nice for maintenance anyway. Also, with how far AI code helpers have come, boilerplate is even less of an issue.

6 comments

> Also, with how far AI code helpers have come, boilerplate is even less of an issue.

Couldn't agree more.

With how far on-the-fly code generation powered by LLMs has gotten, the oh-so-dreaded "boilerplate" has become an absolute non-issue, especialy in straightforward, explicit languages with little magic like Go, which naturally lend themselves to this kind of code generation.

Best of both worlds: Explicit instructions and less "magic at a distance", and productivity by getting things done fast.

The problem with boilerplate was never in creating it fast enough. It's with maintaining it. Does the AI help you with that too?
a) Yes it can

b) Pretty much by definition, boilerplate written against the standard library of the language, rarely, if ever, requires maintenance. Not sure we talk about the same thing here when using the word "boilerplate", so perhaps you want to clarify?

> I had similar experiences in C#.NET

I honestly cannot imagine writing modern .NET without a framework. When was this? Modern .NET(5+) is so easy to write and maintain I feel shocked that someone doesn't like it. And I say that as a person who switched from .NET to Typescript+NestJS recently - .NET was really nice to work with for the most part.

The ASP.NET framework is nice. I had more struggles with Entity Framework, to the point where I regretted not just writing raw SQL for my data access needs.

This was also back in 2019 when I last did serious work in C#, so things might have changed a lot since then.

If you did .NET Core in 2019 then it's still very similar, with many improvements here and there.

From my experience ASP.NET Core and EF Core are very good frameworks, usually the horror starts when developers start building their own framework on top of it, instead of keeping it simple.

Interesting to see this blog post and reading this comment here on HN not long after I just posted this:

https://x.com/dustinmoris/status/1736669433928544602?s=20

> Frameworks always hinder more than help in the long term, because once you need to make one step sideways they inflict indefinite pain on you.

I read messages like these and I would honestly love an example, because throughout last 5 years I've been doing .NET, I never had a case where a framework was hindering my work. People always use shallow arguments like these, but the reality is that 99% of work is basic CRUD making with sprinkle of business logic/validation. If you do the other 1% of work then sure, but in most competently designed frameworks you can accommodate those cases anyway or you won't use a framework in the first place anyway.

As for mentioned startup style changes in .NET - none of those actually required you to do anything. I've migrated dozens of projects from 3.1 to 7 and I didn't really have an issue with any of them. I worked with projects that used all of the approaches to Startup/Program.cs and I none of them ever really bored me. Is it a slight mental overhead? Maybe. Does it matter long term? Not really.

If you work in a tech stack with established patterns/frameworks/libraries and you invent your own wheel, you can be sure next generation or two of developers will absolutely hate you for it, because really, you can't make a better abstraction than a collective of dozens or hundreds of developers over years.

> the reality is that 99% of work is basic CRUD making with sprinkle of business logic/validation

People always say this and it doesn't match my experience at all. I must be left to conclude that different people live in very different realities.

Same, never matched my experience. Each business is trying to innovate and do something different in order to make money, they always require something that is not quite aligned with the frameworks. Also frameworks do a lot of stuff very mediocre, which is fine for quick demos or PoCs but can’t be the final version of a dev team takes pride in their work.

For instance, in ASP.NET, without trying it out tell me what is the exact HTTP response if I have a route registered like GET /foo/bar and someone makes a HTTP POST /foo/bar/ ???

Will it be a 404, a method not allowed? How is the trailing slash dealt with? Does it count as a different route a to the HTTP spec or does ASP.NET trim it when routing? Will the response be in text/html, text/plain or maybe application/json? I bet 99.999% of .NET devs can’t answer this without trying it out and might actually find out that their own APIs don’t quite react to how they would like to if they could choose. So that’s a framework issue, because you have business logic running there giving your end users a response which you don’t even know about or understand. So now you need to alter this to be consistent with the rest of your API and now you go off the beaten path, configuring some toggles and functions in some layers just to deal with a simple error case. Of course, if you’re a mediocre developer who doesn’t take pride and just goes with whatever the framework does out of the box (hint, it won’t be nice because that default behaviour has to be so generic that it works for websites and rest apis use cases equally ok enough) then sure a framework is the right tool for you, but everyone else is probably better off just using a library approach which gives them 100% control in an obvious and consistent way.

> Each business is trying to innovate and do something different in order to make money

This might be shocking for you but _most_ businesses do not innovate anything. That's how the world works, very few people innovate.

> Also frameworks do a lot of stuff very mediocre, which is fine for quick demos or PoCs but can’t be the final version of a dev team takes pride in their work

Github was written in Rails, I guess by your logic original developers should be ashamed of what they built? Would they be able to deliver something like that if they had some sticks&stones version of an http library built by one guy in the beginning?

> For instance, in ASP.NET, without trying it out tell me what is the exact HTTP response if I have a route registered like GET /foo/bar and someone makes a HTTP POST /foo/bar/ ??? Will it be a 404, a method not allowed? How is the trailing slash dealt with? Does it count as a different route a to the HTTP spec or does ASP.NET trim it when routing? Will the response be in text/html, text/plain or maybe application/json? I bet 99.999% of .NET devs can’t answer this without trying it out and might actually find out that their own APIs don’t quite react to how they would like to if they could choose. So that’s a framework issue, because you have business logic running there giving your end users a response which you don’t even know about or understand.

I'm sorry but this is the most ridiculous comment I've read on HN so far.

Besides that all of those questions are basics that anyone who actually works with the stack will be able to answer easily, how does someone's familiarity of framework X internals define this frameworks usability? How will this differ if I jump into your hand-made solution? How long will it take to find out what happens if I give it an invalid path/method/param? I would even argue that if you write that by hand it will take much, much longer to deliver new features and actually customize than adjusting web framework's behavior that exists for over a decade. Is it a bad thing that web frameworks have some kind of defaults that you can adjust? Hell, I WANT my web framework to return the same response if you give it a wrong http method on every endpoint, I don't want it to depend on whatever-developer-wrote-that-method-whim.

> Of course, if you’re a mediocre developer who doesn’t take pride and just goes with whatever the framework does out of the box (...) then sure a framework is the right tool for you

So now we define someone as mediocre, because they don't know the internals of the tool they use? Do you know internals of your oven? I guess you're a mediocre cook then. Oh so you can't make ChatGPT yourself? Sorry, you're a mediocre developer, clearly.

You do realize that developer's job is to deliver solutions and solve _business_ problems, not invent the wheel, right? Knowing how to write a quicksort doesn't make you an exceptional worker and that's what you are, a worker, like any other.

Not a Golang dev, but from your description Go sounds similar to Clojure in that you can kind choose to build your own framework by just picking and choosing your own libraries, e.g. use library X for routing, library Y for templating, etc.

When I was trying to learn Clojure (several years ago... so this info I likely out of date), my understanding was there was a bit of a rift in the community where half the community preferred the flexibility of picking and choosing libs and the other half felt having a "batteries-included" framework would help the growth/adoption of the language. Also, because there was no "goto" framework the libraries were likely not as battle tested.

I'm using Java and unlike the comments in the adjacent thread, using Java doesn't mandate using Spring Boot. There's a bunch of options these days. Personally I'm using Quarkus. Quarkus, like most frameworks, is just a collection of libraries and those libraries follow a "standard" to future-proof your application to an extent. You can still pick and choose what parts you want to use. Want an ORM? Great, include the optional Hibernate dependency. Need to support OpenId connect? There's a simple extension. Nothing really forces you to use the "official extensions", e.g. we're using ElasticSearch but we're not using the Quarkus extension.

I agree with your assessment. In Go a lot of the frameworks are more like big libraries, but it's not so much a plug&play architecture, but a pick&assemble what you need, which is why it feels more out of your way, since you don't inherit vast layers but only pick the services and functionalities which you need.
Ruby on Rails also fights you tooth and nail if you try to do anything off the beaten path.
Could you give examples of such AI helpers?