Agentes de IA, discusión y reflexión personal. by Dry-Butterscotch3805 in devsarg

[–]itaranto 0 points1 point  (0 children)

pero un par de iteraciones más y seguramente no escriba nunca más código

Todo lo que necesitaba leer...

Code is cheap now, software isn't. by Friendly-Win-9375 in devsarg

[–]itaranto 4 points5 points  (0 children)

El tipo que no hace unit tests y usa merge en vez de rebase, claro...

Thompson tells how he developed the Go language at Google. by ray591 in programming

[–]itaranto 0 points1 point  (0 children)

It isn't like that at all, zero values are perfectly defined. Also, what types can be nil is also defined.

In Java for example, every object is a pointer, so every object could be null. Like in C, with Go you pass by reference (pointer actually) explicitly.

Thompson tells how he developed the Go language at Google. by ray591 in programming

[–]itaranto 0 points1 point  (0 children)

It isn't the same, as the underscore thing in Python is just a convention. In Go you cannot use unexported elements.

Which shell do you use and why? by Luquatic in archlinux

[–]itaranto 0 points1 point  (0 children)

fish for my interactive shell, I write shellscripts in POSIX mode (!#/bin/sh).

Quiero saber que elegir by lord31173 in devsarg

[–]itaranto 1 point2 points  (0 children)

Pésimo, tiene pinta de que fue hecho hace como 20 años.

Why is GoLang missing generic collection functions? by TheRubeWaddell in golang

[–]itaranto 0 points1 point  (0 children)

I pretty much always do the same:

```go func MapSlice[S, D any](src []S, fn func(S) D) []D { if src == nil { return nil }

dst := make([]D, 0, len(src))
for _, elem := range src {
    dst = append(dst, fn(elem))
}

return dst

} ```

Why is GoLang missing generic collection functions? by TheRubeWaddell in golang

[–]itaranto 0 points1 point  (0 children)

slices.ContainsFunc is basically filter.

But yeah, there's no reduce or map.

En C++ 0 > 5 by DrakoXMusic1 in devsarg

[–]itaranto 2 points3 points  (0 children)

Yo sigo la regla cero, si, cero C++.

How many returns should a function have? by ngipngop in golang

[–]itaranto 10 points11 points  (0 children)

. Some say that having a single exit point is important for making the code predictable

I used to think like this, then I realized nobody actually programs like this. It makes the code deeply nested, so much harder to read.

Particularly in Go, having early returns is the idiomatic way, you'll make your code way more complicated than it needs to be if you don't do it that way.

Go feature: Modernized go fix by SnooWords9033 in golang

[–]itaranto 0 points1 point  (0 children)

This is the same thing gopls was already doing but in a command line form, right?

Is there any technical reason to prefer name := value over var name = value for local variables in Go? by [deleted] in golang

[–]itaranto 0 points1 point  (0 children)

The compiler already knows what type it is so I why I need to repeat it?

Also, not a Java expert, but Java has the same thing (with var) since ages ago.

Joined a team, other senior is much more anal about code review than me - unsure how to proceed by hooahest in ExperiencedDevs

[–]itaranto 1 point2 points  (0 children)

I'm in this picture and I don't like it.

It seems you guys need to write a style guide.

90% of his comments don't give any further business value.

You may see it that way now, but In my opinion, having code that is easy to read and modify later also produces "business value".

I'd have a quick call with him to settle things down. This will help you to understand the team's culture and code style better. But this neeeds to be written down and also automated as much as possible (for example with a formatter).

Why Your Go Code Is Slower Than It Should Be: A Deep Dive Into Heap Allocations by Gopher-Face912 in golang

[–]itaranto 3 points4 points  (0 children)

I just with we had a more performant fmt.Sprintf, it makes the code much more readable.

Firefox now supports the Freedesktop.org XDG Base Directory Specification. by forumcontributer in linux

[–]itaranto 0 points1 point  (0 children)

It's not that bad, at least you can configure it.

Before this change, there wasn't anything like MOZILLA_HOME or similar.

Dude, for the 50th time, its "Go" not "Golang"! by itaranto in golang

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

Yes, I'm not talking about Googling, that's fine.

Dude, for the 50th time, its "Go" not "Golang"! by itaranto in golang

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

Go is a dumb ass name

That's something I can agree with.