• 0 Posts
  • 217 Comments
Joined 11 months ago
cake
Cake day: August 4th, 2023

help-circle
  • I honestly fully believe that proprietary software is bullshit and all software ought to be Free Software. I’m not saying I don’t use proprietary software, but I don’t trust it. If I run proprietary software, I go out of my way to try to run it in prison. I don’t let my Nintendo Switch connect to the internet except when I have a very specific reason and then I disconnect it immediately after I’m done. When I bought a robot vacuum cleaner, I bought specifically the model that I knew I could hack to not phone home. I bought a phone on which I could run LineageOS without the Google apps. (And, yes, I’m running a proprietary EFI BIOS on my main desktop machine and such. But I do take a lot of steps to limit how much influence proprietary software has on me and my devices.)








  • map := map[string] int {}

    Not sure where you got your examples, but the spacing is pretty wonky on some (which can’t possibly help with confusion) and this one in particular causes a compile-time error. (It’s kindof trying to declare a variable named “map”, but “map” is a reserved word in Go.)

    var test int < bruh what?

    This article gives the reasoning for the type-after-variable-name declaration syntax.

    :=

    Lots of languages have a colon-equals construction. Python for one. It’s not terribly consistent what it means between languages. But in Go it declares and assigns one or more variables in one statement and tells Go to figure out the types of the variables for you so you don’t have to explicitly tell it the types to use.

    func(u User) hi () { … }

    That function (“method”, really, though in Go it’s more idiomatic to call it a “receiver func”) has no return values, so no return type. (Similar to declaring a function/method " void in other languages.)

    The first pair of parens says to make this “function” a “method” of the “User” type (which must be declared in the same package for such a function declaration to work.) The whole “when I call it like u.hi(), don’t make me pass u as a parameter as well as putting u before the period” thing also has precedent in plenty of other languages. Python, again, is a good example.

    Oh, and the second set of parens are where the function’s (non-receiver) parameters go. Your example just doesn’t take any. A function like func (u User) say(msg string) { ... }, for instance, could be called with u.say("Hey."). func (u User) ask(question string) string { ... } has a return type of string. So you could do var ans string = u.ask("Wuzzup?") or ans := u.ask("Wuzzup?").

    I can’t say I was ever too taken aback with Go’s syntax. Just out of curiosity, what languages do you have experience with?






  • I’ve run across AI content in non-AI subs before and responded with similar things fully expecting to be downvoted to Earth’s core and was pleasantly surprised at how few downvotes and how many upvotes I got. So I’ve made a habit of calling out AI stuff in non-AI communities when I run across it. (Unless it’s actually strongly related to the purpose of the community it’s posted in.)

    This is at least the third time I’ve made such a comment, and the first time I’ve seen a negative net score for more than a few minutes after I posted. Still, it’s pretty evenly split even on this one. Maybe most of the down-voters just don’t want anything negative said about “AI”. (Like cryptobros will deem anything “bearish” to be “FUD”.) Who knows.

    And there are places for engaging in mouth-foaming AI bubble hype indulgence on Lemmy. I just don’t want the communities I like inundated with tons of AI PR posts.






  • TootSweet@lemmy.worldtoLinux@lemmy.mlFavourite DE
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    1 month ago

    I currently use Sway primarily. On my work machine, I have to use Zoom, so I use i3 on X1q which acts/feels virtually identical to Sway. (Or rather, the other way around. Sway was made to be a Wayland compositor drop-in replacement for i3 which has been around for a long time.)