There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

jalda , in The Password Game

“Your password must include the URL of a 23 minute 42 second long YouTube video.”

lol

canpolat OP ,
@canpolat@programming.dev avatar

Careful with Paul. He may starve.

rockyTron ,
DonjonMaister ,
@DonjonMaister@programming.dev avatar

I quit after I got that…

where_am_i , in No Scrum - Parody of TLC "No Scrubs"

deep into YouTube?

blomkalsgratin , in Shower thought:

But is it web scale?

tja OP ,
@tja@sh.itjust.works avatar

For webscale you might want to use mongodb

Edit: oh shit. This is old.

blomkalsgratin ,

Does it require a lot of configuration though? Does it work?

NegativeLookBehind , in No Scrum - Parody of TLC "No Scrubs"
@NegativeLookBehind@kbin.social avatar

No.

LawfulPirate ,
@LawfulPirate@sh.itjust.works avatar

I don’t want no scrum

ruffsl OP ,
@ruffsl@programming.dev avatar

Scrum 's a thing that can’t get no love from me

HiddenLayer5 , (edited ) in Golang be like

Sometimes I think Go was specifically made for Google to dictate its own preferences on the rest of us like some kind of power play. It enforces one single style of programming too much.

philm ,

Is this a hard error? Like it doesn’t compile at all?

Isn’t there something like #[allow(unused)] in Rust you can put over the declaration?

flame3244 ,

Yes it is a hard error and Go does not compile then. You can do _ = foobar to fake variable usage. I think this is okay for testing purposes.

nomadjoanne ,

Ew, that’s awful. Go is not one of my programming languages but I had always held it in high esteem because Ken Thompson and Rob Pike were involved in it.

flame3244 ,

Honestly, it does not happen often that I have a ln unused variable that I want to keep. In my mind it is the same thing when wanting to call a function that does not exists. Also my editor is highlighting error Long before I try to compile, so this is fine too for me.

merc ,

That’s the main reason it has had any success. It’s not that it’s a good language, it’s just that it has good references.

MonkCanatella ,

I think that’s even worse because it increases the likelihood you’ll forget you faked that variable just for testing

flame3244 ,

Worse than not having a unused variable check at all? Dunno, the underscore assignment are very visible for me and stand out on every code read and review.

AeonFelis ,

Yes, worse, because now if you want to use the underscore assignment to indicate that you really want to discard that variable - it gets confused with underscore assignments that were put there “temporarily” for experimentation purpose.

merc ,

Exactly.

Say I’m having some issue with a function. I comment out half the function to see if that’s where the weirdness is. Golang says “unused variable, I refuse to compile this dogshit!” I completely fool Golang by just using _ = foo. Yes, I was correct, that’s where the problem was. I rewrite that section of the code, and test it out, things work perfectly. Only now, it turns out I’m not using foo anymore, and Golang has no idea because I so cleverly fooled it with _ = foo.

Now, something that could be caught by a linter and expressed as a warning is missed by the language police entirely, and may make it into production code.

Police the code that people put into a repository / share with others. Don’t police the code that people just want to test on their own.

AstridWipenaugh ,

The underscore is used in production code too. It’s a legitimate way to tell the compiler to discard the object because you don’t intend to use the pointer/value.

HiddenLayer5 , (edited )

Never really coded in Go outside of trying it out, but as far as I know it’s a hard error.

space_comrade ,

From what I’ve heard from Google employees Google is really stringent with their coding standards and they usually limit what you can do with the language. Like for C++ they don’t even use half the fancy features C++ offers you because it’s hard to reason about them.

I guess that policy makes sense but I feel like it takes out all the fun out of the job.

frezik ,

As far as C++ goes, that’s probably the only sane way to use the language.

Sloogs ,

Just about any place I know that uses C++ also does that with C++ so that’s nothing unusual for C++ specifically. It’s too big of a language to reason about very well if you don’t, so you’ve gotta find a subset that works.

skeletorsass ,

Too many patterns. If you do not do this every author will have a different use of the language and you will have to read a book of documentation each time you change files.

flame3244 ,

I think this is a good thing. The styles are just opinions anyway and forcing everyone to just follow a single style takes a lot of bikeshedding away, which I really like.

Crashumbc , in Golang be like

The best part of these threads is no matter what someone comments, at least 2 people will reply either correcting or “clarifying” the original commenter.

Lol

dudewitbow , in Shower thought:

I couldnt even imagine trying to port any non assembly language to circuits in verilog.

hardware26 ,

It is easier to implement ALU, memory and interpreter in Verilog and run the code with that at that point.

jeanma , in Golang be like

OP never said he/she commits such code but wants to iterate, test, explore.

Of course, unused var should not be part of a commit.

darvocet , in No Scrum - Parody of TLC "No Scrubs"

The third one with the hot voice is pretty cute.

