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

 



Forgot your password?
typodupeerror

Comment Bell & Howell (Score 1) 523

Way back when, Apple hadn't yet established relationships with public schools. School administrators didn't know how to classify computer equipment, anyway. The Bell & Howell company came to the rescue: they were vendors of audiovisual equipment like film projectors. Bell & Howell agreed to let Apple use their connections with school districts in exchange for the computers being rebranded as Bell & Howell equipment, in Bell & Howell livery.

This is why the first computer I ever got time on was an all-black sleek Apple II+ that looked like it belonged on the Death Star.

The original Bell & Howell Apples are now almost completely forgotten about. But man, do I ever have fond memories of them.

See one for yourself here.

Comment Re:How to automate C++ auditing? (Score 1) 341

And before you start spewing about vectors vs C-style arrays performance, I would suggest you revisit some simple profiling code; vectors are just as fast as c-style arrays these days.

Actually, no.

The C++ standard doesn't give any guarantees on how quickly the OS has to service your request for a dynamically allocated block on the heap. Most modern desktop CPUs and OSes do this very quickly, but there are embedded platforms where allocating memory off in the heap takes multiple milliseconds.

Likewise, modern CPUs tend to aggressively cache vectors in ways that are absolutely beautiful. But in embedded systems with simpler CPUs, they may very well be accessing each element of the vector via a pointer indirection.

The world's a much bigger place than server farms and laptops. In those areas, yeah, std::vector<T> is a lifesaver. But in the IoT world there's still a very real need for C-style stack arrays.

This is, incidentally, the entire motivation for std::array<T, std::size_t> in C++11. The embedded guys insisted on a container with an STL-compatible API which would be compiled down to straight-up C arrays. I've never found anything in the embedded space where a std::array<T, std::size_t> was an inappropriate choice, but I've been in lots of projects where a std::vector<T> was simply not in the cards.

Comment Lots of errors. (Score 1) 341

I've been programming in C++ since 1989 and have been getting paid to do it since 1993. I've seen the language grow up, and I don't think you're very near to right. You've got some serious misunderstandings of the language.

Because it does not have momentum, it will probably never develop momentum. Like Lisp, it may be a neat language, but it will almost certainly be consigned to the dustbin of history.

I'm also an old LISP hacker (since the early '80s). LISP is not "consigned to the dustbin of history". It was foundational in the development of modern languages and concepts it introduced to programming are still with us today. I personally side with Google's Peter Norvig: LISP is still around, we just call it Python.

If Rust is doomed to share LISP's fate, I think the Rustaceans would consider that a victory beyond their wildest imaginings.

It should also be noted that well written C++ can be just as good as Rust.

Meaningless. Well-written X can of course be as good as Y. Well-written C is just as good as Rust. The question that's relevant to software engineering is "how much effort is required to do the task well in X versus well in Y?"

As someone who's entering his fourth decade of C++ programming: yes, the modern dialect of C++ is wonderful. It still has an absurd number of gotchas and corner cases, though, to the point where unless you've already made that massive investment in learning corner cases ("can I use the universal initializer syntax to initialize my object, or will it turn it into std::initializer_list? And someone remind me again why vector<bool> is a bad idea and will screw me over if I try to use it?") I would genuinely recommend using another language for low-level power.

The first, and somewhat less important principle of C++ is template metaprogramming. This approach to software development is entirely geared towards reduction of redundancy in code writing.

No. That's generic code, period. Template metaprogramming is different: it involves exploiting the fact the C++ template instantiation facility is Turing-complete to perform at compile time things which in other languages would be deferred until run time.

This can be a really big deal. In C you might assert that the size of an integer is what you're expecting, but you won't know until you try to run the code. Your assert will give you a clue as to why your code failed in production at 3:00am, but you'll still get the call at 3:00am telling you everything blew up. In C++, a static_assert evaluates that same question at compile time, and if the architecture you're compiling for doesn't have the necessary word size you'll know it when the compilation halts.

And that's just scratching the surface! Template metaprogramming is also used in things such as the Blitz++ numerical libraries (I'm old, yes, I remember Blitz++) to optimize matrix operations to the point where it beats FORTRAN matrix multiplication. Nothing like unrolling loops at compile time, automatically, to give your code a performance boost. And of course, libraries like Boost are continually pushing out the frontiers of what we can do with template metaprogramming.

