Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×

Comment Re:why? (Score 1) 677

Yes, really.

I stopped using GOTO when I moved beyond GW-Basic some 25 years ago. And I've used plain ol' C for the majority of the code I've written in my life. And yes, FWIW, I've written firmware - Low-level coding, unless done in assembly, doesn't give you a pass on flagrantly breaking the built-in flow control devices of a language.

If you need to resort to a GOTO, you did something wrong before you ever typed your first "#include ...". Simple as that. Yes, you can defend various uses of it, and no, most of them probably don't merit invoking Dijkstra's Wrath. Most of them don't count as outright harmful, just unneccessary. But for every use case you can come up with, I can give you a non-GOTO way of handling every... single... one. As I mentioned, I've re-written plenty of code to remove the GOTOs from it. You just don't need them, period.

Comment Re:why? (Score 1) 677

The more copies you make of a block of code, the higher the probability that you'll miss one of them when you later have to modify that block of code.

Not sure what you mean by "copies" - In that example, you have only a single cleanup section, in the calling function rather than in the called function - You've basically split the problematic code into two pieces to let the stack itself unwind most of the problem naturally, rather than needing to jump around to various no-context error handling blocks.

Comment Re:why? (Score 1) 677

Assuming we don't write this in a language with some variant of either "using" or "finally" syntax... You still have two alternatives in cases where you have cleanup that needs to occur unconditionally.

The first (which I often opt for, myself) - Put it in the caller:
foo = BuildUpFragileStatefulStuff();
result = myEasilyBrokenHugeBlockOfConditions(foo);
if(result==OhShit) {foo.unwind(); foo.cleanup(); foo.bar(); foo.close(); foo.dispose(); foo=null;}

And the second, for when you have lot of cleanup - Put it in its own function:
foo = BuildUpFragileStatefulStuff();
...
if(ThisCondition==BadMojo) return(UnFuckify(foo));


I really cannot think of a scenario where one of those leads to less clarity or more redundancy than replacing them with "Goto OhShit"

Comment Re:why? (Score 3, Interesting) 677

How many levels of nested if blocks are you willing to tolerate solely in the name of avoiding a single use of the keyword goto?

If GOTO would actually alleviate that problem for you - You've already done something very, very wrong.

I have written a lot of code in my life - Thousands of projects, millions of lines of code (for whatever that means), across a dozen languages and twice as many platforms. And outside Assembly (and DOS batch, if you want to count that as a "language"), I have not ever encountered a situation where I thought to myself "gee, I could really improve this with a GOTO, if only everyone wouldn't laugh at me for it".

I have, however, removed some pretty heinous uses of GOTO from other people's code. The most common one I see, people can't quite bring themselves to "return" from an error handler in the middle of a function, so they instead GOTO the end of it. Really??? Talk about missing the forest for the trees!

I don't think I would so much call GOTO "harmful", so much as "completely unnecessary in any modern language".

Comment Re:The vaccines CAUSE the problem (Score 1) 297

Comment Re:foreign invasion (Score 5, Informative) 297

Although we may agree on the need for less porous borders, the CDC actually has solid data on the causes of outbreaks like the current one. And, they don't typically start with "foreign invaders" - They start with unvaccinated legal US citizens going on vacation and coming back infected.

So yeah, idiots choosing not to vaccinate, whether because Jenny or Jesus said so, do count as the entire problem.

Comment Re:Silly Question (Score 1) 159

Ah, I've figured out where we diverged in our discussion - You refer to a secret law, whereas I only meant secret warrants.

In that case, I suppose you have a valid argument, but still, kinda tough to enforce secret laws - When Google gets an NSL, as its very first step it would have its army of lawyers decide the legality of the order. If its lawyers don't know about secret law X that compels a company to lie, they would advise Larry and Sergey to use it as toilet paper.

