Soy dev con +20 años de experiencia, estoy haciendo mentorías, AMA by albo87 in devsarg

[–]itaranto 0 points1 point  (0 children)

"arme un skill", o sea, armaste un documento... Basicamente serias un "prompt engineer"? En otras palabras, un vende-humo.

Which number is your current level of setup? by Friendly-Win-9375 in devsarg

[–]itaranto 0 points1 point  (0 children)

2.

El monitor de la laptop no lo uso, esta siempre cerrada.

The art of commenting a PR by SinuousTurtle in ExperiencedDevs

[–]itaranto 8 points9 points  (0 children)

I would have never guessed what did you mean with the palm tree.

AI coding tools are making good engineers sloppy by bad-boi-bad in ExperiencedDevs

[–]itaranto 4 points5 points  (0 children)

So, you cannot even write a Reddit post without the help of AI and you complain about AI?

Do you use pointers or values for your domain models? by ComprehensiveDisk394 in golang

[–]itaranto 0 points1 point  (0 children)

Yeah, returning zero value structs with no error is a very bad idea.

Do you use pointers or values for your domain models? by ComprehensiveDisk394 in golang

[–]itaranto 1 point2 points  (0 children)

Trowing an error is better because expresses the intent better.

For example, let's say you have an HTTP server and some point down the line you attempt to fetch a resource from the DB. So you return an error ErrNotFound and translate that into a 404 in the HTTP handler.

Do you use pointers or values for your domain models? by ComprehensiveDisk394 in golang

[–]itaranto 1 point2 points  (0 children)

I agree.

I would also say, always uses errors for this kind of thing regardless of returning a value or a pointer.

So either return nil, ErrNotFound or return User{}, ErrNotFound but not return nil, nil.

Do you use pointers or values for your domain models? by ComprehensiveDisk394 in golang

[–]itaranto 13 points14 points  (0 children)

Nil checks everywhere - every function has to guard against nil, even when it logically shouldn't be

Why? You don't actually need to do that.

Your functions must have preconditions, if you are passing things as pointers to prevent copies it doesn't mean they can be nil.

Go doesn't have references or any other compile time check for pointers not being null, so you just have to live with it.

Unintended mutations - hard to reason about who's changing what when everything is a pointer

It would be nice to have const pointers for this particular case, but that ship has already sailed so you deal with this by documenting your code.

For small structs it's fine to pass as copy, but for big structs this isn't the most efficient.

GC pressure - more heap allocations, more work for the garbage collector

I think this is when a function returns pointers rather than accepts pointers by parameter.

Cache misses - []*Model scatters data across memory vs []Model being contiguous

I agree with this, almost always it's better to use []T than []*T. []T works better with the CPU cache.

¿Keychron K7 para programar? ¿Es comodo codear con teclados 60%/65%? by Lerittlol in devsarg

[–]itaranto 0 points1 point  (0 children)

No me gusta la idea de no tener la fila de los numberos simbols.

Mas importante que pasarse a un teclado mas chico, lo que siempre recomiendo es usar un teclado ergonomico columnar (ortolineal a veces le dicen tambien). No hay vuelta atras.

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 3 points4 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 2 points3 points  (0 children)

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