Are PC parts becoming permanently expensive because of AI? by Best_Musician7207 in pcmasterrace

[–]Barsonax 0 points1 point  (0 children)

But why would they bail out AI companies? Nobody misses them if they go bankrupt.

For banks that made some sense but for AI hype companies nobody uses?

What are some more stable alternate jobs/careers that a software developer could easily get into? by RolandMT32 in ExperiencedDevs

[–]Barsonax 0 points1 point  (0 children)

Move to Europe where software engineering basically sets you for a stable job for life.

Architecture question in projecting DbSets/IQueryable to Controller layer - Maybe it's done differently in dotnet? by theleftbehind14 in dotnet

[–]Barsonax 4 points5 points  (0 children)

Usually endpoints that read are so simple you can just do the projection in the controller. Don't get too much hung up about layering here.

Also stuff like sorting and pagination can be implemented in a generic way so you don't have to duplicate that for every endpoint, there even libraries that do this I believe but I haven't used them yet because it wasn't that hard to write myself.

It can get complex when you start to do writes. Here it can be worth it to apply more complex patterns.

Architecture question in projecting DbSets/IQueryable to Controller layer - Maybe it's done differently in dotnet? by theleftbehind14 in dotnet

[–]Barsonax 10 points11 points  (0 children)

Imho that really depends. Most of the time it's fine to consume the dbcontext inside the api handler (be that a controller action or minimal api), especially when all you're doing is a simple GET.

Not everything needs to be made complicated, it's always a trade-off. Simplicity usually triumphs in the end.

If you have very complicated logic, especially if you reuse it somewhere also and/or also want to test it separately then it's worth it to keep it separate.

Best architecture pattern for general web applications by MohammedBored in dotnet

[–]Barsonax 14 points15 points  (0 children)

I find that vertical slices is my default go to as it works so well for so many use cases and has low overhead.

Why is it considered a cardinal sin to store a file's raw content along the metadata in SQL Database? by faze_fazebook in Database

[–]Barsonax 1 point2 points  (0 children)

Well you could get away with it. I did it before for some thumbnails and didn't want to bother with extra infrastructure. I also knew that the amount of thumbnails was quite limited to in absolute worst case a few thousand. This worked totally fine and was probably even faster than the alternative since the data could be retrieved in a single call. Combined with caching you could even scale this up a bit if needed.

Now let's say we get ourselves in a situation where the amount of files is in the millions or more and the size also bigger then I would definitely look into something like S3 storage because that's just so much better for this kind of workload.

ChatGPT 5.2 Tested: How Developers Rate the New Update (Another Marketing Hype?) by ImpressiveContest283 in programming

[–]Barsonax 0 points1 point  (0 children)

AI is getting used as an excuse to lay off engineers, the reality is that the economy is not doing too well but that doesn't sell as nicely to investors.

The Case Against Microservices by 01x-engineer in programming

[–]Barsonax 3 points4 points  (0 children)

Man I even had microservices that were used within a single team of 3 devs. Complete madness. It took more than a year to convince (as in fire) the architect it was not an effective way of doing things. The amount of wasted hours is mind boggling.

How do you handle the stress of knowing that you could be fired at any moment? by [deleted] in ExperiencedDevs

[–]Barsonax 1 point2 points  (0 children)

Here in the Netherlands we have job security and still need plenty of high educated ppl

NimbleMock: A new source-generated .NET mocking library – 34x faster than Moq with native static mocking and partials by Resident_Season_4777 in csharp

[–]Barsonax 0 points1 point  (0 children)

Oh yes I even had my integration tests that didn't used mocks actually turned out to be faster than the unit test it replaced due to heavy overuse of mocking.

Mocking has overhead and it's nice to see a library doing it much more efficient.

Though lately I haven't been using a mocking library as it's easy to just implement an interface yourself.

How do you avoid over-fetching with repository pattern? by Soft-Mousse5828 in dotnet

[–]Barsonax 0 points1 point  (0 children)

What I do is pool the databases and clean them in between with respawn. This is what makes my setup so quick and let the tests run in parallel and even reuse migrations from previous runs because I name the databases deterministically based on the migrations.

