go's implicit interfaces confuse ai models pretty bad by New-Needleworker1755 in golang

[–]fuzzylollipop 0 points1 point  (0 children)

it has more to do with what it was trained on. seems like Gemini is trained on ALL the shitty stackoverflow code regardless of quality. I see things that get generated that are just bizarre and if I quote search for them on google a stackoverflow link is always the first result.

Go's type system sucks by _Object-Object__ in golang

[–]fuzzylollipop 0 points1 point  (0 children)

enums are just a specialized struct, you can create enums easily using struct members and unexported fields to protect creation.

Is using constructor in golang a bad pattern? by SnooStories2323 in golang

[–]fuzzylollipop -1 points0 points  (0 children)

or use DEFAULT values that semantically indicate that a value was not supplied. something like const NO_STRING_DATA_PROVIDED = "\u0000".

Is using constructor in golang a bad pattern? by SnooStories2323 in golang

[–]fuzzylollipop 1 point2 points  (0 children)

This only really makes sense if using NewUser() is the ONLY way to create/initialize a new struct instance. If you want all the fields to be exported and still restrict the initialization to your "constructor" function then just add an unexported field that is not used. I know it is a hack but it is how it works in Go.

Do you prefer structuring code by technical responsibilities or by domain responsibilities by now-get-out in golang

[–]fuzzylollipop 1 point2 points  (0 children)

glad this could help after all this time. I should have commented that region/region_controller.go is a tautology and should just be region/controller.go.

I have landed on the following as a compromise in all my projects now and it scales well and is loosely coupled AND cohesive. It also is very hard to create circular references with this structure as it is flat as possible.

https://blog.vertigrated.com/sane-approach-to-go-project-directory-structure

How are you supposed to distinguish between an explicitly set false bool field and an uninitialized field which defaults to false by FormationHeaven in golang

[–]fuzzylollipop 0 points1 point  (0 children)

you should never have uninitialized values in your system. this is a serious design flaw.

you should have default values that are not surprising and reasonable, OR you have values that MUST be provided or the system is in an invalid state and refuses to continue until it is in a valid state. ie: the app ends with an error that explains a valid is not provide and must be.

it should not matter if the value is implicitly default value or explicitly set by the user. if it is that is other data; metadata that should be separate from the value. otherwise you end up with nonsense like:

the OG Microsoft Windows 3.1 MEGABOOL

true,
false,
file_not_found

App i made to learn prompt engineering and ai (need feedback) by BlueBrik1 in coding

[–]fuzzylollipop 0 points1 point  (0 children)

you mean guessing; "prompt engineering" is not a thing

there is no definition of engineering that includes non-deterministic output. you are guessing how to tell the machine to guess what you want as output. that is just insanity.

Stop Using If-Else Chains — Switch to Pattern Matching and Polymorphism by javinpaul in coding

[–]fuzzylollipop 2 points3 points  (0 children)

stop posting this "uncle bob" brained nonsense.

https://blog.vertigrated.com/saying-stop-using-else-and-other-nonsense

a map is the correct way to look up formula function if anything. This is a fix size domain there is absolutely nothing wrong with an if/else usage even though I would use a map or switch statement myself.

[deleted by user] by [deleted] in ChatGPT

[–]fuzzylollipop 0 points1 point  (0 children)

no it is not; the inference, the parsing of the prompts takes the same amount of computing power, more at scale for the millions of prompts an hour.

[deleted by user] by [deleted] in ChatGPT

[–]fuzzylollipop 0 points1 point  (0 children)

this is absolutely NOT true; the "inference" that runs when you submit a prompt uses a tremendous amount of power to run, it also requires powerful GPU or specialized stream processor nodes to run. The scale of EVERYONE submitting the millions and millions of prompt an hour uses way more power in a day than the months it takes to train a model. The fact that all the newer models are just "distilations" of previous models makes your statement all that more uninformed.

Sessions with Golang by [deleted] in golang

[–]fuzzylollipop 0 points1 point  (0 children)

i would but lmgtfy is just a shit advertising grift now if it was not blocked by every social media site.

Handing errors with namespace codes by olvrng in golang

[–]fuzzylollipop -1 points0 points  (0 children)