So even if that order held up in court (though, how do they find a prosecutor and defender who know the law well enough to debate it?), we would have heard about it already from the first few companies who told FISA to go pound sand. Since we haven't, we can conclude that at least that particular secret law doesn't exist (not to say others don't, of course).

Comment Re:Cue the libertarian fucktards (Score 1) 379

Riiiight. Because it totally makes sense to let all comers string their own wires, bury their own fiber, etc. That doesn't need any regulation at all.

Funny thing about that... I currently use 4G as my primary ISP, because the local cable monopoly decided my town won't make them any money. Not "my town won't let them steal my front yard to run wires", but "no one wants to steal my front yard to run wires". Except, adding insult to injury, I still have my front yard "occupied" by a utility pole, for power lines. Wow, best of both worlds!

So in this case, yes, the market has actually managed to beat the government-sanctioned monopolies in addressing the "last mile" problem, for me at least. Though make no mistake, I don't consider Verizon any better than Comcast - Just a rare example of two once-upon-a-time monopolies in different markets accidentally managing to compete with each other in an otherwise-unexpected ballpark. Make no mistake, I'd give my left nut to have Google offer FTTP in my town, but that detail does more to *make* my point than refute it.

Comment Re:Silly Question (Score 1) 159

Yeah, I got that part - So what, exactly, stops every non-warrant-receiving hungry young JD fresh out of school from pointing out that the EFF has it (hypothetically) wrong?

The "indistinguishable" part only works under two conditions:

1) They can force people to lie, and
2) Every lawyer in the country has an NSL against them ordering them to lie about point #1.

Otherwise, my original point holds - Organizations the size of the EFF can't just make things up and get away without someone calling them on it.

Comment Re:Cue the libertarian fucktards (Score 1) 379

Ahhh...so you only agree with government regulation when it supports your own agenda...I see.

Force AT&T and Comcast and PG&E to legitimately negotiate for the land they've stolen from my front yard, and we can talk about the merits of "no regulation" vs "undoing damage already done". Until then, don't waste my time setting up some "purist Libertarian" strawman.

Net neutrality counts as a very small step in the right direction. Not because "these are the areas we believe should be regulated", but because we've already "regulated" them into nearly uncontrollable parasitic monopolies.

Comment Re:Silly Question (Score 1) 159

Unless you mean to suggest that "they" have forced every lawyer in the US to lie to the rest of us, you've missed my point - Those lawyers not under order to lie would call BS on the EFF's claims.

That said, yes, I will grant that if literally everyone had to lie, the results would look indistinguishable. Doesn't make it a very good conspiracy, though, if it includes everyone. :)

Comment Re:Cue the libertarian fucktards (Score 5, Insightful) 379

As a Libertarian fucktard - I support net neutrality.

Would I have preferred corporate America came to that decision on their own? Sure! And I'll take a unicorn, as long as you have enough for everyone.

Keep in mind, before you go whining about those more fiscally responsible than yourself, that that the very abuses that net neutrality address exist because of government interference - Giving the telecoms local monopoly powers, limited right of eminent domain (an outright abomination in any context), and in many states, flatly banning public competition even in towns (like my own) that won't see cable or DSL until the next infernal ice age because the telecoms have zero interest in serving the "last mile". Not to mention that whole "incorporation" bullshit in the first place.

Rant on, though! Never let facts stand in the way of demonizing your political enemies.

Comment Re:this vs graphene. (Score 5, Informative) 34

Graphene has the unfortunate property that transistors using it don't actually have an "off" mode - Just a "low" and "high". So although it might give us crazy-fast switching times, it will leak current worse than an XFinity modem. But hey, we all miss the good ol' days of using our P4 gaming rigs as space heaters, right?

Silicene, by comparison, does have a tunable band-gap, meaning that it should get around that limitation of graphene.

Comment Re:Silly Question (Score 1) 159

Although... if they *could* force us to lie, then they they could just be forcing people at the EFF and canary websites to lie about not being able to force them to lie.

Although these warrants may count as secret, the law itself does not. If the government had forced EFF to lie about this, a million hotshot lawyers fresh out of college would have jumped all over them - Either for making such a rookie error, or ironically enough, flagging that claim as itself a canary.

Comment Re:its not about the ring, its just a lesson. (Score 1) 591

or dispel someone from existence

How about just casting "Imperius"? Unforgivable, or silly?
Does trying to cast "Dominate Monster" on a human count as racism?

If you tried to file a police report for someone threatening to "dispel [you] from existence", they'd laugh you out of the station - Right after they searched you for drugs.

Slashdot Top Deals

Anyone can make an omelet with eggs. The trick is to make one with none.

Working...