Templatized code is actually about abstract algebra (as no less than Stepanov has said), allowing us to separate algorithms from the types they operate on. But template metaprogramming is mostly about moving things normally done at runtime into the compile-time cycle. It's not about code reuse.

This is an extension of the idea of inheritance where you re-use base class code, and only modify what you need to adapt the base to your use case.

Not really. Inheritance is inevitably about types: you can't talk about inheritance without talking about the type of the parent and what behaviors get inherited. Generic programming is about separating type out from the discussion and instead talking about the algorithm in an abstract-algebra sense. (And then you have abominations like the Curiously Recurring Template Pattern which fuse them both.)

And then we get to...

Object oriented programming is a mechanism for creating a software structure that forces most types of bugs to be compile time bugs.

No. Just. No.

There is no universe in which this paragraph is anywhere near right. OOP in C++ was introduced in the 1970s in the very first iteration of the language, and let me tell you, as someone who has actually had to work with cfront that compiler did absolutely nothing to turn my run-time bugs into compile-time ones, nor did object-orientation magically provide this capability.

But by the early '00s, around GCC 3, when C++ compilers started to produce scarily optimized template code? About that time is when template metaprogramming took off, and that was when I began to replace my C-style casts with static_casts and began to get warnings about "uh, boss, that cast isn't valid, it'll blow up on you at runtime".

Your example is also weird: you say the non-OO way would involve a struct that contains data fields and a type ID, but, uh -- that's what an object is: it's a struct containing function pointers and data objects. The example you give can easily be written in C by anyone who understands function pointer syntax. Remember, C++ classes were explicitly designed to be translatable into C structs-and-function-pointers. (That's how the first major C++ compiler, cfront, worked. It parsed the language and spat out equivalent C, which was then compiled.)

OOP converts this type of flow control into virtual dispatch, which can be validated at compile time,

... except that virtual dispatch explicitly cannot be validated at compile time. Virtual dispatching is done at runtime. Only static dispatch can be done at compile-time. (Note: before you put together a toy example that uses the virtual keyword, be careful: if the compiler can statically determine the type, it's allowed to implicitly convert your virtual call into a static call.)

I'm afraid that I'm sounding like an angry old man standing on my porch talking about these kids today and looking around for my shawl. I apologize if that's the way I'm coming off. But you seem to have some really weird misapprehensions about the C++ language, and I really hope you'll correct them.

Comment Re:I just don't buy the shit MIT... (Score 5, Insightful) 435

For a good computer scientist...

Ah, the No True Scotsman fallacy.

that basic world view is ingrained in their soul.

No. Definitively, no.

I was born in 1975. By 1979 I knew I was going to be a hacker. No kidding: I was sitting on Mrs. Walters' kitchen floor discovering recursion by drawing geometric shapes. I remember looking at this Easter egg I'd decorated in a recursive pattern and being in awe, and thinking I wanted to draw recursive patterns on eggs forever.

I was there for Flag Day in 1983 when ARPANET became the Internet. I was eight years old and the local college computer science department viewed me as their mascot, I guess. I'm grateful to them for the time I got to spend on LISP Machines.

Today I'm 44. I hold a Master's degree in computer science and am a thesis away from a Ph.D. I've worked for the United States government's official voting research group (the now-defunct ACCURATE) and private industry. I've spoken at Black Hat, DEF CON, CodeCon, OSCON, and more. I think that I meet your, or anyone's, definition of a good computer scientist with a long career.

And I am telling you, brother, you are wrong.

In the late '80s and early '90s there was a USENIX T-shirt given to attendees. "Networks Connect People, Not Computers." It was a neat shirt and I wore mine until it was shreds, not because I liked wearing a ratty T-shirt but because there are so many of us who need to learn this lesson.

Logic is the tool we use to serve humanity. But if you let logic blind you to the fact other people are human beings with human feelings who need to be treated like human beings, then you just stopped being a hacker and you started becoming a tool.

Hackers serve humanity. We don't rule it. And we're not excused from the rules of human behavior.

I really wish RMS had learned this. It's too late for him. It's not too late for you.

Comment How Not To Write A Headline (Score 5, Insightful) 167

These two yutzes cause a crash on the freeway and they don't even bother to stop and check if the other people are injured?

They don't even bother reporting the crash to the authorities, they just driiive on back to HQ and hush it up?

"Former Top Waymo Engineer Altered Code To Go On Forbidden Routes" is not the headline I would have chosen for this story, folks.

Comment Re:Enough (Score 0) 385

So, if four people were stabbed, would you want fewer knives in this country? No, I am not being sarcastic. In England, they have "sane" gun laws, but now they are cracking down on knife ownership. You can't make this stuff up!

Gracious me, that sounds like an Orwellian nightmare. You should definitely keep this one at the top of your talking points, as ordinary people will undoubtedly share your horror at the thought of living in a society that tries to minimize the number randos carrying deadly weapons.

I'll say it again:

Eventually, there'll be too many people with a personal stake in this for you to beat.

Comment Enough (Score 0, Troll) 385

I learned about this when my mom texted me to let me know that she and my dad were both safe, her being out of town, dad being at home and hearing but not thinking much about the sirens down the way. My nephew's school was still on lockdown (despite it being miles away, better safe than sorry, I suppose.)

My parents live right near this place. They ride their bikes past it regularly. Middleton ain't a big place.

I can't decide if I'm relieved, livid, or just numb to it. Probably a bit of all three.

All you folks who get red in the face at the thought that maybe, just maybe, we could stand to have fewer guns in this country:

Eventually, there'll be too many people with a personal stake in this for you to beat.

Even if you decide to 'exercise your second amendment rights.'

Comment Re:Why do tech-bros love antisocial behavior? (Score -1) 663

I think a big part of it is how the rest of society keeps showering bonkers amounts of adulation and money on them. Why try to be a better person if it seems like everybody loves you? Heck, you probably are the better person, and all these SJW whiners who say otherwise are a) jealous of your awesomeness and b) can't comprehend the very unique and not-at-all-applicable-to-any-other-industry-out-there challenges and pressures of the tech world.