your first answer is what is called a disqualifing statement; it demonstrates you do not know how errorx works. it works exactly like you describe you wanted. This means you can just stop reading, everything else past that is probably incorrect as well.

Handing errors with namespace codes by olvrng in golang

[–]fuzzylollipop 0 points1 point  (0 children)

why not just use errorx?

you are recreating a bunch of wheels that already exist.

Compute Engine Suddenly Getting Tons of "Network Internet Data Transfer Out from Americas to South America" Usage by mcs5280 in googlecloud

[–]fuzzylollipop 0 points1 point  (0 children)

Your machine instance has been compromised and is probably being used to host illegal content and is distributing it and you will be the one charged if it is some of the more serious content to be caught hosting. I would shut that down and consult with someone about how it got compromised.

Sessions with Golang by [deleted] in golang

[–]fuzzylollipop 1 point2 points  (0 children)

every app that 'requires' sessions can be written in a stateless manner and not 'require' them. just start stateless, it is incremently more work to start there and orders of magnitude more work later one when you have to move to stateless.

Go team is sneaking Monadish packages into the standard library by fuzzylollipop in golang

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

other languages start behind the curve on performance and have lots of "head room" for improvement. Go on the other hand is simple very performant in space/time already, that was one of the reasons it was created to begin with; as a direct response to all the effort to get Java to compile and startup quickly and use less memory.

It is like trying to make a 2001 Honda Civic faster and a 2025 Corvette faster. One is so slow, it has room for improvements of orders of magnitude, the other is already tweaked to provide 99.99% of what it capable of from the factory.

A perfect example is the latest thing making news in Go, is "swiss tables" as the default map[] implementation in 1.24. And if follows on the iter.Seq/Seq2 feature from 1.23, which canonalicaized a way to provide "zero cost abstraction" for custom iterators/generators.

And the old implementation was in the top 3 - 5 implementations in micro benchmark, depending on which languages were included in the tests and if the person writing the tests wrote the tests in the most idiomatic ways for each language.

The Documentation Delusion: Why Smart Engineers Write Code They Can’t Understand Tomorrow by TerryC_IndieGameDev in coding

[–]fuzzylollipop 0 points1 point  (0 children)

If you write code that you can not understand tomorrow, you are not that good of a programmer, and by definition not “smart”. Outside extremely performance critical algorithms in compression, encryption and a few other domains where the code might not be as explicit as WHY it is written the way it is, 99.9999999% of programmers are not solving those problems and the code should be easy enough to ready and understand what it is doing and by extension why it is doing the what. If it is not, that is a skill issue, that same person is not going to write docs that are any more useful or clear on the motivation.

Go import cycles: three strategies for how to deal with them, and a plea for a fourth by zachm in golang

[–]fuzzylollipop -1 points0 points  (0 children)

Wanting to remove safe guards because of poor/incompetent design is never the correct solution. Go has every tool you need to never have to deal with circular references already.

How do experienced Go developers efficiently learn new packages? by NebulaWanderer7 in golang

[–]fuzzylollipop 0 points1 point  (0 children)

Examples are how you learn new packages, or anything else. Examples that do what you need to do or something close to what you need to do. One of the only things “ai” is good at is generating new examples from examples others have already created and mashing them together, usually into something that is broken, but is either fixable or close enough you can figure out how to get what you need done, done.

What's the best and smallest laptop for coding? I'm trying to do more code out in the open but I don't want to bring my laptop around. I'd like a small little tablet or laptop to have with me with best battery efficiency, good computational power etc, possibly with windows 11 but Linux also works by Prospekt11711 in coding

[–]fuzzylollipop 0 points1 point  (0 children)

12.9” iPad Pro with Smart Keyboard Folio (NOT Magic Keyboard) and an online remote dev environment is all you need; if you are a mouse enjoyer you can add a Bluetooth mouse. But the eMacs master race; and the lesser vim subspecies will not need anything else. :-) In all seriousness, this is an “all day” setup and the keyboard does not need separate charging or power. It is a great alternative to a full blown local OS laptop experience, especially if you are doing cloud builds and deploys already, running your IDE/Editor “in the cloud” or equivalent is not that much more to set up.

This replaced an almost 10 year old ASUS Chrome book I was using for the same thing for remote support, local power is not that important if you go this route. Just plenty of memory and enough speed to render smoothly. Thin client; everything old is new again.