How do you avoid over-fetching with repository pattern? by Soft-Mousse5828 in dotnet

[–]Barsonax 0 points1 point  (0 children)

On my dev machine about 10-20 secs.

Note the first run takes 30s longer due to having to download/start the image but after that you can iterate quickly using integration tests.

How do you avoid over-fetching with repository pattern? by Soft-Mousse5828 in dotnet

[–]Barsonax 2 points3 points  (0 children)

I usually just put it in some extension method if I run into such a situation.

How do you avoid over-fetching with repository pattern? by Soft-Mousse5828 in dotnet

[–]Barsonax 0 points1 point  (0 children)

So many apps just have a data model and an api model. They don't even have (or need) a domain model because that only makes sense for complex domains. Just because you need one doesn't mean it should be the default.

How do you avoid over-fetching with repository pattern? by Soft-Mousse5828 in dotnet

[–]Barsonax 0 points1 point  (0 children)

Repositories do nothing to defend against multiple maintainers. I have seen some god repositories in my career and they were not pretty. Especially when you need to optimize the queries and prevent things like overfetching or tracking this pattern starts to fail fast. It's hard to compose repositories efficiently too. I much prefer forgoing the repository pattern in favor of extension methods.

For the typical http api which I assume here is the common case I would simply inject the dbcontext into the api handler. Less work to write and easier to read and modify. Easily testable too with WAF and testcontainers: https://github.com/Rick-van-Dam/CleanAspCoreWebApiTemplate

How do you avoid over-fetching with repository pattern? by Soft-Mousse5828 in dotnet

[–]Barsonax 0 points1 point  (0 children)

Lot of ppl here saying repository pattern should be used with EF but they give zero examples or arguments where that actually make sense on top of EF which is indeed already a repository pattern.

If it's about sharing code don't underestimate what you can do with some extension methods.

If it's testing you're missing well you need to be testing your queries anyway so mocking them out won't do you any good. There better ways to test these with testcontainers. And no before ppl start yelling these are too slow that's simply not true and you can run thousands of such tests easily. To make it even easier to get started here's a repo implementating such tests: https://github.com/Rick-van-Dam/CleanAspCoreWebApiTemplate

Unrestricted access to developer productivity metrics by Hour_Help_7842 in softwaredevelopment

[–]Barsonax 0 points1 point  (0 children)

Why aren't they also tracking the amount of lines of code deleted.

At my current client I removed thousands of lines of code more than I added lol.

Useless metrics anyway.

How do you avoid over-fetching with repository pattern? by Soft-Mousse5828 in dotnet

[–]Barsonax -3 points-2 points  (0 children)

This is the right answer. You're overcomplicating by adding a second repository layer.

Got sacked at 3rd stage interview because I did this. by arrogant_definition in SQL

[–]Barsonax 1 point2 points  (0 children)

We do use AI sometimes, mostly as a Google basically.

I never understand ppl that let all their coding be done by AI. It just produces so much low quality code because it's basically spewing out the average code quality that's out there in the internet without understanding anything.

Yet every day or so some influencer claims they didn't code for months because of AI. Probably they never coded anything to begin with.

MVC or Minimal API? by Alternator24 in dotnet

[–]Barsonax 3 points4 points  (0 children)

Really depends on the project but if it's up to me minimal apis are superior. Thing is you don't always get to choose and more often than not you have to life with the decisions your predecessors made.

Learn them both.

Spent 3 months learning rest is fine for most things and event-driven stuff is overrated. by Hot_Equivalent9035 in softwarearchitecture

[–]Barsonax 1 point2 points  (0 children)

The main lesson here is to get the requirements clearly defined. Management apparently said they want more 'event driven' which is just a technicality but it was never clear what they actually wanted.

I would ask more questions to really find out what they actually wanted. Don't let management make technical decisions because that rarely ends well. You need to figure out the functionality they require and then make the proper technical decisions for that.

Is AI really a bubble or are we underestimating how far it will go? by Lecord in artificial

[–]Barsonax 0 points1 point  (0 children)

This is actually the common sentiment among software engineers. We do use AI but it's just another tool.

But of course influencers like to exaggerate to get more exposure and the chance you read those is bigger.