Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?
For the out-of-band Slashdot experience (mostly headlines), follow us on Twitter, or Facebook. ×

Comment: Re:Apple fan (Score 1) 149 149

I have an app (Human) that uses the GPS to track me a little more precisely to see how much I'm moving. My phone regularly gets 11+ hours of usage time per day before I'm down to about 10%. I've seen it as high as 13.5 hours. The real battery killer, for whatever reason, was Facebook. Even with background updates disabled, it was still killing me. But that was the only app that I've seen fit to remove for the sake of my battery.

Comment: Master a limited subset (Score 1) 345 345

It's really hard to master the entirety of C++, so you're better off knowing just a meaningful subset of it. Go and pick up Effective C++ and the sequel—they're basically just filled with the pitfalls of C++ to avoid and some decent things worth knowing. That's the stuff that tends to show up on C++ interviews. There's basic stuff in there and less basic stuff, but all of it is useful.

My company has a course on advanced C++ and C++ pitfalls, and even after 15 years, some of them caught me. Lots of them did, really. It was interesting because the room had a dozen or so programmers, and we all fell for completely different things.

C++ gives you a lot of rope to hang yourself with. The trick to using it well is to limit how much rope is around your neck at any given time—never do something cleverly that can be done simply, even if the simple way takes up a few more lines.

Oh, and comment your damn code. I don't care what language you're in, you're not a master of it until you know how to leave a trail of comments that even a new programmer can follow. When you're on your third 18-hour day, you have an imminent deadline and you're starting to go crosseyed, you'll either love or hate yourself based solely on the amount of good comments you left in your code. Things that are obvious when you're awake and well rested become muddy when you're tired and hungry and want to go to bed.

Comment: Re:Masters know their limitations. (Score 1, Insightful) 345 345

I remember reading slashdot the day that there was news that the C++ grammar had officially been proven to NOT have a bad left recursion in it. That was around 12 or 13 years ago, if I remember right. Up until then, nobody was actually sure, and every compiler writer had to take a slightly different approach to the things they were going to leave out of the compiler.

When you start with that as a foundation—20 years of having a language grammar that nobody is sure can be completely implemented—you're starting from a pretty bad place. The language was badly designed to begin with.

Then you've got the issue of Templates. Powerful? Yeah, for sure. But that's because the template language is turing complete on its own, and nobody realized THAT at the time either. I'd reckon (wildly, I admit) that 95% of the functionality of templates and template meta-programming is discovered functionality. ANY language becomes hyper powerful when you bolt another entire language to the side of it. They were just supposed to solve a problem with generics, and instead created a couple new ropes to hang yourself with.

C++ is a language that isn't so much as designed by committee as designed by falling down rabbit holes. What new, bizarre, unconfronted thing will we see next? Who knows?

Comment: Re:At the risk of getting downvoted into oblivion. (Score 4, Insightful) 290 290

Clearly you haven't been modded into oblivion, but honestly, this is a dumb question. That's like asking, "Who the fuck cares about Google?"

Literally over a billion people care. And the advertisers care. And the shareholders care. There're a lot of people that care about Facebook.

Whether you like it or not, and whether you use it or not, to many people, Facebook is becoming all they know of the internet. For all intents and purposes, it IS the internet for a segment of the population. There are mobile providers that will sell you a plan that gives you virtually no data for free, but you DO get Facebook access for free. Facebook's Messenger chat service has something like 700 million users and is the single most popular chat application in the USA. We hear stories about the NYT doing a deal for instant loading articles and a share of ad revenue because Facebook is also becoming the place where most people read their news.

So yeah, LOTS of people care. YOU should care, even if you don't use it, because it's becoming the sort of behemoth that warps space around it. I hardly use Google's services at all anymore, but I definitely care about what Google is doing in the world. Most people with PCs and Android phones care about Apple and the influence it brings to hardware and mobile—even if they purport to hate every single change Apple brings to hardware or mobile. People that don't live in the USA definitely care what the USA is up to. There are plenty of reasons to care about Facebook and even weird things like this because they really do serve to show us the state of the internet today and give us hints to the future, or at the very least, what we DON'T want the future to look like.

People have been threatening to abandon Facebook for various minor transgressions every year that it's been around, and it keeps getting bigger. It's not going anywhere for a while.

Comment: Re:Amen brother! (Score 1) 424 424

I don't have any others off the top of my head, but the point isn't that you can find it eventually, it's that the operator itself isn't included and I want it to be. If I run the search as I gave it, the link you gave is in there, but what I'm looking for is in literally only one of the other links, and none of them are official documentation (which may be important for other reasons). Part of the reason why we're able to find the result at all is because we happen to understand that /= is an operator and we're including that as part of the search. For beginners or for unspecified bits of syntax, I might not have that sort of clarifying term.

I'm searching for something very precisely, and I want all the terms respected when I do, that's all. Hunting through 10 links with none of the normal highlighting of terms is cumbersome.

I don't fault google specifically for this; none of the other engines do a better job, and as you point out, I CAN eventually find what I'm looking for. It may be an intractable problem, I admit; indexing every "/=" may not be super practical.

Comment: Re:Video explaination (Score 1) 1067 1067


Look, in mathematics, dividing by zero makes no sense and that's fine. But I'm not working in the realm of pure math, I'm doing some actual work in a little universe of my own construction here. I don't need the value to be some sort of infinity. The value is undefined on our computers because we say so.

I'm a games programmer, and there are plenty of situations where we might accidentally end up with 0 as the denominator, and it would have no bad effects at all to treat that as a zero. In most cases, that's actually the expected result. That is, I end up writing ternaries like:

