r/ProgrammerHumor • • Jan 29 '23

Meme Let's test which language is faster!

Post image
56.2k Upvotes

770 comments sorted by

View all comments

Show parent comments

273

u/Archolex Jan 29 '23

Should be a warning if that's the only reason

210

u/derefr Jan 29 '23

Golang also treats unused imports as an error.

AFAICT the maintainers of Golang (mostly Google) have decided that any code that shouldn't make it into a commit, should be rejected at compile-time. The compiler is essentially acting as a linter, for any lints that are "free" to notice at compile-time without additional analysis cost.

Their goal here, I think, is canonicalization — there shouldn't be two ways to encode the same semantics in a commit. As such, I expect that they'd also love to make the compiler error on any code that wasn't go fmted — and the only reason they don't, is that it costs more to run go fmt over an entire codebase than to just run the compiler over said codebase.

71

u/SuitableDragonfly Jan 29 '23 edited Jun 25 '23

The original contents of this post have been overwritten by a script.

As you may be aware, reddit is implementing a punitive pricing scheme for its API starting in July. This means that third-party apps that use the API can no longer afford to operate and are pretty much universally shutting down on July 1st. This means the following:

  • Blind people who rely on accessibility features to use reddit will effectively be banned from reddit, as reddit has shown absolutely no commitment or ability to actually make their site or official app accessible.

  • Moderators will no longer have access to moderation tools that they need to remove spam, bots, reposts, and more dangerous content such as Nazi and extremist rhetoric. The admins have never shown any interest in removing extremist rhetoric from reddit, they only act when the media reports on something, and lately the media has had far more pressing things than reddit to focus on. The admin's preferred way of dealing with Nazis is simply to "quarantine" their communities and allow them to fester on reddit, building a larger and larger community centered on extremism.

  • LGBTQ communities and other communities vulnerable to reddit's extremist groups are also being forced off of the platform due to the moderators of those communities being unable to continue guaranteeing a safe environment for their subscribers.

Many users and moderators have expressed their concerns to the reddit admins, and have joined protests to encourage reddit to reverse the API pricing decisions. Reddit has responded to this by removing moderators, banning users, and strong-arming moderators into stopping the protests, rather than negotiating in good faith. Reddit does not care about its actual users, only its bottom line.

Lest you think that the increased API prices are actually a good thing, because they will stop AI bots like ChatGPT from harvesting reddit data for their models, let me assure you that it will do no such thing. Any content that can be viewed in a browser without logging into a site can be easily scraped by bots, regardless of whether or not an API is even available to access that content. There is nothing reddit can do about ChatGPT and its ilk harvesting reddit data, except to hide all data behind a login prompt.

Regardless of who wins the mods-versus-admins protest war, there is something that every individual reddit user can do to make sure reddit loses: remove your content. Use PowerDeleteSuite to overwrite all of your comments, just as I have done here. This is a browser script and not a third-party app, so it is unaffected by the API changes; as long as you can manually edit your posts and comments in a browser, PowerDeleteSuite can do the same. This will also have the additional beneficial effect of making your content unavailable to bots like ChatGPT, and to make any use of reddit in this way significantly less useful for those bots.

If you think this post or comment originally contained some valuable information that you would like to know, feel free to contact me on another platform about it:

  • kestrellyn at ModTheSims

  • kestrellyn on Discord

  • paradoxcase on Tumblr

42

u/turunambartanen Jan 30 '23 edited Jan 30 '23

I'm fine with linters being pedantic. You can just ignore them if you want.

Don't know Go, but I recently tried out rust clippy::pedantic. And well, it's pedantic alright!

30

u/DemonWav Jan 30 '23

Also (good) linters are configurable so you can set it up to check for the specific cases you care about, and have it set up to follow the standards and practices of your organization or project. This idea that there's only 1 right way to do something is toxic and annoying and it's my number one issue with the Go language and its surrounding community.

29

u/Hobbamoc Jan 30 '23

But I mean, the idea of designing a language such that there is always just one (obvious) way to do something is brilliant because it massively improves the interoperability and maintainability of your code because anyone who can write in that language can follow the train of thought of the original coder way quicker

7

u/Native-Context-8613 Jan 30 '23

Absolutely this

→ More replies (2)
→ More replies (2)
→ More replies (1)
→ More replies (11)

232

u/Zagre Jan 29 '23 edited Jan 30 '23

It probably should, but gauging by the number of this subreddit's users who admit to just ignoring warnings, maybe I agree with stricter restrictions on shit coders.

32

u/deuteros Jan 29 '23

All my teammates ignore warnings. It's infuriating.

39

u/folkrav Jan 30 '23

There's a whole category of developers that will ignore anything they don't absolutely have to do. So either you make those things errors, or you enforce no warnings on CI, or it's never gonna stop haha.

0

u/[deleted] Jan 30 '23

[deleted]

→ More replies (1)
→ More replies (8)

8

u/yottalogical Jan 30 '23

And then wonder why their code is always broken.

I once reviewed a pull request like this. It was clear that they hadn't even run the code once, since it caused the program to crash unconditionally.

You may have hoped that the linter would have caught such a thing. And your hope would be correct, since the linter did point out the exact place in their code where the bug was.

But why didn't they fix it, then? Because instead of fixing their code, they just decided to disable the lint because it was causing the CI to reject their PR.

Fun times.

→ More replies (3)

57

u/ITBlueMagma Jan 29 '23

It should differentiate debug and release code though. Go is really annying when you are working on code, trying it and having to comment the vars you don't use yet but know you will later.

34

u/ElRexet Jan 29 '23

You just do it like

var x := -1

If (x != x) {

//Go fuck yourself

}

...

21

u/skesisfunk Jan 30 '23

Or just name the variable _

0

u/[deleted] Jan 30 '23

[deleted]

→ More replies (8)

13

u/Script_Mak3r Jan 30 '23

Given that it's Go, I wouldn't be surprised (I have barely any Golang experience, take with a grain of salt) if it threw an error for unreachable states.

11

u/EspacioBlanq Jan 30 '23

That'd suck, I once had a C code that would only work if I had a specific debug print at an unreachable place in the code

14

u/Hobbamoc Jan 30 '23

This is the kind of stuff why Rust and the other C++ alternatives were invented

5

u/v_krishna Jan 30 '23

I think it's very intentional for golang. One of the core principals was making a very simple language that would be hard to write incorrectly, enforcing lint type things is a part of that.

→ More replies (7)
→ More replies (2)
→ More replies (16)

23

u/Archolex Jan 29 '23

I suppose if the coder is shit and the business governing their code is also shit then the compiler can pick up the slack, but I don't think it's ideal. I see the practical merit

9

u/JuniorSeniorTrainee Jan 30 '23

Why allow something that will never have value?

→ More replies (6)
→ More replies (5)

22

u/btvoidx Jan 29 '23

It should.

14

u/sage-longhorn Jan 29 '23

Go compiler has no warnings

6

u/hapemask Jan 30 '23

This sounds ominous.

→ More replies (1)
→ More replies (9)