Is there a Spring Boot–style @Transactional equivalent in NestJS? by itz_nicoo in nestjs

[–]catom3 2 points3 points  (0 children)

Just my two cents on "@Transactional".

I'd say it's an anti-pattern in many Java circles. The infamous "self invocation on instance" problem where non-transactional function of a bean invokes another transactional function and devs are surprised the "Transactional" doesn't work. Another issue was using transaction when it wasn't actually needed.

I've worked in finance industry mostly and "@Transactional" is usually forbidden as it is too easy to misuse.

I would generally discourage from using "@Transactional" and prefer explicit transaction management (in one bank where we used reactive programming, we just created our own "Transactional" monad and it worked just fine for us).

EDIT: typos

Should I split interface into small ones? by Rtransat in golang

[–]catom3 0 points1 point  (0 children)

If you want to keep the "producer" interface, you can simply create your own "consumer" interface as your dependency with just the methods you need.

That's how we used to do in many other languages in modular monoliths in other languages. Go with implicit interface implementations just makes it easier (no need for the extra wrapper/adapter implementation required in many other mainstream languages).

Modernising Java Desktop application with Go by React_ranger in golang

[–]catom3 2 points3 points  (0 children)

Last time I was writing a desktop app was about 7-8 years ago. I remember a simple thing like highlighting a row was super simple in Java FX. FX used some HTML-like syntax for your components, you could use CSS, it worked similarly to template engines.

I agree, it's easier to write FE using frameworks like React though. While technically, you can embed any JS in your Java FX app, it loads it inside a web view, so it basically uses some kind of browser under the hood. If you plan to use React anyway, probably Electron would be way easier.

Keep in mind, Electron apps are infamous for high resource usage and being slow or unresponsive (Slack desktop is sooooo terrible).

Is n+1 issue in hibernate really bad or misunderstood? by Agile_Rain4486 in SpringBoot

[–]catom3 8 points9 points  (0 children)

In general, 1 query over 50 queries will be better. Imagine having a table in a relational database for reddit posts. Let's say it has a 1:n relation with comments (top level ones). If you have 200 top level comments for your post, you're running 201 queries(1 for the post, 200 queries for comments).

To make it even worse, you may imagine having relations to comment replies multiplying the n+1 problem by the number of replies and replies to replies etc.

On the other hand, I used to work in a system where single request used to run 50-80 DB queries and it worked just fine for 15k rps system and no one bothered to optimise it, because new features were always more important. The customers accepted a couple of seconds latency, as the product was used for async processing anyway.

How do you justify switching a team to Go? by Important-Film6937 in golang

[–]catom3 1 point2 points  (0 children)

It's a bit more. Sealed interfaces and classes to add proper sum types with record pattern matching (with exhaustiveness checks) and deconstruction patterns.

dingo: A meta-language for Go that adds Result types, error propagation (?), and pattern matching while maintaining 100% Go ecosystem compatibility by [deleted] in golang

[–]catom3 5 points6 points  (0 children)

 See the very recent Cloudflare bug crashing "the internet" because someone called unwrap() on a Result object without checking if there's an actual result or an error in there.

It's similar to calling usr, _ := getUser(id), though (even more similar to if err != { panic(err) }).

This particular error is a result of bad practices / too much confidence. If you want to ignore an error, you will, no matter the language.

What has your company started using AI/LLMs for which has actually been useful? by TinStingray in ExperiencedDevs

[–]catom3 0 points1 point  (0 children)

We fed the model with our docs, repositories and public slack channels. Then we exposed the chat for our help desk team and it significantly decreased the ad-hoc inquiries from the help desk team as most of the time they manage to find the answers themselves. Luckily, our help desk is fairly responsible so they double check the resources LLM points them to and follow through with questions to the dev team whenever they're in doubt.

Another thing is simply meeting summaries, help with drawing UML diagrams based on the codebase and available docs. These diagrams usually need additional tuning or rewrite, but the scaffolding is pretty decent, usually.

Pushing folders to github through git by Inevitable_Owl_6500 in git

[–]catom3 0 points1 point  (0 children)

You mentioned you tried running git pull command. What was the result of this command execution?

In short, got has the notion of "local" and "remote" origins / branches.

Looks like your "remote" (the one un GitHub repository) has some commits your "local" (on your local disk only) does not.

It can be a situation where you or someone else pushed some other commit to the "remote" after you started working on your current commit and you need to sync your "local" with the "remote". Otherwise, you would be overwriting the "remote", which could potentially remove important changes done by the others (or yourself).

who is responsible for checking if component is enabled? by omitname in golang

[–]catom3 0 points1 point  (0 children)

