Slashdot Mirror


User: Anonymous+Brave+Guy

Anonymous+Brave+Guy's activity in the archive.

Stories
0
Comments
12,209
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 12,209

  1. Re:Compiler design book on Bjarne Stroustrups and More Problems With Programming · · Score: 1

    Thanks for the tip. Looking that up on Amazon, it does sound much more like what I've often looked for than anything I've encountered in my local (university) bookshops. A couple of the other books people bought at the same time are also new to me and look promising, so you might just have identified something I've been wanting for years. Thanks again!

  2. Re:Good plan. on Bjarne Stroustrups and More Problems With Programming · · Score: 1

    It's not relying on programmers to be perfect at all. It just requires someone to pick the right tools for them.

    Personally, I am much happier with tools where fine programmer control is possible, such as C++. I write high-performance mathematical code for a living, and this stuff matters in that context. I am also happy spending some time learning how and why different programming languages work as they do, and how to take advantage of each without hitting the gotchas.

    Others may not have the time or inclination to study their tools as much as I like to, and may not need the kind of control that is useful to me. For them, other languages are unquestionably better choices than C++.

    This isn't to say that either C++ or safer but less flexible languages suck. They are simply different tools for different jobs, and as always, a skilled practitioner will choose the one that's right for him and for his current job.

  3. Re:It's not meant to be funny... on Bjarne Stroustrups and More Problems With Programming · · Score: 1

    Competent professionals don't rush to meet deadlines by trying to fix bugs at 2am, because they aren't generally in that sort of position in the first place. Even if they were, they'd realise that coding for stupidly long hours at a time does not yield net productivity increases anyway.

    As for C++, my experience is that the top whatever proportion of programmers are up to speed and avoiding the sort of kindergarten mistakes that critics like to shout about within a few months, or faster if they have decent training/supervision. The people who still don't get it after 5 or 10 years either aren't trying, or aren't the people the language is aimed at.

  4. Re:It's all completely logical! on Bjarne Stroustrups and More Problems With Programming · · Score: 1

    The point I was getting at is much better detailed in the C++ FAQ at http://www.parashift.com/c++-faq-lite/const-correc tness.html#faq-18.12 -- const overloading is very easy to get into trouble with because it breaks virtual overrides easily and without warning.

    It does nothing of the sort. The use of so-called const-overloading is a natural consequence of the concept of const correctness, which in turn is a simple yet powerful idea that prevents several otherwise-common classes of programmer error. I have never in my life "got into trouble" with this concept, and nor has anyone else whose code I've reviewed. If you really think this is a problem, perhaps you should stick with C#... or maybe knitting.

  5. Re:Your F-22 point is moot. on U.S. Refuses to Hand Over Fighter Source Code to UK · · Score: 1

    And how is the F-35 going to know where the Typhoon is in your hypothetical example? (Hint: if your answer includes the term "active RADAR", you kinda undermine your own argument about the advantages of stealth in this context.)

  6. Re:Const on Bjarne Stroustrups and More Problems With Programming · · Score: 1

    Using const when you create an object states that the object may not be modified. Using const when referring to an object is a promise that it will not be modified. The other rules all follow from these two statements.

    The confusing factor in C++ is that using const qualification can have two different meanings, depending on context.

    Used simply, you get "physical constancy", where the memory representing an object cannot be changed at all. This can be useful if you're working in a low-level environment with physically read-only data, for example, and is "constancy from a physical design perspective".

    However, combined with things like mutable and const_cast, you can get the often more powerful concept of "logical constancy". Here the observable state of an object (accessible through the interface from outside) cannot be changed, but internal data can (a cache being the textbook example). This is more like "constancy from an OO design perspective".

    It is unfortunate that the same keyword is used to help enforce both concepts in C++, and therefore a programmer is never 100% sure what guarantees are available. Fortunately, if your design is at all sensible and your use of const is consistent, it rarely matters.

  7. It's all completely logical! on Bjarne Stroustrups and More Problems With Programming · · Score: 1

    Nice trick question.

    For one thing, C++ is case-sensitive, so your p->F(/*whatever*/) calls have nothing to do with the f members of your classes.

    For another, class visibility defaults to private, so you can't call any of your member functions via a pointer (other than from within the same class).

    Next up, and this is perhaps where you think there is a difficulty, there are no overloads or overrides in your example at all. The function f in class B hides the function of the same name in class A because of the different parameter types. Any call through an A* can only see A::f. Any call through a B* can only see B::f.

    So, assuming we change the function identifiers to be consistent and that you're calling from somewhere with access to private members, the compiler has only one possible call to consider in each of your example cases. If const correctness permits, it will use it. Otherwise, the code will fail to compile.

    That means the answers are:

    First case: calls A::f

    Second case: fails to compile (can't call a non-const method on a const pointer) or would call A::f if this were made a const member function

    Third case: calls B::f

    Fourth case: fails to compile (same as second case), and would still fail to compile even if the member functions were made const, as it can only see B::f and that requires a non-const A* parameter.

    Really, if you understand a few basic rules, this sort of thing is all pretty obvious. Not good design, of course, but obvious all the same.

  8. It's not meant to be funny... on Bjarne Stroustrups and More Problems With Programming · · Score: 2, Insightful

    The answer to this is not to hire unwary C++ programmers, but rather competent professionals. C++ is not a language for newbies or cash-grabbing McProgrammers, and I rather doubt Bjarne or anyone else on the standards committees has ever claimed it was.

    A professional would immediately tell you that you should not rely on the order of construction or destruction for statics, that the derived class implementation will hide the base class one in your const modification case (precisely to prevent the kind of problem you described, actually), that you should rarely need to use simple pointers in C++ code so your released memory problem shouldn't be a problem in practice, that pretty much any recent compiler will warn if you try to return a reference to a local variable, etc.

    Most of this stuff is in the better introductory books, the main FAQ, and countless "how not to shoot yourself in the foot" guides. Anyone who hasn't come across them doesn't know their subject well enough to be using it for real. If you want to hire people in that category, sure, give them Java or something, where the balance between safety and expressive power/performance is different. Just don't expect the kind of results you could have had by paying for professionals to do the job with more powerful tools.

  9. Re:Long Memory... on Bjarne Stroustrups and More Problems With Programming · · Score: 1

    Searches for Hippopotamuses turned up porn. Searches for C++ turned up porn. Searches for Slashdot turned up porn...

    As opposed to Google, where searching for almost anything turns up an ad for buying it on eBay, an ad for downloading ringtones for your phone, a dozen price comparison/review sites (with a dozen links each) none of which has any human-written reviews of the search item, a sponsored ad for someone selling a related item, and a reference to the Wikipedia article?

  10. Re:CFG on Bjarne Stroustrups and More Problems With Programming · · Score: 3, Insightful

    I suspect that's because, in the grand scheme of things, parsing is easy, particularly if you can structure your language so that it's simple to parse. It's also easy to write a textbook on parsing, because it's basically a cookbook of the usual methods with a few examples thrown in (though most authors don't seem to be very good at that part, which makes me question how much they really understand themselves and how much is just regurgitating what they once read in someone else's notes).

    On the other hand, writing a compiler that optimises well (particularly in languages that don't lend themselves to easy optimisation), or a virtual machine that uses JIT compilation efficiently, or code generation engines that support compatible ABIs so you can link across programming languages... those things are seriously difficult. Even with all the effort concentrated on the big commercial tools or the big OSS players like the GCC, it's only in fairly recent times that JIT has become popular, and optimisation over the whole code base of a language like C++ is performed.

    I've been interested in this field for a long time, and I've never seen a book or a set of lecture notes that come even close to the kind of detail you'd need to understand to write code that does these things. As you said, most of the standard references are just a checklist of compilation stages and a few kiddie examples of parsing that don't really convey the significance of each step anyway. All in all, I think compilation techniques are probably the least understood (and perhaps most misunderstood) of all the major programming areas. That's a shame, because we could certainly do with someone developing a good programming language one of these years! :-)

  11. Re:Stroustrups on Bjarne Stroustrups and More Problems With Programming · · Score: 1

    You know why schools teach Java instead of C++? So they don't have to teach pointers first.

    Yes, the world will truly be a better place when it's full of people who use pointers all the time, without appreciating the significance of what they're doing, the ways to take advantage of it, and the pitfalls to avoid...

    For reasons I've never quite understood, the CS department where I studied also used Java in its introductory programming courses. This is odd, given that the department in question is a focus for programming language research, particularly in the area of functional programming, and that the researchers are not known for being shy in criticising mainstream programming languages. Since the Java courses were lectured by someone not very good with no research responsibilities, I've always assumed that the syllabus for introductory programming was someone considered beneath the research staff, and they just hired someone else to get on with it.

  12. Re:from the should-have-read-the-EULA-first dept? on U.S. Refuses to Hand Over Fighter Source Code to UK · · Score: 1

    The problem with your argument is that it almost begs the question: if Trident's ability to launch a nuclear strike has never been used and is never used, then it is working as a deterrent. Of course no-one sane wants a nuclear war. But as long as several military powers have the ability to participate in one, no single nation is likely to abuse the facility.

  13. from the should-have-read-the-EULA-first dept? on U.S. Refuses to Hand Over Fighter Source Code to UK · · Score: 4, Insightful

    I love the dept. line for this one. The UK is reading the "EULA" first, and that's why we're threatening to cancel a multi-billion dollar order.

    After all, would you leave the ability to maintain your air force in the hands of another nation? (And seriously, even if the order goes ahead, would the US seriously expect the UK to honour some contractual agreement not to install working software in its military aircraft?)

  14. Re:Backgroud checks are needed for some IT workers on Are Background Checks Necessary For IT Workers? · · Score: 1

    One of those things does not follow from the other.

    When you are found guilty of a crime by a court, the punishment may include a criminal record that lasts for some or all of the remainder of your life. Some crimes are sufficiently serious that people who commit them are never given a completely clean slate, and IMNSHO and with due regard to rehabilitation and fresh starts, this can be appropriate given the nature of the crime.

  15. Re:No guarantee on Are Background Checks Necessary For IT Workers? · · Score: 1

    Oh, goody, a bad logic debate! :-)

    Your "same logic" example is nothing of the sort, because it begs the question.

    Moreover, profiling generally suffers from the problem of confusing correlation and causation.

    This is the territory where human rights and authoritarian pragmatism start fighting. Suppose that, statistically, 90% of Group X represent a threat that is not a direct consequence of belonging to Group X. Suppose also that only 20% of those not in Group X pose the same danger. Is it morally justifiable to discriminate in some damaging way against Group X in your efforts to protect against that threat?

    The authoritarian pragmatic answer might be yes, and to say tough to the other 10% of Group X. The human rights/civil liberties answer would be no, because anyone could be in that 10% and collective punishment is unethical. And of course, in real life, the numbers are rarely so "convincing".

  16. Re:Self Defense on A Balancing Force to Mass Surveilance? · · Score: 1

    That's entirely my point. A knife, unlike a gun, does not drastically change the paradigm of hand to hand combat.

    That's silly. When dealing with a knife, it is vastly easier for any given attack to cause serious injury or death. Moreover, it requires far less force to do damage of whatever level, and therefore attacks can be faster, less committed, and carried out by someone smaller and physically weaker with the same effects.

    A gun, in contrast, makes almost no difference to "hand-to-hand" combat. The only time it makes a difference is if (a) it's pointing at you, and (b) the other guy can pull the trigger. (I'm not talking about the movie-do "blocking the trigger/hammer" crap, I'm talking about the guy just being in an awkward position where by the time he's rotated his arm/hand to point the gun at you, he can't effectively curl his finger to pull the trigger.) If you're standing a little way apart, that's a whole different world, of course.

    I would even go so far as to argue that most people with knives 'aren't honestly trying to maim or kill you'.

    Most people with knives aren't attacking anyone at all, they're making dinner or opening a package. Most people who actually go for someone with a knife are pretty seriously upset, however. If your "self defence" approach only works on someone who isn't really trying to hurt you, it's not much good, is it?

  17. Re:Self Defense on A Balancing Force to Mass Surveilance? · · Score: 1

    I've fought a guy with a knife before ... The trick is to disarm them before they can close to grappling range ... I have a black belt in Tae Kwon Doe ... I regularly spar with arming swords and do dagger and grappling techniques ... killing someone with your bare hands is not only possible, it's downright simple.

    OK, I'm not going to play my dick's bigger than yours is. You are obviously confident of your abilities, yet what you say tells me that your experience and perception is built primarily upon training scenarios in the dojang and not observing (or, God forbid, being involved in) real knife encounters.

    I urge you to go out, get some exposure to arts that train with a focus on weapons techniques, and review your assumptions. I strongly suspect that the knife-wielding you guy you fought wasn't honestly trying to maim or kill you. If he was, then I'm not sure you realise how lucky you are to be here having this conversation.

  18. Re:Not necessarily on A Balancing Force to Mass Surveilance? · · Score: 1

    Your point is well-taken. However, this stuff is much more dangerous in the hands of a government. The insidious thing about surveillance in public isn't so much the surveillance itself -- after all, anyone can see you walking down the street already -- it's the systematic collection and analysis of such material, and the conclusions drawn and implications made as a result. Governments have the resources to do that to individuals, and must be stopped from abusing this at all costs. Individuals, by their nature, will never have the resources to do this to governments (and would probably be accused of some sort of terrorist activity if they tried, in today's absurd political climate), which is why governments should be compelled by law to volunteer any information requested of them to any member of the public (with very few exceptions, and those assessed by someone independent of the current political administration) and things like the freedom of the press and a politically unrestricted media are so important.

  19. Re:Self Defense on A Balancing Force to Mass Surveilance? · · Score: 1

    Any idiot can shoot somebody, and a lot of idiots do shoot people. Hence, anybody with a gun pointed in your direction is a threat to your life. On the other hand, an idiot with say, a knife; that's a very different circumstance.

    No, it's really not.

    It takes a good amount of skill to be able to wield a knife effectively. Even if somebody has a knife drawn and is holding it on you at close to point blank range, there's absolutely no guarantee he'll be able to kill you or significantly wound you.

    There's no absolute guarantee that a guy with a gun will be able to do it, either. It's a safe bet, though.

    Knives are dangerous things. I once asked one of my instructors what chance he'd give himself of survival (not to escape unscathed, just to still be alive) if he were unarmed against a totally untrained guy who pulled a knife on him and just went for him. He gave himself a little worse than 50/50. That figure dropped to effectively zero if the guy had been taught the first hour's lesson in how to use a knife in combat. This was the honest opinion from a seriously fit 220lb guy who'd spent nearly two decades training in martial arts and learned his knifework from some of the best teachers in the world.

    As for knife-on-knife fighting, there's an old joke about that:

    Q: What do you call a guy who dies in hospital two days after a knife fight?
    A: The winner.

    Seriously, I know you meant well, but your post is so far off reality that it's not even relevant. I could quote you plenty more things, like the way many police forces around the world have changed their equipment and rules of engagement for dealing with people carrying bladed weapons in light of their all too real experiences, but I think the point is made. Knives are every bit as dangerous as guns; far more so, actually, at what you called "close to point blank range". While I take your point about guns, it is foolish -- no, suicidal -- to underestimate other weapons.

    You're also very wrong about what really happens when trying to use a weapon to defend yourself against someone threatening you with another weapon. For your own safety, I encourage you to read some of the literature on this subject before relying on these ideas. A lot of self-defence is in your mind, and that starts with not doing stupid things because you think you know better than everyone else.

    (Note to mods: go ahead and mod me off-topic, since I am, but please make sure you mod down all the ill-informed posts about macho stuff and self-defence as well, because people read this shit and believe it, and then they get themselves killed.)

  20. Re:It's a lot more than tougher laws on UK Report Suggests Tougher Copyright Laws · · Score: 1

    I know what you're saying, and I do appreciate that some of these things are already legal here via obscure special cases in the law. My point was that these things tend to be (a) poorly known/understood by the population, and (b) overly specific. I would have liked to see something more akin to the US "fair use" approach being proposed, where a small number of general and reasonable criteria are given, such that "obviously fair" private uses are covered, and future beneficial uses also do not require additional legislation.

    For example, my local dancing club gets through several CDs a year just through playing them until the accumulated damage means they won't play any more, yet we are not allowed to back them up; the law you cited applies only to software, not any other material covered by copyright.

    Similarly, the wording of the law for recorded programmes sounds reasonable, but in practice this has been interpreted to mean for varying (often rather short) time periods in different jurisdictions. I don't really believe that recording a show off TV and keeping it indefinitely would unreasonably damage the interests of the people who made it; they've already been paid a lot of money for broadcast rights, and I take a similar philosophical view to the Doctrine of First Sale here. Moreover, this is another one of those "everybody does it cases" where most of the population already expects the behaviour to be legal.

    Another advantage of rewriting the exceptions/exemptions in general terms is that you could then issue blanket rulings defending them. For example, such uses should not be unfairly inhibited by technological means (note the review's comments on abuses of DRM, and how little known and completely unused our mechanism for objecting is).

    Even more insidiously, take a look at the BSA's first submission. Their clearly stated view is that exceptions to copyright do not provide "rights" to end users, and as such may be overridden by specific agreements (such as EULAs or the "licensing terms" when you download a DRM'd music track, I assume). I question whether there is any basis in law for such bold claims; we've often talked around these parts about how copyright only restricts certain activities, and therefore if what you're doing with the content isn't restricted by them, no-one has any authority telling you you may not do it however much they'd like to. And yet, the BSA's comments repeatedly take the approach of presenting these claims as if they are a legal certainty (and here's a proof-by-arrogant-statement to show it). Given the frequent observations throughout the Review's findings that the public generally aren't very knowledgeable about IP issues, a blanket statement to debunk such industry FUD would be in the public interest, IMHO.

    Perhaps it's just me living in my ideal world, but I like simple, reasonable laws that the average people affected by them can understand with minimal effort. I favour generality and principle in codifying law, and broad discretion in the courts that enforce it to decide whether the principles have been violated in any given case, based on the specifics of that case, and if so what an appropriate penalty would be. Given this philosophy, "fair use" is one of the few areas where I think the US clearly has better law than what we have here today.

  21. Re:Well, thats just nullty. on Professor Comes Up With a Way to Divide by Zero · · Score: 1

    Yep, you can gauge a lot about the sophistication of civilisations through history by their mathematics, both what they understood and the conventions they adopted. Some cultures understood the concept of zero long before others, for example. The Babylonians, who had a remarkable understanding for their time, counted in base 60. An oddity were the Romans, whose engineering was remarkable yet whose number system was horribly inelegant.

    Of course, by today's standards, you're no-one if you can't at least solve a general quintic. :-)

  22. Forgot one... on UK Report Suggests Tougher Copyright Laws · · Score: 1

    Sorry, forgot one other significant recommendation from the Review: they opposed software patents.

  23. It's a lot more than tougher laws on UK Report Suggests Tougher Copyright Laws · · Score: 4, Insightful

    OK, since <obligatory moan> for some reason the eds posted a story about a BBC article and not my version straight from the source</obligatory moan>, let's get a few things cleared up.

    We're talking about the Gowers Review of Intellectual Property. This was a wide-reaching review, covering a lot more than just copyright, though of course copyright is a major component in our IP framework.

    In terms of copyright law, here are some of the major recommendations from the review:

    • The EC should not extend the copyright term for sound recordings and performers' rights. Moreover, if any extensions are proposed, they should not be retroactive. (The arguments given for this approach would make most Slashdotters proud, I imagine!)
    • The UK should introduce a tightly specified private copying exception, to legalise format-shifting.
    • Enforcement needs to be stronger, with tougher penalties and consideration given to a fast track procedure.
    • It is too early in the development of DRM to start legislating about it, but it should not be allowed to interfere with legitimate uses of copyright material that are non-infringing. An existing mechanism to report such abuses of DRM is noted, but is so convoluted that no-one has ever used it. The Review recommends making this process much more obvious and easier to use. The Review also recommends taking another look at some of these issues further down the line to investigate whether the system is working fairly.

    Personally, I agree with most of the review's conclusions and recommendations. I was, however, disappointed that they felt the need to limit their recommendation for a personal copying exception so much. The Review acknowledged that some personal uses were perceived, incorrectly, to be legal by many people, and that banning such uses by law damages the credibility of copyright as a whole in the public eye. They also acknowledged that some of these uses do not harm the interests of the copyright holder. They have also stressed throughout their process that their review would be evidence-led. I find it intriguing, therefore, that they have completely failed to address other reasonable personal uses mentioned in several of the submissions, such as backing up, recording broadcasts, and making compilations.

    Some submissions gave quite reasonable arguments based on existing law in favour of explicitly legitimising these. For example, under blanket UK consumer protection legislation, any article purchased from a shop must be (a) fit for purpose, and (b) capable of lasting for the expected lifetime of the product. Since the expected lifetime for information is indefinite, abusing copyright and/or DRM so that when someone's CD wears out they have to buy a whole new CD because they couldn't take a back-up should be a violation of UK trading laws. (Bizarrely, under the proposed system, you could take a back-up as long as it's in a different format, and if your original copy wore out you could then shift the information back again as you would still have only a single copy in any given format of material you had legitimately obtained.)

    On the whole, I give them 8/10 given the huge scale of what they were attempting. At least pretty much everything I've read of the review so far is a reasonable position, and most of it is a clear improvement on where we are now. My complaint, such as it is, is more that they didn't go far enough in some areas than that they went in the wrong direction. But such is progress, perhaps.

  24. Re:I joke a lot on Slashdot, but serious question on The Math Behind PageRank · · Score: 5, Informative

    The underlying idea behind page rank is pretty well-exposed at this point, and is described in TFA. Essentially, it's a big set of simultaneous equations: each incoming link to your page gets a score that is roughly the rank of the source page divided by the number of outgoing links on that page, and then the rank of your page is roughly the sum of the scores of all incoming links.

    Various fudge factors are introduced along the way. For example, if you break Google's rules about displaying the same content to bots as to humans, you can get slapped right down. More subtly, newly registered domains take a modest hit for a while. More nobody-knows-ly, Google's handling of redirects is unclear: information about exactly what adjustments are made is pretty scarce, and there's a lot of conjecture around. One thing that's pretty certain is that they penalise for duplicate content, which is why some webmasters do apparently unnecessary things like redirecting http://www.theircompany.com/ to http://theircompany.com/ or vice versa.

    So, if you want to get a page with a high rank yourself, then ideally you need would get many established, highly-ranked pages to link to your page and no others. In your example, all those Geocities sites wouldn't help a lot, because (a) they'd have negligible rank themselves, and (b) they'd be penalised for being new and lose some of that negligible rank before they even started. Many times negligible is still negligible, and so would be your target page's rank. OTOH, get a few links from university sites, big news organisations and the like, and your rank will suddenly be way up there. Alternatively, get a grass-roots movement going where a gazillion individuals with small personal sites link to you, and the cumulative effect will kick in.

  25. Re:ban images? on Spam Doubles, Finding New Ways to Deliver Itself · · Score: 1

    Let's take away yet more functionality due to spam!

    HTML in e-mail was never standard functionality anyway. E-mail is a text medium, which has grown in some ways without growing the infrastructure to go with it.

    What we have needed for a long time is e-mail 2.0: a proper, standardised protocol that deals with text messages including formatting, that is always encrypted, and that includes formal methods to authenticate the source (probably based on some sort of web of trust) and flag unwanted e-mail (to adjust that web).

    Hey, a man can dream, can't he?