Top
Best
New

Posted by xngbuilds 2 days ago

Just Use Go(blainsmith.com)
214 points | 203 commentspage 6
antonvs 2 days ago|
If you like a sort of weakly-typed version of Python or PHP, use Go. As the article points out it can be good for web forms. Not all development is web forms.
leetrout 2 days ago||
Strange position to take. Python and Go are both duck typed but given Go has compile time type checking it is providing another layer of safety. Could you add more detail supporting your stance?
antonvs 15 hours ago||
I expressed that poorly. I'm saying Go adds a weak type system. Too weak for its own good. No sum types is the first dealbreaker. Even C had unions.
em-bee 2 days ago||
how is go a weakly typed version of python or php? or even more generic, how is go weakly typed? explain please.
zbentley 1 day ago||
I suspect that this is breaking type systems out onto separate axes: strong/weak and static/dynamic. Many consider Python to be strong/dynamic.
em-bee 17 hours ago||
depending on the definition of static and dynamic, go could arguably be described as static (personally, i prefer declarative, as static is generally defined as something that i understand to be true for C but not for go), but that still does not make it weak.
antonvs 15 hours ago||
I'm saying Go has a weak type system. This was apparently an intentional choice by the authors. Go doesn't even have sum types, which are an extremely basic, foundational feature of type systems. Even C had an equivalent in its union types.

"Weak type system" means that there are many restrictions on what constitutes a valid program that can't be expressed in Go, that can be expressed in languages with stronger type systems, like Rust, Haskell, or even Java and C#.

em-bee 6 hours ago||
ok, fair enough, what actually interests me is why in your opinion it is weak.

in my understanding, weak typing comes from values being interpreted differently or are silently converted based on how they are used. php taking strings with numeric values when used in a math operation is a form of weak typing.

if that is not what you mean then you are using a different definition for weak typing. that's ok, i don't want to argue about what is the right definition, but i am interested in the definition you are using.

antonvs 4 hours ago||
I was just using "weak" in the ordinary English sense, as in "not powerful". But you're right, that's confusing because of existing terminology.

I should have said that Go has a less expressive type system, i.e. the expressivity of its type system is weak.

It has no sum types, no algebraic data types, no real pattern matching, and limited generic constraints. And of course if we compare it to much more expressive type systems, which is a bit unfair because none of them are mainstream, it has no higher-kinded types, no dependent types, and no refinement types.

As for "true" weak typing, the idiomatic use of `any` (`interface{}`) in Go comes pretty close. While languages with more expressive type systems will often have some way to express that general concept, it's typically more constrained, more friendly to static checks, and less unsafe, because of the some of the other properties I mentioned, such as pattern matching where the compiler will warn you if you're not properly checking a value before unsafely accessing it.

The reason for my comment about Python and PHP is because to me, programming in Go feels little different in programming in those languages along with one of the bolted-on static checkers they have - you don't get anywhere close to the same level of static guarantee of correctness of programs. It's difficult to implement Yaron Minsky's adage "make invalid states unrepresentable" in Go's type system, and that's unfortunate.

azangru 2 days ago||
I know it doesn't matter, but...

...who invented this letter-casing convention?

    import (
        "embed"
        "html/template"
        "net/http"
    )

    //go:embed templates/*.html
    var files embed.FS

    var tmpl = template.Must(template.ParseFS(files, "templates/*.html"))
why is the name of a module lower-cased

but the names of functions accessed via its namespace upper-cased?

how does this make sense?

lanstin 2 days ago||
Upper case symbols in a module are exported. Everything else should be lower case.
azangru 2 days ago||
Oh; in that case the lowly Javascript/typescript does this so much cleaner with the explicit `export` keyword. "Explicit is better than implicit."
x0re4x 2 days ago||
Go language is explicit: identifiers starting with a capital letter are exported.

https://go.dev/ref/spec#Exported_identifiers

pixel_popping 2 days ago||
Rust (just swap the linker) > Go. Thank you, rewrite the article please.
bschwindHN 2 days ago||
> the race detector will tell you when you screwed up.

lol

> if err != nil {

lmao

> defer rows.Close()

Oh dear

...

I'm only poking fun, I'll take a go backend any day over most of the alternatives. Same goes for CLI tools.

Koffiepoeder 2 days ago||
Hey dipshit,

Maybe I develop games. Maybe I develop IoT devices. I might even be working in a high-stakes environment where formal verification is needed, who knows.

Whatever the case may be, we all have our reasons for choosing certain technologies. Not everyone is building run-of-the-mill 'backends' after all.

So please, let's stuff that neckbeardy arrogance away. It serves no purpose and distracts from the discussion.

Thanks.

P. s. I develop my backends in go.

elevation 2 days ago||
> and doesn't shit itself when a transitive dependency gets yanked from npm

For non-trivial golang apps you're still gonna find npm in the mix. I recently packaged forgejo, yopass, and a few others, and if you don't have `npm` on the build machine, the resulting daemon won't serve the front end.

nohell 2 days ago||
archived: https://nonogra.ph/just-fucking-use-go-05-08-2026
binary132 2 days ago||
I’m so tired of AI slop baitposting, guys.
fofoz 2 days ago||
[dead]
maxalbarello 2 days ago|
[flagged]
More comments...