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.

eran_morad , in Guess what my favourite language is:

Gotta be R.

notsure , in Programmer tries to explain binary search to the police
@notsure@fedia.io avatar

everyone is a little bit gay!

belated_frog_pants , in huggingface.co

I dont get it

sin_free_for_00_days ,

AI leading us cavemen into the future.

kamen , in Unused variables

Imagine lint running on format and your linter removing unused variables: you start typing, hit format by muscle memory before using the variable. Rinse and repeat.

ExperimentalGuy , in The "Java Life" Song

This is so bad I can’t look away

LinearArray , in The "Java Life" Song
@LinearArray@programming.dev avatar

This goes hard

cruxialwd , in Unused variables
@cruxialwd@programming.dev avatar

Programming with Java be like :v

dylanTheDeveloper , in Unused variables
@dylanTheDeveloper@lemmy.world avatar

I’m not a CS major but why exactly does having a variable or parameter that’s not used in C, C# and C++ throw a warning

Prunebutt ,

It’s probably gonna be optimized out by the compiler. However, linters will mark it for you, since it suggests that you actually wanted to do something with that variable and forgot about it after declaration.

… Or it can be removed to reduce visual noise once it’s not necessary anymore after refactoring.

Shareni ,

Because it’s code that literally doesn’t do anything. Some languages won’t even let you compile without special instructions.

gens ,

Lets say you use a variable named abcd in your function. And a variable named abcb in a for loop inside the same function. But because reasons you mistakenly use abcd inside that loop and modify the wrong variable, so that your code sometimes doesnt work properly.

It’s to prevent mistakes like that.

A similar thing is to use const when the variable is not modified.

labsin , in Unused variables

I start writing the implementation and get the “variable not defined” error and then let the ide add the declaration. It’s less keys to press and misspell.

dojan , in Unused variables
@dojan@lemmy.world avatar

I recently started poking with Vue, For the most part when it comes to webapps I’ve mostly worked with React, Blazor, and a touch of Svelte. The linter is so aggressive. I start defining a method and it instantly goes “IT DOESN’T RETURN ANYTHING!!”

Okay, thanks! I literally just defined the return type!

morrowind , in Unused variables
@morrowind@lemmy.ml avatar

Word proccessors have had this figured out for ages, I wonder why it’s so hard to implement this QoL change for code

RagingRobot ,

How do you mean? You can’t type a word without using it in a word processor. Once the word is typed out it’s been used. Variables need to be declared then used so 2 separate steps.

ricdeh ,
@ricdeh@lemmy.world avatar

What do you mean? Variables do not necessarily need to be used, you can allocate memory for some value and initialise it but then simply don’t do anything with it.

DacoTaco ,
@DacoTaco@lemmy.world avatar

You can but compilers will optimise that away unless you tell it not to.

Shareni ,

Meanwhile go: you will remove it or I won’t compile, unless you know the secret handshake

RagingRobot ,

Yes you can but the little red squiggles show in your editor to warn you that it’s unused code. That’s what the whole post is about lol

morrowind ,
@morrowind@lemmy.ml avatar

There’s no direct equivalent but word like won’t bother me about spelling or grammar until I’m done typing that part

I_Has_A_Hat , in huggingface.co

Fun fact, that is canonically Spear, the caveman from Tartakovsky’s show Primal.

agamemnonymous ,
@agamemnonymous@sh.itjust.works avatar

Is it? He looks very different

entropicdrift ,
@entropicdrift@lemmy.sdf.org avatar

This episode of Dexter’s Lab first aired more than 20 years before the first episode of Primal (Feb 1998 vs Oct 2019). A bit of visual discrepancy is to be expected

Blue_Morpho ,

Primal is how Spear sees himself. Dexter’s Lab is how Dexter sees Spear.

southernwolf ,
@southernwolf@pawb.social avatar

Damn, I didn’t know that!

DoctorWhookah ,

That show was amazing. No dialogue to speak of. I really enjoyed it.

Morgoon ,

