Karyoplasma @discuss.tchncs.de if (error) { continue; }
109 0 ReplyFooBarrington @lemmy.world try { operation(); } catch { // nice weather, eh? }
75 1 ReplyKaryoplasma @discuss.tchncs.de Starting with Java 21 (I think), they've introduced ignored variables, so you can now actually do this:
try { operation(); } catch (Exception _) { // nice weather, eh? }
Edit: forgot that this is about JS lel
14 0 ReplyDjMeas @lemm.ee âď¸ PR Approved
10 0 ReplyMajorHavoc @programming.dev Thanks. I hate it.
5 0 Replylengau @midwest.social with contextlib.suppress(BaseException): do_thing()
3 0 Reply
Willem @kutsuya.dev On Error Resume Next
Visual Basic is a beautiful language
19 0 ReplyKnock_Knock_Lemmy_In @lemmy.world On error goto 0
Was always syntacticly confusing for me.
5 0 Replyrunner_g @lemmy.blahaj.zone I legitimately use this line in one of my scripts because range.find returns an error of the value is not found. The use case is taking a 2d matrix saved as an array, with data collected from multiple excel tabs and rearranging it for a CSV upload into Salesforce. The initial array contains values that the rest of the data does not have, so when I search for a non existent value, I can skip the error.
Of course vba COULD just implement try/catch statements and that'd be so much cleaner, but alas.
1 0 Reply
Nicht BurningTurtle @feddit.org
If I can't see it, is it really there?
64 0 ReplyHipsterTenZero @dormi.zone
58 0 ReplyMaggiWuerze @feddit.org
If it wanted to get my attention it should have been an error
57 0 Replycbazero @programming.dev If it works, it works
49 1 Replybreakingcups @lemmy.world I would add: until it doesn't.
32 0 ReplyIsoprenoid @programming.dev This is why:
"It ain't stupid if it works."
is fundamentally incorrect.
25 0 Replylimer @lemmy.dbzer0.com Sometimes itâs better to hope while closing eyes
10 0 Reply
SaharaMaleikuhm @feddit.org Eh it's Javascript. Anything goes
39 1 Replyperviouslyiner @lemmy.world coldsideofyourpillow @lemmy.cafe this is fucking gold
12 0 Reply
irelephant [he/him]đ @lemm.ee OP
Yeah, array.length is mutable in javascript. I'm surprised it caught on.
5 0 Replylesnout27 @feddit.org If i can just suppress the warnings which need to be fixed till morning in my buggy code, anything goes!
2 0 Reply
Jack Hughman @lemm.ee
Warnings are for ignorings :3
38 0 Replyi_stole_ur_taco @lemmy.ca Warnings? Weâll come back and address those later. Maybe once weâre feature complete. Or maybe shortly after that.
33 0 Replyjubilationtcornpone @sh.itjust.works Don't worry. We'll totally fix all of them soon. Promise. Hand to God. They definitely will not be here five years from now.
9 0 Reply
pscamodio @feddit.it Meanwhile in another universe one of my biggest win was to introduce this line in our PR validation pipeline.
eslint . --max-warnings 0
25 0 Replyskuzz @discuss.tchncs.de Works so well, and soothes the warning annoyance brain, and keeps warnings from eventually becoming errors.
3 0 Replypscamodio @feddit.it In a codebase with a lot of warnings is even better for me to add a disable comments for all the existing warning and then not allow any new one in.
And then each time a part of the code needs to be touched the existing warning there should be solved too.
3 0 Reply
coldsideofyourpillow @lemmy.cafe Actually fixing warnings is for noobs
22 0 Reply1rre @discuss.tchncs.de if they mattered they'd be errors I'm sure
31 0 Replycoldsideofyourpillow @lemmy.cafe That's when you do CTRL+C, CTRL+V
2 0 Reply
Classy @sh.itjust.works I, too, place
2> /dev/null
after every line17 0 ReplyBillegh @lemmy.world Yes, but
2>&1 > /dev/null
is the real hero.5 0 Replyfar_university190 @feddit.org No,
> /dev/null 2>&1
is. If try your example but with file instead null, stderr content not in file.Because x>y not redirect x to y, but duplicate y and set x to y-duplicate. See bash manpage REDIRECTION (your example in that section for what not work).
As i understand, your example set 2 to what 1 is, then set 1 to null. Now 2 not null, but what 1 before.
2 0 Reply
Phoenix3875 @lemmy.world edit: works better when used together with
StackOverflow.comment.enabled = false;
10 0 Replywizardbeard @lemmy.dbzer0.com
-ErrorActionPreference SilentlyContinue
8 0 ReplyMajorHavoc @programming.dev --yolo
5 0 Reply
brlemworld @lemmy.world I don't get it. This isn't funny. I wouldn't approve it in merge request. Most wouldn't.
2 0 Replyskrlet13 @feddit.cl
Trying to hide problems and incompetence is the joke. A lot of people don't want problems solved, they just don't want to see them, and will take the easy route. If you just want that, this is the easy route.
Incompetent? Absolutely, that's the joke.
8 0 Reply