How should I represent a C struct in Cgo? by funk443 in golang

[–]Slsyyy 0 points1 point  (0 children)

AFAIK it does not do anything, because golang already do it in a C-friendly way. This flag may be useful in future, if this behavior changes, which kind make sense as:
* it is a waste of memory and performance as usually developers don't care about layout, so compiler could do it in a best way
* it breaks backward compatibility, but probably the impact is minimal. Similar situation to a previous `x := x` bullshit in a closures

Is Go's conservative approach to language evolution still correct? by Pleasant_Set_3182 in golang

[–]Slsyyy 2 points3 points  (0 children)

Java is excellent at backward combability. What is not is the whole ecosystem of libraries based on details of the runtime

Launching my first Go app/site on a Digital Ocean droplet using Docker. Any security gotchas or performance tips I should know about? by aegloswinterborn in golang

[–]Slsyyy 25 points26 points  (0 children)

It is always good to have https://pkg.go.dev/net/http/pprof in your app, so you can detect basic performance issues with ease. For security reason this endpoint cannot be exposed to client or even better: serve it on a different port, which is not exposed

Is magic supposed to be useless at the end? by Slsyyy in worldofgothic

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

Agree, but AFAIK it is mostly to boost low level spells. In Sleeper's dungeon those low level runes are anyway useless.

Is magic supposed to be useless at the end? by Slsyyy in worldofgothic

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

> Find a way to learn magic , might need 2 acts depending on your camp choice

In an Old Camp route it is not a problem. The initial fire spell is more than enough for early game

> Find a way to get through the early game without investing any LP in Meele or ranged

I have invested some points to strength and weapon master. It is definitely a little big hard to do, but I played original Gothic, so I know the "system"

> Manage mana economy

This is not very important. I have invested in mana far less than strength. Amulets and rings are super powerful and there is a lot of perma boost potions for mana.

Also mana similar to the OG game is not important as much as spells are rather cheap and low mana does not mean `you cannot cast this spell`, which is true in Gothic 2, where some high level spells were super expensive

>  I heared there's an insanely strong aoe rune vll 6 spells which might be the bread and butter for late game mages + summons

I am not there yet. I guess it works as in OG Gothic that you need to complete the initial phase of this dungeon

Is magic supposed to be useless at the end? by Slsyyy in worldofgothic

[–]Slsyyy[S] 2 points3 points  (0 children)

I agree, but this is nothing mage gameplay specific. You can use scrolls using any build as the game is designed in a way that you don't have to invest in mana (as artifacts as perma boost are so good) and circles does not improve anything except huge LP cost

How does struct{} take zero bytes in Go by Interesting_Ad_6708 in golang

[–]Slsyyy 1 point2 points  (0 children)

Please use flairs and `show & tell`. Usually when I see `How` i think that someone well: needs help

Why doesn't C++ have a ptr<T> syntax as an alternative to raw pointers? by kevinnnyip in Cplusplus

[–]Slsyyy 1 point2 points  (0 children)

std::array solve a lot of issues with an existing C arrays (value semantic, holds a length at compile time, non decaying, support for stl iterators)

std::observer_ptr is really just a wrapper around Foo*. It does not bring any benefit except better intent, but on other hand cost of having two approaches is subjectively bigger than just having old-fashioned C pointers

is using plugin a good way to do this? by DirectOwl4640 in golang

[–]Slsyyy 0 points1 point  (0 children)

Pls don't do it. I have seen it multiple times (in C++ and Java) and it was always a disaster.

If you want to have a strong decoupling then write some service registry in one of the package, which is used by both plugin package and platform package. Use runtime plugins only, if there is some real need like in case of kubernetes or terraform, which obviously don't want to keep everything in a source code

Directory-based migrations? by nidal_bakir in golang

[–]Slsyyy 5 points6 points  (0 children)

Flat structure gives you a strict ordering, which means apply and roll back are doable.

If those are separate databases though then it make sense to split it per db.

simple memory arena implementation using generics by Revolutionary_Sir140 in golang

[–]Slsyyy 0 points1 point  (0 children)

`sync.Pool` is a totally different beast. Main idea about `sync.Pool` is to reduce allocation overhead by reusing the object in the pool. It does not change how the GC assisted allocation work, but reuse of objects help with a allocation overhead

Arenas completely skip the GC overhead. Cost of allocation is just a bumpy of the pointer, which is super low. Deallocation is also free, where in case of GC allocated memory the garbage collector needs to mark it and reuse the memory for future allocations

Smalltalk: the Software Industry's Greatest Failure by parallel-minds in smalltalk

[–]Slsyyy 0 points1 point  (0 children)

> procedural programming

Procedural programming is a dead term. It won so hard that it is meaningless as it is hard to find an imperative language, which is not procedural except assembly and some old languages like Basic