float foo = x != 0 ? y / x : 0;

foo will be zero if x is zero, otherwise it's some fraction. Why is x zero? I don't know, maybe it was a countdown timer, or I'm just trying to find some fractional interpolation along some curve or something. NaN is a MEANINGLESS answer. Zero is the only answer I want out of this equation when x is zero.

Your understanding of math is correct for our normal every day situation, but in broad strokes, you're wrong. I can easily define a new mathematical system where division by 0 is both allowed and defined. Algebra is very flexible this way. That's why when you add 25 hours to 2pm, you end up at 3pm the next day, and not 27pm. We've defined math in this daytime context to wrap around. There's no such thing as 27-o-clock. In this algebraic system, 2 + 25 != 27.

So what this programmer is asking isn't about whether or not dividing by zero in the purest mathematical sense is correct, they're asking whether or not it makes sense to have an alternate system where division by zero just gives you zero, since zero is almost always the answer that they (and that I) want.

Comment: Re:Amen brother! (Score 1) 424 424

These queries are far too simplistic in that they're composed almost entirely of words. The queries of mine that fail are usually syntax issues in something like elisp. Sometimes, I'm just looking for the elisp manual page that I KNOW exists, but my searches (on all engines, not just google) will fail hopelessly.

If you're looking for operators, or occasionally weird function names or specifiers like "let*" (the current results for let* are better than the last time I tried it, I admit), the search will often leave those bits out, even though they're critical. Searching for "elisp /= operator" for instance doesn't take me anywhere near the right result. Even turning on verbatim search doesn't help.

Comment: Re:So, a good move then (Score 1) 288 288

I admit, I have to wonder if Apple's markup is to encourage manufacturers to make cheaper cables.

I can buy MFi certified cables from Monoprice or even off of Amazon, and they're much cheaper than Apple's stuff. It's certified, so I'll trust it not to light on fire. If Apple made cables and sold them at cost, which they could surely do, they'd price everyone else out of the market. Apple has economies of scale that these other guys can only dream of.

So Apple marks up the prices on the adaptors, takes the abuse, makes a few bucks, but opens up the market to anyone that wants to make a peripheral and pay a small fee to be certified (whatever that means). As a result, I've got Anker cables and hubs at home. They work well, look nice and are easy to come by. I wouldn't have even considered them if Apple's cables were cheaper.

Comment: Re:One connector to rule them all. (Score 5, Insightful) 179 179

Not everyone needs more than one.

Whenever you post to /., remember that YOU'RE the weird one. You've got more rigorous demands than most people. There are lots and lots of people that don't need more than one port, and will be delighted that they don't have to even think about what sort of connector they'll need for whatever peripheral they have. Everything will come with USB-C, they've only got one port and nothing to sort out.

For those of us that need more, there are plenty of options, but man, I have lots of people in my life that need ZERO ports on their laptop.

Comment: Re:Learn to read, learn basic math (Score 1) 306 306

The two statements you made are kind of at odds with one another.

Coders ARE too often one-trick ponies, I agree. But at least they learned some other subjects while they were at school. Literature, biology, chemistry. Even if they don't use them, they know a few things here and there.

The biologists, chemists and writers of the future will now know a little bit of coding. They won't remember much, probably, but they'll know a little. Nobody's trying to teach these kids to be experts any more than school is trying to teach kids to be materials scientists before they get to University. A little exposure can go a long way.

You don't get well-rounded individuals by teaching FEWER subjects.

Comment: Re:Another useless subject - yay! (Score 1) 306 306

I went to University and concentrated on computing science classes. I've been a professional programmer for 15 years.

But while I was at University, I also took courses in comparative literature, invertebrate paleontology, geology, meteorology, atmospheric fluid- and thermo- dynamics, and philosophy. You know what? It turns out that I'm really interested in those 'useless' subjects that I didn't really need, but was forced to take. As I look into the future, I'm thinking of leaving the software industry and getting a degree in biology or ecology, and using all the things I know from all the subjects that I've taken.

Education isn't just about utility, it's also about opportunity. Teaching children how to code isn't about making sure they use that skill later in life, it's just so that they know how big the world is and that they can do a lot of different things. At the time I did my degree, I did more than my fair share of grumbling at those optional courses, but 15 years on, they feel like some of the most valuable parts of my education. If nothing else, I think I have a lot more interesting conversations than I would've if I'd fixated on just one subject.

Comment: Failure should be celebrated (Score 4, Interesting) 444 444

I think part of the problem is that nobody wants to publish a paper where the experiment failed--but they should.

Failures are useful; they're not wasted time. You've almost certainly learned something from a failed experiment. Maybe you learned that the setup wasn't rigorous enough, or maybe you just learned that a certain avenue of research wasn't viable for one reason or another. I get that journals are looking for breakthroughs, but it would be so useful to read a paper in your field and find out that someone already tried the thing you're attempting, and now you don't have to fail in exactly the same way.

But that requires a much more collaborative system, and one where the community is interested in finding answers, not glory.

Comment: Re: Is a reduction (Score 1) 89 89

Unfortunately, those wind turbines also kill bats (a friend of mine is just finishing her PhD on that work). The good news is that the folks that operate wind farms aren't in it to destroy wildlife, so they're amenable to doing things that help reduce the number of bat deaths.

(Bat deaths due to wind farms are especially painful, since they often kill bats that are migratory which wouldn't be affected by white nose syndrome.)

"Any excuse will serve a tyrant." -- Aesop