DarkDarkHouse , in Golang be like
@DarkDarkHouse@lemmy.sdf.org avatar

As your future colleague wondering what the hell that variable is for, thanks Go.

MJBrune ,

A quick “find all references” will point out it’s not used and can be deleted if it accidentally gets checked in but ideally, you have systems in place to not let it get checked into the main branch in the first place.

Flarp ,

Yeah that should be looked for in a CI line check, not a compilation requirement

anemoia_one , (edited )

Yeah any compiler should support environments or config files. Our CI would never work with without –env “stage”

aport ,

You mean a system like the compiler

MJBrune ,

Or a linter. Or code reviews. Or anything else. The nice thing is that if the compiler doesn’t demand something, it can be given to the engineer as an option. The compiler should have the option to do it. The option could even be defaulted on. Afaik there is no way in Golang to disable that error (this is the line that does it: github.com/golang/go/blob/…/stmt.go#L67-L69). like --no-pedantics or such. Golang’s compiler openly refuses to give engineers more choices in what they think is the best system to handle it.

aport ,

Who needs an option to leave unused variables around the code base? Lazybones?

MJBrune ,

You’ve literally never commented out a line or two but left the variable declaration while debugging?

iforgotmyinstance ,

Changing it will bring down the entire system.

We’ve spent ten million dollars and do not know why.

Nioxic ,

Isnt the syntax highlighting it as mever used?

So why would they wonder?

Camilo ,

If it is a pure value, I’d assume yes, but if it is tied to a side effect (E.g. write its value to a file), then it would be not used but still could break your app if removed.

I’m not familiar with rust language specifically, but generally that’s what could happen

Willem ,

I prefer for it to be just a warning so I can debug without trouble, the build system will just prevent me from completing the pull request with it (and any other warning).

ennemi ,

If only there was some way the compiler could detect unused variable declarations, and may be emit some sort of “warning”, which would be sort of like an “error”, but wouldn’t cause the build to fail, and could be treated as an error in CI pipelines

CoderKat ,

Let’s not pretend people acknowledge warnings, though. It’s a popular meme that projects will have hundreds of warnings and that devs will ignore them all.

There’s a perfectly valid use case for opinionated languages that don’t let you get away with that. It’s also similar to how go has gofmt to enforce a consistent formatting.

ennemi ,

You can, if you want, opt into warnings causing your build to fail. This is commonly done in larger projects. If your merge request builds with warnings, it does not get merged.

In other words, it’s not a bad idea to want to flag unused variables and prevent them from ending up in source control. It’s a bad idea for the compiler to also pretend it’s a linter, and for this behaviour to be forced on, which ironically breaks the Unix philosophy principle of doing one thing and doing it well.

Mind you, this is an extremely minor pain point, but frankly this is like most Go design choices wherein the idea isn’t bad, but there exists a much better way to solve the problem.

iammike ,

Some people simply ignore warnings, that’s the main issue. Trust me, I saw this way too often.

If you cannot compile it than you have to fix it, otherwise just mark unused variables as ‘not an error’ via _ = someunusedvar.

masterairmagic , in Golang be like

Go is not a programming language. It’s an angry rant of a bored Google engineer.

AeonFelis ,

IDK, Brainfuck is still classified as a programming language and Go is not that far behind it.

lowleveldata , in The superior bracket style

ok cool do whatever you want. Imma put in a pre-commit hook to auto format everything.

sociablefish ,

im gonna install my own reformatter to reformat it back on my machine, win-win

katre , in Who is this "Jenkins" and what now has broken him?

Ha ha. I work on Bazel (a great build tools, bazel.build), and I agree 100%.

dingleberry ,

God I hate bazel/blaze.

katre ,

Thanks? I’m not sure why you wanted to share that with me.

lukini ,
@lukini@beehaw.org avatar

You shared randomly, they shared randomly. Balance in all things.

socsa ,

Hey buddy can you step over here, there’s a very tall cliff I want you to see

AzzyDev ,

Please ignore everyone else being unkind - I’m somewhat new to build systems in general, what are the advantages/disadvantages of Bazel compared to other build systems?

cthonctic , in No Scrum - Parody of TLC "No Scrubs"
@cthonctic@kbin.social avatar

It's very funny for sure and I was just about to share it with the other SWEs in our off-topic chat. But I just can't listen to it, had to close the tab after like 50 seconds. Perhaps on mute and with CC?

ericskiff ,

You made it 45 seconds longer than I did. Still waiting for my hair to stop standing on end.

cthonctic ,
@cthonctic@kbin.social avatar

I really tried hard to persevere - but I'm weak and it was too much.

bappity , in Pick a side Javascript
@bappity@lemmy.world avatar

NaN

Ddhuud , (edited )

!NaN

(Translation: I agree)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • [email protected]
  • lifeLocal
  • goranko
  • All magazines