That is fun, the only other media I’ve seen like that is Quest for Fire (1981) starring Ron Pearlman

Klear ,

Flew under my radar. Gotta watch that. Which reminds me I still need to finish off Samurai Jack. I think I stopped somewhere in the last season of the old series and I want to watch that before I get to the new episodes, which I hear are excellent.

Of course, I’ll probably want to finish off the few lingering pieces of new trek. And I gotta watch all of that before second season of Arcane comes out, since that will take priority as soon as it comes out. And…

…fuck.

DoctorWhookah ,

TIL there is a second season of Arcane!

Klear ,

Not yet, but later this year. Hope it’s good.

DoctorWhookah ,

Thanks for being… Klear.

I’ll show myself out.

Klear ,

Please do.

natecox ,
@natecox@programming.dev avatar

Prioritize Primal. It is a truly unique and awesome show.

alphacyberranger ,
@alphacyberranger@sh.itjust.works avatar

I love Primal

SandbagTiara2816 , in huggingface.co

I don’t get it. Can you explain?

MrScottyTay ,

Go to the website and you’ll likely be the caveman

Korne127 ,
@Korne127@lemmy.world avatar

Can you explain what’s supposed to be so complicated about it?

MrScottyTay ,

If you don’t understand much about AI models, how they work, how to install/use them and unable to recover all of the specific jargon that comes with the field…

That site is very useful but it’s not a great starting point, it is not useful in the terms of understanding everything beyond just diving in the deep end and troubleshooting via external help forums like stack overflow regularly to figure it out.

virku ,

It’s basically github for large language models.

andnekon ,

not necessarily llms, just ml models

neo2478 ,

I also don’t get it, even more so after the two answers to your comments.

jnk ,

I’m starting to think that not gettimg it probably means we are the caveman, but how could I know, I’m just a caveman after all

breadsmasher ,
@breadsmasher@lemmy.world avatar

When OP visited huggingface, they felt very out of place- like a cave man being guided through dexters lab.

dudinax , in Unused variables

Me: <starts a heredoc>

jetbrains: This heredoc goes on FOREVER!

Me: I’m going to close it…

jetbrains: <dies>

kevincox , in Unused variables
@kevincox@lemmy.ml avatar

IDE is one thing, Go refuses to compile. Like calm down, I’m going to use it in a second. Just let me test the basics of my new method before I start using this variable.

Or every time you add or remove a printf it refuses to compile until you remove that unused import. Please just fuck off.

treechicken ,
@treechicken@lemmy.world avatar

VSCode with Go language support: removes unused variable on save “Fixed that compilation bug for ya, boss”

kevincox ,
@kevincox@lemmy.ml avatar

Like actually deletes them from the working copy? Or just removes them in the code sent to the compiler but they still appear in the editor?

FizzyOrange ,

Yeah IIRC it deletes them, which is as mad as you would expect. Maybe they’ve fixed that since I used it last which was some years ago.

jose1324 ,

Bruh that’s insane

FizzyOrange ,

Yeah I think it’s trauma due to C/C++'s awful warning system, where you need a gazillion warnings for all the flaws in the language but because there are a gazillion of them and some are quite noisy and false positives prone, it’s extremely common to ignore them. Even worse, even the deadly no-brainer ones (e.g. not returning something from a function that says it will) tend to be off by default, which means it is common to release code that triggers some warnings.

Finally C/C++ doesn’t have a good packaging story so you’ll pretty much always see warnings from third party code in your compilations, leading you to ignore warnings even more.

Based on that, it’s very easy to see why the Go people said “no warnings!”. An unused variable should definitely be at least a warning so they have no choice but to make it an error.

I think Rust has proven that it was the wrong decision though. When you have proper packaging support (as Go does), it’s trivial to suppress warnings in third party code, and so people don’t ignore warnings. Also it’s a modern language so you don’t need to warn for the mistakes the language made (like case fall through, octal literals) because hopefully you didn’t make any (or at least as many).

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