Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×

Comment Re:Safer never to use GOTO (Score 1) 677

It would be a very good bet that almost all the programs it found with gotos contained lexical analyzers

Well, I did something crazy here and actually RTFA to test my own assertion (I expect to get thrown out of /. for such heresy). I believe I would have lost my bet. There was this nifty table buried in their paper. Unfortunately, /. refuses to do tables for me, but the gist was the following goto reason distribution for files that had them:

Error: 80.21%

Cleanup: 40.36%

Control-Exit: 10.16%

Loop-Create: 8.85%

Spaghetti: 5.99%

Single : 54.17%

Multiple: 62.24%

Forward: 90.1%

Backward: 14.06%

Stacked labels: 26.3%

# statements in label block (median not %): 4

(Presumably some contradictory-looking entries here adding up to more than 100% are explained by files containing multiple gotos for multiple different purposes)

Comment Re:Safer never to use GOTO (Score 1) 677

my 25 years of software development, I have never found a situation where the use of GOTO would produce better code

You've never written a good lexical analyzer then. No shame in that. Few people ever have to write one of those themselves. But take a look inside your (f)lex output some time. You'll find lots of gotos.

I used to say this exact thing, until the day I came across a problem where it wasn't true. I had to recode the algorithm every way I could think of, before I could accept the truth.

This is actually still great advice for about 95%+ of all software work. In my 30+ years of professional software development, I think I've done it once. However, if you end up in a situation where you have to code up a true state machine with no real structure to it other than nodes of code connected by control branches (eg: a lexical analyzer), then the natural expression of this is blocks of code connected with gotos. You can try and hide that by wrapping the mess in a case statement with a loop or something, but that doesn't change the real underlying control flow. In fact it *obscures* it.

And again, this isn't me being retrograde. This is well-known among the compiler building community (where the issue comes up regularly). That's why this report was able to find so many examples. It would be a very good bet that almost all the programs it found with gotos contained lexical analyzers (eg: compilers, compiler builders, regex matchers, etc.). These people aren't unrepentant cave-men. They just know something you don't because they regularly work on types of problems you don't.

Comment Re:Stewart. (Score 4, Informative) 277

The interviews are one more heavily edited than the corespondents pieces so I wouldn't trust them for either accuracy

Clearly you don't watch much (or perhaps don't pay attention?) Whenever they have to edit content from the interviews, they tell the audience and make the full interview available online (URL posted on the broadcast). The edit breaks are *really* obvious too.

If anything, the interview segment at the end is the most trustworthy interview segment you will find on television.

Comment Re:I'm surprised he lasted as long as he did (Score 1) 277

The Nightly Show "keeping it 100" bit is IMHO precisely what any show with a public figure on it desperately needs: some way to induce people to cut the safe prechewed canned crap and say what they really feel, and hold them to ridicule *to their face* if they refuse. I've completely quit listening to most politicians, because you know exactly what they are going to say already. Why bother, if I can write their statement for them already?

As an example, its probably fair to say the host Larry Wilmore is naturally inclined to be a fan of NJ Senator Corey Booker. So cut to episode 2, when he threw an entire handful of teabags in Corey Booker's face and said "weak tea" for giving a politician-style answer. It was one of best experiences of my (nearly 50 year) TV viewing history. It was like something I'd been missing my whole life and didn't know it had just been handed to me.

Comment Math says "No" (Score 3, Insightful) 222

You mean donating $100 million to help build up a hospital in New York isn't morally a good thing? Another $100 Million for Cancer Research at MIT. Another $25 Million for Cancer Research at MD Anderson in Huston TX.

Those gifts were spread out over the last 8 years. The Average American gives about 3% of their income to charity yearly. The Koch's made about $10 Billion last year, so reach that standard, they would have had to give $300 Million last year alone. It only looks like they are giving a lot in absolute terms because they are so ridiculously wealthy.

The Koch's are hardly alone in being relative skinflints. The percentage of income given to charity actually rises as income drops. For example, the most destitute zip in my town averages about 7.5%, while the richest gives less than 4% (yes, we are a generous state. Also a poor state). So if it is really charitable giving you care about (as your post seems to imply) then the best way to increase it is to find a way to move money away from the top end of our income distribution, and towards the bottom end.

Math.

Comment *Not* the most popular (Score 1) 192

They took their list from the languages GitHub and StackOverflow. GitHub is an online source code repository service, and StackOverflow is a technical Q&A site. So this is essentially some combination of the languages used most by folks for Open Source (typically non-paying) work and the languages that are causing people the most grief.

That's an interesting way to define "popular".

Comment Re:christ man (Score 1) 700

Home schooled children, on average, score in the 70-80th percentile on achievement tests.

That doesn't really mean much though, as you can't compare how those same kids would have done in Public schools. There's a huge selection bias here, as home schooler's do not have representative parents.

A large part of the low-performers in Public Schools aren't due to random stupidity in the general populous, but rather due to having parents who can't or won't provide a stable home life so that their kids can concentrate on their studies. If the family has the resources to devote an entire person to schooling the kids, they pretty much by definition aren't in that category.

Look at it this way, if you took the average Public School, and removed the test scores for everyone living in poverty or in single-parent families or where all available adults are working so much the kids are alone most of the time they are home and awake, you'd probably also see the remainder in the 70-80th percentile. Perhaps higher.

Comment Re:Not "incorrect" English (Score 1) 425

So it ends up being not used at all in formal speech until it has completed its turn to its new meaning. And that new meaning is going to be a slightly prissy-sounding synonym for "composed".

The turn has completed. Much like the use of "hacker" to refer primarily to people who break computer security measures, the meaning has changed and no amount of spirited railing against it is going to change that.

Slashdot Top Deals

HELP!!!! I'm being held prisoner in /usr/games/lib!

Working...