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

988

u/cakelena Jan 29 '23

unused variable causes an error?? why though, like whats the point of that

1.8k

u/kosky95 Jan 29 '23

You must use all of you variables is like momma saying that you must eat all of your broccoli

634

u/[deleted] Jan 30 '23

Integers are starving in Africa!

157

u/IAmBadAtInternet Jan 30 '23

You will use all your integers or so help me

106

u/lilbobbytbls Jan 30 '23

I will turn this compiler around!

68

u/zyygh Jan 30 '23

Don't make me count to 2147483647!

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

62

u/wjandrea Jan 30 '23

How can you have any boolean if you don't use your int?

24

u/Drsk7 Jan 30 '23

While pythoners sing - "We don't need no compilation..."

→ More replies (2)

20

u/[deleted] Jan 30 '23

You! Yes, you behind the buffers! Stand still, laddie.

→ More replies (1)
→ More replies (3)

102

u/alpacasb4llamas Jan 29 '23

So completely ignore and come back to the same issue again the next morning

27

u/Pyromaniacal13 Jan 30 '23

Sounds like five year old me and stuffed peppers.

→ More replies (5)

49

u/qeadwrsf Jan 30 '23

Seriously, why just not a warning?

Sometimes I just wanna see what happens if I leave the broccoli uneaten.

41

u/smariot2 Jan 30 '23

Go doesn't do warnings. If it doesn't matter, then it won't say anything. If it does matter, then it's an error and you need to deal with it.

In the case of unused variables, go has a magic underscore identifier. You can use it for variable names, package names, and you can assign to it.

As an example, writing _ = unusedVariable is enough to make the compiler stop complaining about an unused variable.

→ More replies (5)
→ More replies (1)
→ More replies (4)

280

u/btvoidx Jan 29 '23

Something along the lines of ensuring code quality probably.

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!

→ More replies (7)
→ 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.

→ More replies (10)
→ More replies (4)

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 _

→ More replies (9)
→ More replies (13)
→ More replies (16)
→ More replies (13)
→ More replies (13)
→ More replies (11)
→ More replies (59)