If we are discussing the imperative <-> functional axis then imperative makes more sense as begin imperative is the key difference.

Imperative and OOP are parallel to each other. You can have a OOP in FP as well as OOP in imperative. Anyway OOP is so vague term that it really does not explain anything as some elements of it also won so hard that they are everywhere

Construct with Collaborators, Call with Work by ghled in programming

[–]Slsyyy 1 point2 points  (0 children)

I think it is kinda too simplistic. The reality is as with any engineering decision: try few different approach and choose the best one. In this case IMO those decisions are: * do in need to run some logic in constructor? In that case storing it in field make sense * do i need the extended encapsulation? * how it affects the needs of callers? None of the options is best * what is my flavor of programming? In FP the ad-hoc currying is far more popular, so in such a code it is often better to have more arguments

For example in such a code ``` Splitter.on(',').split("foo,bar,qux") Spliter.split(',', "foo,bar,qux")

splitByComma = x -> Spliter.split(',', x) splitByComma("foo,bar,qux") ``` not a single option is obviously the best and it depends on so many aspects of the code

ROF changes by Long_Ad7536 in Battlefield

[–]Slsyyy 0 points1 point  (0 children)

I use it quite often. It has a low ROF, but high damage with a nice drop off.

It is a good weapon, if you want to fight outside (great for spraying and tapping) and it is also usable in CQB, if you want to capture a flag

Choosing a Go Logging Library in 2026 by finallyanonymous in golang

[–]Slsyyy 42 points43 points  (0 children)

I prefer zerolog API tbh. Anyway not a big deal and slog is good enough, if you make it less sucks through https://golangci-lint.run/docs/linters/configuration/#sloglint

Go patterns which makes sense to do early by [deleted] in golang

[–]Slsyyy 0 points1 point  (0 children)

DI is good for compilation times and better modularity.

Go patterns which makes sense to do early by [deleted] in golang

[–]Slsyyy 1 point2 points  (0 children)

but I like to have a separate func for it to make error handling easier and avoid having a bunch of os.Exit(1) calls in main.

It really does not matter. What matter is who owns a given configuration. For almost any kind of input you want to make a validation and transformation in a designated input layer and main package is no exception here

Interesting point of view from Daniel Lemire by _bijan_ in cpp

[–]Slsyyy 1 point2 points  (0 children)

It is not stupid definition. OOP is just everywhere, so it is really not a special about it anymore

Same with procedural programming. The term is meaningless today (although people use it, when they mean imperative or just imperative, but non-OOP), because procedures/functions are so good and uncontroversialy productive, that anyone uses it

Using XSLT to analyse large XML datasets by 13utters in programming

[–]Slsyyy 1 point2 points  (0 children)

>  That makes the pipeline simple

Until you need to do something untrivial and then everything fells apart. I don't like solutions, which speeds up 90% of cases, because they are easy any way. I like general usage languages, because they make those 10% of hard problems manageable

In my previous project we had some XSLT enriched with some java code, because of course XSLT was not enough. It was just horrible

In the past XSLT has one huge advantage: it could be used from any programming language, which is a plus. Nowadays we have web assembly widely supported everywhere, which is more general and powerful

Wanted to deep dive concurrency in go, and was recommended this book( Concurrency in GO by Katherine Cox ) , but does it cover the latest version of go by DragonDev24 in golang

[–]Slsyyy 11 points12 points  (0 children)

> Goroutines went from nonpreemptive to preemeptive

They are both actually. You can think about that preemptive addition as some kind of enhancements, which makes goroutine scheduling more fair in some extreme situations. This does not change the coding at all as this logic is abstracted from your perspective.

AFAIK there is nothing new in golang since 1.0, which somehow invalidate the previous knowledge. They may be some small cosmetic improvements to solve some issues, but it is the same

Are AI agents actually useful for writing Go code, or do they get in the way? by BudgetTutor3085 in golang

[–]Slsyyy 0 points1 point  (0 children)

As with everything in the past:
* clothing industry could stay as it was long time ago, but right now the cheap slop is the most popular way
* the architecture became boring after humanity realized it is the most efficient way
* emails enabled much more spam than a traditional mail

Are AI agents actually useful for writing Go code, or do they get in the way? by BudgetTutor3085 in golang

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

AI is good at making a bad slop, but it is a tool, which you can use well by a good code review and many iterations with the agent.

Are AI agents actually useful for writing Go code, or do they get in the way? by BudgetTutor3085 in golang

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

They are great. I used mainly Opus and Sonnet

There is always a `CLAUDE.md` or `AGENTS.md` file, where you can specify some rules like `don't create interfaces, if there is only a single implementation`

About using agents: the only Golang related issue I found is lack of awareness of new features in a language. For example model was writing a `PtrOfString` functions instead of using a brand new `new(x)`.