I'd imagine medicine faces similar pressures–I'm thinking particularly about the 'rockstar' surgical positions–and I know that science has similar issues, but neither of these disciplines seems to suffer from nearly the same degree of fandom as the tech world does...

Comment Re:Everything is "discriminatory" (Score 0, Troll) 244

The entire point of advertising is to reach those groups most likely to respond to your product.

There was a time in living memory where this argument would have applied perfectly to job postings for doctors, lawyers, accountants, and scientists. Advertising has long been used to define and amplify what you should be doing with your life based on your demographic peculiarities–regardless of what you actually want to do or are capable of doing.

you can't even acknowledge a difference between right and wrong, good or evil.

Let me try: it is fundamentally wrong that the number of women in computing has plummeted even as the number of women in other major technical professions–including law, accounting, medicine, and scientific research–has approached parity. Women are excluded from programming not because they can't do the job–they're excluded because the community is comfortable prioritizing our abusive, "brutally honest" Mamet-esque dick-swinging over professionalism. That's evil.

It's like we're trying to unmake ourselves.

You're exactly right! We are trying to unmake ourselves, if by "ourselves" you mean "society's long-standing tradition of blithely excluding entire swaths of people from consideration for professional roles based on wholly unrelated things like gender, race, or sexual orientation."

That is a good thing that society should do. We should want to fix this, not wallow in it.

Comment Absolutely (Score 5, Insightful) 898

Whoever wrote this is a coward.

There are no "unsung heroes" in this White House. This is an escape hatch for the people who followed power for power's sake: "oh, sure, I was really fighting the good fight inside the White House, so you should be thanking me!"

Think there's a real problem here? Think the President is unfit for office? Then get to work on 25th Amendment proceedings if you're in a position to do so, or if not, resign and tell all of this to Congress. Don't stage a mini-coup and call it heroism. That's bull.

It's no secret the President is unfit for this office. It hasn't ever been a secret. This staffer, and their allies? They're complicit in everything. This is just a weak-ass attempt to make themselves look good.

Comment Re:Amazing (Score 1, Insightful) 187

It's amazing how remorseful companies are when they get caught doing something silly :|

Here's a thought:

Fix it before you release it to the public and you won't have to apologize and tarnish your reputation.

...so basically, for any sufficiently complex venture involving human beings, never release it to the public.

Slashdot Top Deals

Always try to do things in chronological order; it's less confusing that way.

Working...