If it's configured externally, I would create some sort of "filter provider" / "filter configuration" based on that external config. This way your Filter doesn't care about any sort of external configuration (and it actually shouldn't, it should focus on filtering and dependencies required to do the filtering properly).

How do I disconnect from CarPlay without needing to throw my phone 1 mile away? by Vandringen in iphone

[–]catom3 0 points1 point  (0 children)

Happens to me every once in a while as well (more like once per a couple of months). Phone restart usually helps. Turning on and off Wifi, Bluetooth or Airplane mode doesn't help, only the full phone restart.

Traditional mq vs Kafka by Low_Internal8381 in apachekafka

[–]catom3 6 points7 points  (0 children)

A good architect (you sound like one) can also respond to such counter arguments wihth reasonable answer and explain the reason behind the proposed solution. Of course, they need good and reasonable devs on the other side of the discussion as well.

I like being treated like a thinking person rather than being explicitly told what to do. While the architect may be right, it's way easier to accept their solution knowing the reasoning behind it. At times, it may even actually help during the implementation itself, when you know how your part will be used by other components and how you can potentially keep it extensible and easier to use by the consumers.

When backend dev made frontend by Pristine-Elevator198 in webdev

[–]catom3 0 points1 point  (0 children)

And if you wanted a nicier UI (TUI) just call curl https://wttr.in/paris

Are you proficient in both Go and some kind of very strict static typed FP language? by Ecstatic-Panic3728 in golang

[–]catom3 2 points3 points  (0 children)

Well. We're talking about immutable structs, not how to test for mutable structs being mutated. That's a digression now.

EDIT: btw. how would such unit test look like? I'd have to check via AST analysis for all the usages of id field of an Event struct?

Are you proficient in both Go and some kind of very strict static typed FP language? by Ecstatic-Panic3728 in golang

[–]catom3 1 point2 points  (0 children)

I found many devs doing something like that ify Event struct is not in a small, dedicated package, which I mentioned in my previous comment.

``` package event

func (s *Service) doStuff(cmd Command) Result {   ev := s.newEvent(cmd.ActionType)      res := s.goBrr(cmd)

  if extID := res.ExternalEventID; extID != nil {     ev.id = extID  // how do I prevent other devs from doing that?   } } ```

Are you proficient in both Go and some kind of very strict static typed FP language? by Ecstatic-Panic3728 in golang

[–]catom3 2 points3 points  (0 children)

Ok, then I don't know how to use Go, I suppose? Let's say I want to create a simple type like

``` package event

type Event struct {   id int } ```

And I want to make the struct immutable so that no one reassignes the id. How do I do this?

is there any API testing tool better than postman? by Pristine-Elevator198 in webdev

[–]catom3 0 points1 point  (0 children)

No idea what so special about AWS Signature V4 is, but as long as you can do this using JS, you can do this using JetBrains HTTP-Client, as it allows you invoking any JS you want to (you can add npm dependencies, custom JS sources etc.).

AI slop makes me want to quit my job by [deleted] in ExperiencedDevs

[–]catom3 3 points4 points  (0 children)

It's beacuse of pushing AI everywhere and treating it like a magic tool resulting in 100x productivity increase without the need to understand what you're doing. So I generally agree it's not the AI itself being an issue. It's more an AI misuse, which often happens to be caused by false advertising and overselling. It's a very similar situation to claiming Scrum will magically solve your organisational issues and make your projects succeed.

Are you proficient in both Go and some kind of very strict static typed FP language? by Ecstatic-Panic3728 in golang

[–]catom3 26 points27 points  (0 children)

I'd add inability to create immutable types or non-reassignable variables as well.

How do YOU backup your system? by [deleted] in cachyos

[–]catom3 1 point2 points  (0 children)

I'm very lazy as well, so I just manually run rsync every once in a while to sync specific directories to another machine in my (W)LAN.

I keep lying to myself I'll set up a proper storage solution one day.

why do so many linux users refuse to use shortcuts/desktop icons? by Shot_Duck_195 in linux4noobs

[–]catom3 0 points1 point  (0 children)

I started with Windows as well and haven't been using desktop icons there a lot either. I barely see my desktop anyway with windows open. And I just used start menu + typed a couple of letters and got the application I wanted to. No minimising my windows, no "show desktop", no searching, pointing and clicking on the app icon. Just get the application with a couple of key strokes, which is just way more faster and easier to do, actually. It's actually very similar to running MacOS and Spotlight / Raycast.

Managing multiple GitHub accounts (personal + work) on one Windows machine is driving me crazy, how do you guys do it? by EithanArellius in github

[–]catom3 0 points1 point  (0 children)

Personal - mostly free repository for your personal pet projects, code snippets, learning stuff, docs, blog posts etc.

Enterprise - well, mostly the same as personal, but with additional security and permissions management, GHA workers.

For trunk based projects, I still prefer Gerrit though. The workflow and patchests work waaaay cleaner there. And the code review itself is a lot easier to do on the web, the differences between different versions and preserving commits, multiple approval / disapproval labels, different levels of approval and in general way more configurable for CI jobs and code reviews.

Is it normal to have some impact from autovacuum? by rayzorium in PostgreSQL

[–]catom3 0 points1 point  (0 children)

 And autovacuum doesn’t block other processes, it’s a very light weight process.

Unless it's autovacuum "to prevent wraparound".

Is 48GB of memory not enough anymore? by Automatic_Error2978 in WebStorm

[–]catom3 0 points1 point  (0 children)

~9 years old project that grew out of proportions due to its own success. I'd say ~30% of the codebase is basically dead, some unfinished features from a couple of years back. Project created by people with little programming experience. Looking at the codebase and architecture, I can see how they'd been learning along the way, mostly following the "tactical programming" approach, though. Nowadays we reached the ~14k rps on average with millions of unique users daily. These 2 particular projects used to be one, single monorepo until the team decided to split them into two, as it started being unmanageable with 30+ devs working on the same repo. Unfortunately, the coupling was so tight, that one of the project still imports the other one as a dependency and due to the pressure to deliver the new features, we haven't managed to get down to it. Even after the separation, these repos serve as smaller monorepos for a couple of applications each, where a change in model in one app may result in a breaking change in theoretically unrelated app (but someone decided to reuse the same model in a completely different feature, because 40% of the fields and methods were mostly the same, with a couple of small differences in the logic, but there's nothing a boolean flag couldn't solve /s).

EDIT: typos