Slashdot Mirror


Are Flawed Languages Creating Bad Software? (techcrunch.com)

"Most software, even critical system software, is insecure Swiss cheese held together with duct tape, bubble wrap, and bobby pins..." writes TechCrunch. An anonymous reader quotes their article: Everything is terrible because the fundamental tools we use are, still, so flawed that when used they inevitably craft terrible things... Almost all software has been bug-ridden and insecure for so long that we have grown to think that this is the natural state of code. This learned helplessness is not correct. Everything does not have to be terrible...

Vast experience has shown us that it is unrealistic to expect programmers to write secure code in memory-unsafe languages...as an industry, let's at least set a trajectory. Let's move towards writing system code in better languages, first of all -- this should improve security and speed. Let's move towards formal specifications and verification of mission-critical code.

Their article calls for LangSec testing, and applauds the use of languages like Go and Rust over memory-unsafe languages like C. "Itâ(TM)s not just systemd, not just Linux, not just software; the whole industry is at fault."

531 comments

  1. A poor craftsman blames his tools. by Anonymous Coward · · Score: 5, Insightful

    It's not the language, it's the programmers and the rush to produce easy code. Speed and simplicity trumps security and efficient coding these days.

    1. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0, Insightful

      It's not the language, it's the programmers and the rush to produce easy code. Speed and simplicity trumps security and efficient coding these days.

      /nod

    2. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 5, Insightful

      A good craftsman doesn't blame his tools because a good craftsman doesn't use poor tools.

    3. Re:A poor craftsman blames his tools. by awe_cz · · Score: 2, Interesting

      While your statement is correct, it kind of misses the problem. With current demand we need more quality craftsmen than there is or ever will be available (in foreseeable future). In this regard, having safe languages looks like a good choice. Not all pieces of software needs to be written by the best of the best anyway. We just need to make sure someone's badly written GUI application does not crash the whole OS. If if it crashes, make sure there is an output from that crash that even sub-standard programmer can understand and fix.

    4. Re:A poor craftsman blames his tools. by MichaelSmith · · Score: 2

      If if it crashes

      Case in point, semantic analysis is available in some text editors to point out your mistake. A programming language which doesn't require that the programmer state their intentions makes it hard for silly mistakes to be identified early.

    5. Re:A poor craftsman blames his tools. by ganv · · Score: 2

      Are flawed programmers creating bad code? Yes, but there is a bigger cause. Our era assumes that complicated things should be able to be done by a small number of people in a tiny amount of time. It is the failure to simplify and allocate adequate resources to creating great code that are really creating bad code.

    6. Re:A poor craftsman blames his tools. by allo · · Score: 5, Insightful

      A good craftsman chooses good tools.

      Of course you can create excellent work with very bad tools.
      But the first a good craftman does is to search for the right tools. He checks his budget, then starts to search for the right tools and if they are too expensive, he searches for replacements, which are for him (but not for everyone) similiar useful. If he cannot find a tool he needs for good work, he's honest about it and tells his client before starting to work.

    7. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 3, Insightful

      A good craftsman doesn't insist that his tools necessarily do the job for him either.

    8. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 1

      And you have a crapload of incompetent people making design-decisions that goes against what the senior people advice.. just because "It was easier to get the feature done in this sprint" and with total disregard to what the final goal is....

      There seems to be flowing in so many new developers that don't care about what they are producing... I miss the days back when almost all people that did development for work also had a few side-projects in their off-time just because it was fun...

    9. Re:A poor craftsman blames his tools. by Dunbal · · Score: 5, Informative

      On the other hand, the tools don't make the craftsman. You give sophisticated tools to an idiot and you will still get something idiotic - although sophisticatedly idiotic.

      --
      Seven puppies were harmed during the making of this post.
    10. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 5, Insightful

      Give me a crappy handsaw and nothing else and expect me to do perfectly mitered crown molding in no time at all? You get shit.

      Same tools with more time? Now we can talk about my skills I.e. can I do it properly with just that handsaw but time to make it right?

      On the other hand, give me a nice table saw where I can simply set the saw to miter correctly and I can do these crown moldings perfectly in no time at all.

      The moral of the story? Yes in scenario 2 the poor craftsman will still blame the tools but a good one will also do it because he does know how to do it but he also knows that the table saw exists.

    11. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 5, Informative

      It's not the language, it's the programmers and the rush to produce easy code.

      Well, I think it's a lot the language as well. To a first approximation, every major piece of system and networking software written in C has had serious security issues at one time or another, even the ones written by the best programmers of their generation and hailed as being exemplary in their code quality. I think after the first few decades of evidence we're allowed to call this one now, and say that writing critical software in unnecessarily dangerous languages produces less than optimal results.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    12. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 0, Informative

      Sorry but people that know how to program do have families they want to actually be with too. Nothing to do with a thousand side projects. Just with actually knowing your shit.

      Its very hard to find good people. Most either run away from our very standard do it at home test or they fail it miserably. And these are all solvable by googling "standard programming interview questions" and they get them wrong or they say "I dont know". Nevermind the freeform programming question where all you need to do it to show off what kind of programming patterns you know, how clean you can code etc. And they all show off the worst spaghetti nightmares you can imagine. Disgusting.

    13. Re:A poor craftsman blames his tools. by Joce640k · · Score: 5, Informative

      Yep. Too much 'critical' code is written by the boss's nephew just because he "seems to be good at computers".

      Bjarne said it best:

      The idea of programming as a semiskilled task, practiced by people with a few months' training, is dangerous. We wouldn't tolerate plumbers or accountants that poorly educated. We don't have as an aim that architecture (of buildings) and engineering (of bridges and trains) should become more accessible to people with progressively less training. Indeed, one serious problem is that currently, too many software developers are undereducated and undertrained. Obviously, we don't want our tools--including our programming languages--to be more complex than necessary. But one aim should be to make tools that will serve skilled professionals--not to lower the level of expressiveness to serve people who can hardly understand the problems, let alone express solutions. We can and do build tools that make simple tasks simple for more people, but let's not let most people loose on the infrastructure of our technical civilization or force the professionals to use only tools designed for amateurs.
      - Bjarne

      --
      No sig today...
    14. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 5, Insightful

      A good craftsman doesn't insist that his tools necessarily do the job for him either.

      As programmers, automation is the essence of what we do. Any programmer who isn't insisting on their tools doing work so they don't have to do it themselves isn't making very good use of those tools. That is as true for safety, security and defensive programming as for any other aspect.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    15. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      The problem with your assertion though is, the same is true for almost every project of adequate complexity written in any language. Remember that websites are written in nothing but "safe" languages yet are some of the most commonly exploited out there. One of the main reasons C gets picked on in these sorts of things is because of the sorts of things C is used for. When you have incredibly complex tasks such as OS kernels or network stacks, you're going to have vulnerabilities. Go ahead, write it in python or whatever safe language you choose, I promise you, there will still be vulnerabilities.

    16. Re:A poor craftsman blames his tools. by guruevi · · Score: 1

      Exactly this. I am building an application, slowly building it up and taking my time and there are minimal amounts of bugs in it. I test after each section. It's a rebuild of an application I built years ago under extreme time and budget pressure, needless to say the thing is held together with metal wire and duct tape at this point. Now I have the opportunity to rebuild it on my own time frame, it's so much better.

      The other problem is that things are trying to be too much. They are following the weirdest constructions in the name of simplicity, extensibility and portability that it ends up being so complex it is impossible to learn the framework if you're not already a core developer of the framework. And as a commercial programmer, if you can't read and understand the core of the framework in less than an hour, you can't effectively use the thing, sitting and studying for days or weeks to get your head wrapped around some quirky methodology is for CS, not feasible in a commercial setting.

      You can safely code in PHP or JavaScript if you're careful but then you have monstrosities like Angular or .NET that make a language feel and act an entirely different language.

      --
      Custom electronics and digital signage for your business: www.evcircuits.com
    17. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      The problem is, no one has yet made a safe language that really can be used for low level systems programming. Go, Rust and Swift all promised big on this, but all of them have somewhat unexpected semantics in critical places that can't be worked around. For example, the Swift compiler can arbitrarily insert ARC code in between any of your code. That doesn't sound too bad, until you realise that it has a number of important side effects:
        It might perform allocation/deallocation, which can cause system state to change under your nose (an example being that errno might not be set to the correct value any more). You could argue that that's just a case of poor design with errno's global state fulness (and I'd agree), but it still means that swift fundamentally can't interact well with that kind of API.
        It might be required to lock locks to make sure that the ARC operation is performed safely. Failing to take a lock can cause a 1ms yield on several OSes. 1ms isn't much for many programs, but for some (for a game, that might be 1/8th of the entire time it has to render a frame) it's an inordinately high penalty.
        It might cause a deallocation of a large amount of memory, and then a whole load *more* ARC operations and deallocations, and so on and so forth. The penalty for doing all that work running destructors and doing deallocation bookkeeping might be huge. There's a large class of low level processes where that unexpected delay is completely unacceptable.

      Fundamentally, programmers writing low level, high performance processes, either deep in the OS, or at the application level need control over these things. No safe language has yet managed to figure out how to make that work out properly.

    18. Re:A poor craftsman blames his tools. by Vlad_the_Inhaler · · Score: 1

      The first time I was confronted with C I was shocked - they check for binary zero as a string terminator? seriously? wtf?
      I studied compilers and languages (amongst other things) in the 70's and that one decision - which Dennis Ritchie has since said he very much regrets - flies against everything we were being taught. Of course C had been released a year earlier but I don't remember it being mentioned directly as something to avoid.
      What else was there?

      • Pascal with its fixed-length strings was certainly not the answer.
      • Algol68 never achieved critical mass although it had a hell of a lot going for it.
      • Fortran (the 1977 standard, not earlier versions) was/is a decent language.
      • PL/1 was designed to run on IBM 360/370s and its deficiencies tended to be mandated by the hardware inadequacies.
      • I can't remember what some of the other offerings were even called nowadays.

      I have worked on a line of computers where the OS was written in pre-1977 Fortran and some assembler, later versions of the OS were written in PL/1 but I had moved on by then.
      We were taught that the compiler should take care of a lot of the error-checking for you and when I do any programming nowadays, the languages I use still do that. Some have runtime array-checking as an option at compile time, one you can turn off later if you feel the need. Works for me and has done for decades now. I try and avoid languages where a subroutine cannot ask how long argument n is.
      Several of the things we were taught turned out to be bad ideas but not that one.
      If only Algol68 had made it, there would be no code-obfustication competitions there.

      --
      Mielipiteet omiani - Opinions personal, facts suspect.
    19. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Apparently LangSec doesn't know about smart pointers or RAII.

      Wake me up when someone calls for Go or Rust for a reason that C++ hasn't already solved.

    20. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Well, I think it's a lot the language as well. To a first approximation, every major piece of system and networking software written in C has had serious security issues at one time or another

      That is true, but extremely dishonest.
      You know well that the same can be said for whatever language you prefer. (Assuming that it is even capable of handling system or networking software and doesn't require an environment written in a different language to support it.)

    21. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      This is the problem:
      The developer does not take ownership anymore. No responsibility at all:

      We rely on unit test to catch the bugs
      We rely on Fuzzing tests (lets be trendy) to find the bugs
      We rely on automation platforms to find the bugs.

      What happened with "We rely on the developer to do a good job?"
      Can we just stop finding excuses to deliver crap quality code? Tools are convenient sure, but relying on them? Nope...not ever never..

      Maybe one language is more susceptible to bugs than another, sure,but I'm convinced that even in Rust I will be able to create a huge pile of stinking shit code that you can smell from miles away and of which the stench is not leaving your nostrils for the next weeks to come.

      So lets stop blaming the language, the tools,the automation for every bug and let's go back to basics:
      Developers should stop being a lazy ass when writing code. Don't take shortcuts, Do input sanitation the way it should (yes systemd guys...looking at you), do not use "To Do" comments. Implement it right away. Descent logging, keep comments minimal but to the point. Update it when you modify the code.
      Don't submit for codereview before it's really finished. Nobody likes doing a review of the same piece of code 20 times

      Then When the jobs is finished I asked myself 2 questions:
      1) I'm a proud about what I created?
      2) I'm I ready to sign off in blood that it works correctly in all cases?
      In case of slightest doubts on any of the 2 I go back to the coding table.

    22. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      No, it really is the language: http://macbeth.cs.ucdavis.edu/lang_study.pdf

    23. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 1

      "We Shape Our Tools, and Thereafter Our Tools Shape Us" ... http://quoteinvestigator.com/2016/06/26/shape/

      "Give me six hours to chop down a tree and I will spend the first four sharpening the axe." Abraham Lincoln

      “He that would perfect his work must first sharpen his tools." Confucius

    24. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 5, Insightful

      What happened with "We rely on the developer to do a good job?"

      We tried that experiment, and it failed when roughly 0% of professional programmers turned out to be more reliable than an automated tool designed specifically to prevent certain types of programming error.

      Can we just stop finding excuses to deliver crap quality code?

      You're implying a false dichotomy. There are plenty of programmers who produce generally decent code but still make mistakes that better tools will catch before they go into production.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    25. Re: A poor craftsman blames his tools. by layabout · · Score: 1

      Yes it is hard to find good people. It's always been hard to find good people but the best company I ever worked for had a good 30 to 40% women programmers. We also had a significant number of graybeards who were tasked with the responsibility of training good behavior into the young punks. These graybeards also encourages young punks to teach them something new. So, if you want good people, they come in all ages and genders. You have to be willing to have your senior people set the right standard that everybody else has to live up to.

    26. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      What if "Agile" (process) is the problem.

    27. Re:A poor craftsman blames his tools. by plopez · · Score: 1

      Or built by some low end contractor who got their degree from a street corner diploma mill school. And then get thrust into building enterprise scale software.

      --
      putting the 'B' in LGBTQ+
    28. Re:A poor craftsman blames his tools. by Greyfox · · Score: 2
      This is the core of the problem, here. I've been in the software industry since '89 and see the same patterns again and again. The software you're working on was always rushed. They rushed it out the door with incomplete (or no) understanding of the problems they were trying to solve, the business model and in a lot of cases, of writing software at all. They crapped out one giant piece of software with no way to verify its outputs and then went into maintenance mode where they were constantly putting out fires and digging the hole deeper and deeper. There was never time to stop and fix things ("Pay down technical debt") because there was always another emergency, another fire to put out.

      A lot of these projects had no way to test changes other than to push them up to production and see what happened. The worst offenders had systems that were so tightly coupled that you could only run data start-to-finish through the entire system, which made setting up test systems difficult. In some cases, no one in the company had a complete understanding of the full system.

      Even in such situations, it's still possible to drive quality in the system. It requires a whole lot of reading and understanding -- you need to know and understand the business driving the software, the requirements of the business and customers and you have to understand a lot of very convoluted code. You also have to be able to verify changes worked as expected and introduced no other bugs without having to push the software all the way to production to do so. But most of all you have to have the will to actually improve things rather than accept that this is just how this project is. Quite frequently the team in place doesn't have a lot of incentive to have that will -- if the software is ever actually good, it would threaten those fat paychecks they collect for maintaining the mess.

      --

      I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

    29. Re:A poor craftsman blames his tools. by plopez · · Score: 2, Insightful

      I have worked in the industry since the late 80's. I have NEVER been allowed to choose all of my tools.

      --
      putting the 'B' in LGBTQ+
    30. Re:A poor craftsman blames his tools. by HornWumpus · · Score: 1

      You chose your jobs poorly.

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
    31. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      You know well that the same can be said for whatever language you prefer.

      Sorry, but I don't agree with that. I see no technical reason why, in 2016, we should still be writing high reliability systems in a programming language with cryptic, error-prone syntax where the default is to accept code that is almost certainly erroneous. Buffer/stack overflows, type mismatches, null pointer errors and numerous other classes of programming bug that are ridiculously common in C code should all have died out years ago, and the reasons for C's continued popularity have very little to do with its technical merit.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    32. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      While we have yet to invent a totally foolproof language, there is still a matter of degree. We may never be able to eliminate all programming errors with tools alone, but we can certainly eliminate entire categories of them, and some languages are very much better than others at doing that.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    33. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      As programmers, automation is the essence of what we do.

      What does that sentence mean?

    34. Re:A poor craftsman blames his tools. by HornWumpus · · Score: 1

      Agile is a manifesto not a process. Part of the manifesto is 'people over process'. Your boss is doing it wrong.

      If a prospective employer tells you they are agile the first question should be 'how does your pay compare to local industry averages?' Any answer other than 'our people get substantially above average compensation' tells you they are _not_ agile. Agile emphasises hiring 'competent enthusiastic individuals', those people don't work for industry average (long term).

      A person that manages a poorly paid 'agile' team is full of shit. They are most likely a scrum slum. Run away!

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
    35. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 2

      A programmer that can automate its work will be replaced by his computer in a couple of years tops.

      No problem. Once I've finished automating the routine parts of what I currently build, I'll be able to build more capable systems faster next year using the extra time.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    36. Re:A poor craftsman blames his tools. by Immerman · · Score: 1

      >In case of slightest doubts on any of the 2 I go back to the coding table.

      That's great if you have unlimited time to work. If you're under extreme pressure to have it working yesterday, and/or are not the one who gets to make the call as to when it's "good enough to ship", then the quality is liable to be much lower.

      I think most decent programmers would love to make their code better, but unless they are given the time do do so, they don't have that option. As for you with your unlimited time - if you're willing to spend twice as much time for no more money to get a client's software "just right" once they're already happy with "good enough", then more power to you.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    37. Re:A poor craftsman blames his tools. by umghhh · · Score: 1
      You mean you never finish?

      It would really help if so called SW engineers did an engineering course. Any would do I think as lpong as they have reliability of a product and/or system in program.

      Assumption that SW piece can be faultless is already wrong. Smarter of us know this but because this got trough also to not smart enough folk, the result is that they say: cannot produce faultless SW so we do not need to try too hard. Better rely on [silver bullet of choice] to find them. etc

    38. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 1

      If you had ever tried cutting a compound miter on the end of a 12' stick of mold you would realize that a table saw is exactly the wrong tool for the job. And if you had actually ever put up crown molding you would realize that well over half of the corners are inside corners and compound miters only good for outside corners. Your example also ignores all of the subtlety in the problem, simply there is no such thing as square, plumb, or a 90 degree corner. So now you are stuck with no knowledge, no skill, and a tool that is perfect for doing a completely different job. However, if you had two different handsaws and a little easily gained knowledge and experience you could do the job better, faster, cheaper, and safer.

      I have almost 30 years of experience in IT. There is no language problem and there is no programmer problem. The problem is management. The executives and management of business don't care about security or creating good software. There is no bonus for creating good software and there is a bonus for cramming things through at a low cost. If you want better software change management.

    39. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Good tools don't make a good craftsman. A good craftsman can produce better work with bad tools than a bad craftsman can produce with good tools.

      The root of the problem is the craftsman, not the tools!

      Employers hire cheap-ass craftsmen who don't know squat about writing secure code (let alone scalable, reliable, and maintainable), and further overwork them and compel them to deliver with far too little time.

      That has produced the mess we are in. Better languages will not make a dent in this problem. Legal accountability against the rights-holders (which exists in other mission-critical industries) is the only way to see improvement.

    40. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Buffer/stack overflows, type mismatches, null pointer errors and numerous other classes of programming bug that are ridiculously common in C code should all have died out years ago,

      The problem is that not checking these things is fast. Also, not managing memory and not cleaning up and not garbage collecting and not automatically doing any number of other things that may not be strictly necessary is fast. There are some very critical real world applications where being fast and guaranteeing execution times is very, very important and that is where C really shines. The downside to all of this, of course, is that C demands an expert programmer who is not in any way limited by his own incompetence or lack of understanding and people like that are very hard to find.

    41. Re:A poor craftsman blames his tools. by Bengie · · Score: 4, Insightful

      against what the senior people advice

      Most senior people are equally incompetent. Senior programmers tend to be pattern-anti-pattern cargo-cult programmers. They seem competent to those who are incompetent themselves. They also like to use buzzwords. "I'm going to use a no-sql database to increase the scaling performance" only to reinvent a relational database on top of a no-sql database and get strange data oddities because they didn't realize that "transactions" in their chosen no-sql DB does not mean the same thing as "transactions" in a proper relational database. Then after fixing the transnational issues, the no-sql DB is now slower because synchronization is more expensive in no-sql.

      Knowledge in an of itself is useless. The Google datacenter is more knowledgeable than any human, yet it is stupid, about as smart as an insect. Wisdom is what one gains from making mistakes, talent allows you to skip making mistakes in the first place. A wise person can correctly recreate what they have already done in the past, talented person can correctly create something entirely new.

    42. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      1) I'm a proud about what I created?
      2) I'm I ready to sign off in blood that it works correctly in all cases? In case of slightest doubts on any of the 2 I go back to the coding table.

      1) I don't know, I was fired for taking too long.
      2) See 1)

    43. Re:A poor craftsman blames his tools. by Cederic · · Score: 2

      Sure.
      Lets ditch double-entry book keeping and make accountants add up properly.
      Lets ditch medicines and make doctors heal people with their own skills.
      Lets ditch case law and force lawyers to properly argue why their clients are innocent.

      Or maybe, just maybe, professional software engineers take full ownership, full responsibility and exploit the tools and systems available to them to maximise the chances of good outcomes without adding unsustainable cost or time burdens on their work.

      Maybe.

    44. Re:A poor craftsman blames his tools. by Cederic · · Score: 1

      It means that when you eliminate the fancy words, the marketing, the ego, the bullshit and everything else.. programmers automate stuff.

    45. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 1

      Bjarne has created one of the most horrible programming languages on earth, not even seasoned C++ programmers who otherwise like it deny that it has many quirks and is horribly complex. So I really wouldn't take whatever he has to say about good software engineering and programming tools too seriously. He's just defending his own design decisions which might have made sense at some time but turned out to be a rather two-edged sword in the long run.

    46. Re:A poor craftsman blames his tools. by Bengie · · Score: 1

      You are free to create your own proposed language, but so far no one has been successful. C is still used where performance and low level access is a requirement.

    47. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      Thank you. Yes, that's pretty much what I meant.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    48. Re:A poor craftsman blames his tools. by fuzzyfuzzyfungus · · Score: 2

      You should probably consider how much of what we just take for granted counts as 'automating your work'.

      Yes, if you can't function without a point-n'-drool EZ Wizard; you are probably of limited use and facing limited future prospects; but do we seriously expect all those lazy, incomptent, losers who rely on a "file system" to provide a convenient abstraction when a real man could just access the block device directly; or the pansies who use 'compilers' because they suck too much to produce machine code themselves to be heading for the bread lines?

      Outside of some(often well compensated, since they are genuinely difficult) specialty situations that bring you very, very, close to the metal(or make you responsible for designing 'the metal') almost all software development is done on top of a fairly gigantic pile of tools that automate assorted ugly details; it's not something exclusive to ITT tech java monkeys.

    49. Re:A poor craftsman blames his tools. by scamper_22 · · Score: 2

      Definitely agree.

      It is really good that programming is so accessible. It was really easy for me to get started back in the day. First in BASIC. Then in C/C++.

      The problem is that line between casual use and professional.

      I've made bridges before. I built them using Lego at one point. I build them using wood and Popsicle sticks. But who would think that qualifies me to build an actual bridge across a river that people would use?

      Or less crazy, I use Excel and know spreadsheets. I have pretty good knowledge of numbers and banking. Who would think that qualifies me to run their accounting department? The line here is much greyer actually. Because I could probably hack something together to do the books for a small business.

      The problem with software is that use-cases aren't graded enough. I've written banking, networking, industrial/mining software. These are serious fields and in all these fields, the bar was pretty much the same as when I worked on some app. It's really sad actually.

      The focus on programming languages not the issue in my view. It's that serious fields don't do enough to differentiate themselves from casual fields in software.

    50. Re:A poor craftsman blames his tools. by Tyler+Durden · · Score: 1

      Buffer/stack overflows, type mismatches, null pointer errors and numerous other classes of programming bug that are ridiculously common in C code should all have died out years ago, and the reasons for C's continued popularity have very little to do with its technical merit.

      Yeah, don't be so sure.

      --
      Happy people make bad consumers.
    51. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      I chose my examples very carefully. All of the things I mentioned can be prevented to some extent (much more than C does) at compile time, with zero run-time overhead.

      There are also plenty of techniques for managing memory that are significantly safer than C, yet still deterministic and with negligible run-time overhead rather than relying on out of band garbage collection.

      As for your expert programmer, I don't think that person exists, and I say that as someone who writes a lot of high-performance, high-reliability code for a living.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    52. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      The first time I was confronted with C I was shocked - they check for binary zero as a string terminator? seriously? wtf?

      Huh? C doesn't enforce a method to terminate strings.
      The ISO library uses that method but I've seen plenty of other versions.

    53. Re: A poor craftsman blames his tools. by edmudama · · Score: 1

      Ultimately we are to blame.

      Customers are willing to pay for buggy software.
      Thus management recognizes that above a certain level of shittiness, the faster you ship the better.

      Until customers get the ability to easily refund software or choose not to buy it, we won't see any changes.

      --
      More data, damnit!
    54. Re: A poor craftsman blames his tools. by AchilleTalon · · Score: 1

      My 30 years experience in IT is telling me the same. But, I must say to the discharge of management, evaluating the quality of a piece of code that is just delivered in terms of reliability and security is not an easy task, hence the indifference to the quality of code. They will never be evaluated on it because they cannot evaluate it themselves. What they can be evaluated on is time to delivery and costs.

      --
      Achille Talon
      Hop!
    55. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 4, Insightful

      I think Bjarne Stroustrup, among others, could reasonably challenge your claim.

      But as I said, the reasons for C's continued popularity aren't technical. There's a huge ecosystem around it, including using it as programming's lingua franca. For that to change, either we need an industry heavyweight with enough resources to create not just a better language but the tools and libraries and developer ecosystem around it, or we need some sort of external pressure to drive the change, so that enough professional developers start caring enough about improving quality to switch to new languages and tools despite C's established presence.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    56. Re:A poor craftsman blames his tools. by LWATCDR · · Score: 1

      Funny but back when I started programing Pascal was supposed to fix all those problems by enforcing strong typing and structured programing. Then came Smalltalk, and so on...

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    57. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Your analogy is wrong.

      A lumberjack probably use a chainsaw now and then, a chainsaw is really dangerous if not used correctly, it doesn't make it a poor tool. Every tool has its place, but you still need to use it properly, or things will probably go wrong.

      I've spent 10 years of my life writing security critical code in C and there has not been one security critical bug found in any of the code I wrote, to my knowledge. There has been bugs, yes, but nothing with any security implications. We made damn well sure that there wouldn't be any.

      The problem with systemd is that it is a critical part of a Linux system, but it wasn't developed with that in mind. These kind of problems would probably have been there no matter what language they used.

    58. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      The problem is, no one has yet made a safe language that really can be used for low level systems programming. Go, Rust and Swift all promised big on this, but all of them have somewhat unexpected semantics in critical places that can't be worked around. For example, the Swift compiler can arbitrarily insert ARC code in between any of your code.

      Swift has a currently non-optional garbage collector (which ARC is, don't let the different terminology fool you.) So does Go. Rust, on the other hand, doesn't have a GC at all, and derives its safety guarantees from compile-time region and type analysis. Which makes it eminently suitable for low-level programming where predictable performance is paramount.

    59. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      Sorry, I'm not seeing anything there that negates my point. There is no technical reason we couldn't use a language with a modern type system and features, and with sane handling of low-level elements like pointers, ports and buffers, yet still have the kind of low-level control that Torvalds is talking about in your video. The problem is that hardly anybody has both the desire and the resources to write that language and build everything else that goes with it, because C is considered "good enough" by too much of the industry.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    60. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      There is no language problem and there is no programmer problem.

      Not entirely true. There are absolutely incompetent and/or lazy programmers out there. There are absolutely languages and language (mis)features that enable these same (or even good programmers--none are perfect) to create sub-par code with bugs and security problems more easily than others.

      The problem is management. The executives and management of business don't care about security or creating good software. There is no bonus for creating good software and there is a bonus for cramming things through at a low cost. If you want better software change management.

      Mostly this--but to be fair, quite often indirectly. They are acting in response to pressure from the market--which is dictating where the incentives lie. If there were a larger, explicitly enumerable, tangible risk to each or identifiable categories of bugs and/or security weaknesses, then the liability insurance policies could more easily push that burden onto the businesses in a clear way--after which they could easily justify to the shareholders and budget managers allocating developer resources to writing better code, auditing, testing, etc. Don't forget that payroll is usually a company's largest cost--and allocating developer and IT resources to preventatively solving mere potential risks that are poorly if at all enumerable is a very hard sell--especially when comparing with some feature XYZ that has a thoroughly researched and calculated expected return for the same investment of resources.

      Even if they did have clearly assessed risks, quite often companies are more interested in optimism and pushing forward than pessimism and mitigating the fear of moving backwards. Optimal resource allocation is rarely a simple decision.

    61. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Or worse, written by one of the managers who is the only one that can write the code because he's the only one with critical information on functionality.(Call it job security.) This would be ok if the person wasn't such a terrible developer that they write "object oriented code" in C++ but have literally never used the keywords private or protected. (Which is basically impossible.) I could mention the whole part about refusing to use source control either.

    62. Re:A poor craftsman blames his tools. by Spazmania · · Score: 5, Insightful

      Java is a memory safe language. Great error handling too. The language does so many things right, it's scary.

      Intermediate result: java attracts incompetent programmers who find that their java code doesn't outright crash the way their C code tends to. Because their code works, more or less, it becomes hard for a non-programmer manager to tell the difference between a java guru and an incompetent boob.

      Final result: most java code is utter crap riddled with errors compared to typical C code.

      --
      Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
    63. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Maybe---but not as long as they don't sign their own paycheck.

      Further, what other disciplines allow for the title "engineer" without a state certification/licensing board?
      We need to formalize it, and perhaps *require* that each software vendor staff at least one *licensed* software engineer who then puts his stamp of approval (license at risk) before releasing it... just like we do with buildings, bridges, chemical products, electric products, etc.

      Hell, you can't mount solar panels on a roof w/o a licensed civil engineer approving the plans (wouldn't want any roofs collapsing), *and* a licensed master electrician certifying the connections at the transfer switch (and it's just plugging in pairs of wires!).

      We have software *driving cars*, *flying airplanes*, and *running medical equipment* that has less regulation. Not to mention positioned in every aspect of our lives (phones, IoT devices, banking apps, etc) where any one of a number of failures could cost millions in the aggregate.

    64. Re:A poor craftsman blames his tools. by johanw · · Score: 1

      Java code aften crashes on what in C programs would be a nullpointer dereference. That's the penalty for over-engeneering the OO model.

    65. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Yep. But so long as rights-holders are not held legally liable for security flaws, the industry will continue to invest in the lowest bidder.

      Alternatively, I suppose we could require businesses to hire developers who have passed a programming equivalent to the legal bar exam. Of course, they would scream bloody murder about the lack of supply and the ridiculous prices that certified developers charge. So, that will never happen.

    66. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      I am assuming English isn't your first language. I didn't understand a god damn thing you said.

    67. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Uhm, /. how can the parent be modded insightful? Of course, a good craftsman insist that his tools do the job for him. That's what they are for.

    68. Re:A poor craftsman blames his tools. by perpenso · · Score: 1

      Most problems with C++ are inappropriate or excessive use of some feature. That does not mean the feature is bad, just that a person is making poor implementation choices. Someone new to C++ is like someone new to word processors. Their first few documents have way too many fonts and size changes and colors. The author is excited at all the choices and wants to use them all. With a little more experience they calm down and become more selective in their use of features and produce better results.

    69. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      "rush" is the biggest factor. The main goal of frameworks and languages increasingly is programmer efficiency. As a result, we end up with lots of throw-away code.

      The focus should be on creating maintainable code, which can be improved and extended.

    70. Re:A poor craftsman blames his tools. by gweihir · · Score: 1

      Indeed. The reasons are coder skill, or rather lack thereof. Of course, a strong factor is that bad and very bad coders are used in projects because they are cheap. Many of these people have no business writing software that has any level of criticality. Hence while bad coders are the primary cause (and these days most coders are bad), management incompetence that makes them hire bad coders (because "one coder hour" is always the same, right?) is that actual root cause. Bad coders have negative productivity, because afterwards you need to clean up their mess.

      Incidentally, all these demented "learn to code" initiatives will make matters worse.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    71. Re:A poor craftsman blames his tools. by gweihir · · Score: 1

      Matches my experience. This is exactly what is going on. Most Java "coders" would utterly fail if they needed to code in C and get weeded out. Incidentally, I Java tends to stand in the way of good coders, making the overall effect worse.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    72. Re:A poor craftsman blames his tools. by gweihir · · Score: 1

      To a good craftsman, C is a good tool. To an incompetent, it is not.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    73. Re:A poor craftsman blames his tools. by gweihir · · Score: 1

      And that mind-set kills software quality utterly. The tools cannot at this time do anything like you think they can. And there is that second aspect: People are using tools to fill in skills they do not have, but would critically need to understand what they are doing.

      No, at this time, you may trust a compiler, but that is about it. Anything more will result in bad code.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    74. Re:A poor craftsman blames his tools. by gweihir · · Score: 1

      The focus on programming languages not the issue in my view. It's that serious fields don't do enough to differentiate themselves from casual fields in software.

      One reason for that may be that there are not many professional-level coders and that they are expensive. Hiring cheap "casual codes" universally turns out to be very expensive in the long run though.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    75. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      I agree with the sentiment, but it's also true that a great craftsman with shitty, unreliable tools is not going to produce the best possible work, either. /anecdote
      I had a buddy back in college who spent way more money than he ever should have buying a set of very expensive, very high quality golf clubs. When I asked him why he spent so much, his answer was, "These are the clubs that Tiger Woods uses!" (this was when tiger woods was objectively one of the best golfers on the planet.)

      I tried to explain to him that buying expensive, high-quality clubs would not make him play like Tiger Woods, and he should have started off with a cheap, budget-priced set instead. A skilled player will get extra performance out of high quality clubs; An unskilled player will see almost no performance difference between high quality and low-quality clubs.

    76. Re:A poor craftsman blames his tools. by gweihir · · Score: 1

      I disagree. This approach is the road to hell, as it drives up cost massively and leads to failing infrastructures that can often not be fixed anymore.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    77. Re: A poor craftsman blames his tools. by W2k · · Score: 1

      I run away from do-it-at-home tests because they take up too much of my free time. It's way too easy to find work as a developer, I'll pick an employer that trusts my interview and references and doesn't expect me to jump through hoops. I'll happily provide samples of prior work (it's on GitHub).

      --
      Quality, performance, value; you get only two, and you don't always get to pick.
    78. Re:A poor craftsman blames his tools. by RandomSurfer314 · · Score: 2

      Like with all language threads, there is so much swagger and misinformation by language afficionados in this discussion. To be honest, I wouldn't trust anyone who calls himself a 'programmer' and doesn't think he could do the job in practically any language or doesn't admit that C and C++ are less safe than, say, Ada or Rust. Everybody has his preferences, no doubt about that, but it's childish and tiresome to hear these silly "my language can do it too" or "everybody uses my language so it must be perfect" comments.

      There are objective evaluation criteria for the overall safety of programming languages and their implementations. If you want to write safe code, then you either should use a relatively safe language with a good implementation, or you need to use appropriate bug checking tools to validate your programs. There are plenty of such tools for C and C++, too, so of course safe programs can be run in these languages. But you also have to use these tools, or you'll get more buggy programs in the long run. That's not (yet) really rocket science, is it?

    79. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 1

      There is no language problem and there is no programmer problem. The problem is management.

      I have only 22 years of experience in IT, and even I can tell you that you're an over-simplifying simpleton if you believe that statement.

      Certainly, management is PART of the problem, but programmers bear an equal share of the responsibility. In my 22 years, I have constantly seen programmers OVER-promise, provide estimates of "oh that'll just take like, 2 days, to deliver a working production-ready binary," and fail to apply back-pressure to management to force them to see and deal with the technical debt they're accumulating.

      These programmers fail to learn to speak the language of the business, and fail to acknowledge that their software MUST satisfy a business need. They sit there, patiently waiting to "take orders," when they should be engaging with the business and helping to highlight the trade-offs that are being made to satisfy speed to market, and engaging in some level of estimating discipline. I can't COUNT the number of times I've heard other engineers say, "I can knock that out this afternoon," when talking about a major feature that ends up taking 3-6 WEEKS to deliver in a working condition.

      But yeah, blame management because they ask for unrealistic things. Might as well also blame children for asking for the moon, when they haven't been taught what's realistic.

      The executives and management of business don't care about security or creating good software.

      Right, they care about creating *valuable* software. What you define as "good" does not match what management defines as "good", and as a result, you're perpetually frustrated by management's inability to see. Perhaps you should learn to communicate more effectively before you start casting blame on ignorant management - they're telling you what they WANT, but you're not telling them what's POSSIBLE. Don't even tell me you do, because I've seen it way too many times with fellow engineers who don't seem capable of understanding that if you keep PROMISING people unattainable things, they will continue ASKING for unattainable things.

    80. Re: A poor craftsman blames his tools. by CCarrot · · Score: 2

      I am assuming English isn't your first language. I didn't understand a god damn thing you said.

      Then you need to work on your own comprehension skills. GP was perfectly understandable in spite of being a bit light in punctuation, using some awkward phrasing, and sporting two minor spelling errors. I've seen *much* worse from so-called 'native' English speakers.

      --
      "I love animals! Some are cute, others are tasty, what's not to like?" - Betsy Schroeder, Jeopardy contestant
    81. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 1

      A programmer that can automate its work will be replaced by his computer in a couple of years tops.

      A programmer that doesn't make use of existing tools to quickly automate the aspects of his work that can be automated, so that he or she can focus on the higher-value areas of his work that require intense thought and great craft, will be replaced by a low-priced overseas contractor in a couple of years, tops.

      And FYI, he/she/it is not a programmer, the proper term is 'code monkey.'

      FTFY.

    82. Re:A poor craftsman blames his tools. by CCarrot · · Score: 1

      Further, what other disciplines allow for the title "engineer" without a state certification/licensing board?

      Railroad engineers. Woo wooo!

      Mind you, I believe they still do have to be certified and/or licensed before they can claim the title, but it's still a grandfathered term that is outside the normalized definition of 'engineer'.

      --
      "I love animals! Some are cute, others are tasty, what's not to like?" - Betsy Schroeder, Jeopardy contestant
    83. Re:A poor craftsman blames his tools. by Solandri · · Score: 2

      And therein lies the problem. Programming tools are not interchangeable. Once a programming project starts using one set of tools, everyone working on it then and in the future has to use that same set of tools. A lot of the craftsmen writing software aren't very good. Many of them are self-taught with very little formal training in programming or algorithms. A lot of the "popular" tools are the ones chosen by these poor craftsmen. It's like making science decisions by democracy, when 80% of the population doesn't know squat about science.

      I once wasted half a day tracking down a bug in PHP. It turned out I'd made a typo in a variable name and hit zero (0) while pressing shift too lightly, instead of typing the capital letter O. Very easy to miss. PHP doesn't require you to declare variables. It automatically turned the typo into a new variable, which caused a formula to modify this new variable instead of the original one, causing the bug. The better programming languages force you to declare variables to avoid insidious bugs like this . But PHP grew organically, and some lazy/ignorant person decided it was too much work to declare variables, unaware of the consequences of removing that safety check.

      PHP is a terrible, terrible language. Even the original author admits there is no rhyme or reason to it. It is basically a hodgepodge of patches and kludges tied together by string and glue. But because it arrived first on the scene, it reached critical mass first. A huge number of programmers in the past made contributions to expanding and improving it, so new programmers feel compelled to use it. It has become The scripting language for web programming.

      You have to have PHP in your toolbox. It doesn't matter if you're the greatest craftsman/programmer to ever graduate from Stanford or MIT. If you're hired to help fix someone's website and it's written in PHP, you gotta write your fix in PHP. You might be tempted to code the fix in a better language and have the PHP script call it, but that destroys the maintainability of the code for future programmers. So you're stuck with PHP.

      In programming, the good craftsman has his tools chosen by the person who began the project. Which usually was 10 years ago when the company owner decided he needed a website, and his son in jr. high offered to make it for him.

    84. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      It's not the language, it's the programmers and the rush to produce easy code.

      Well, I think it's a lot the language as well. To a first approximation, every major piece of system and networking software written in C has had serious security issues at one time or another, even the ones written by the best programmers of their generation and hailed as being exemplary in their code quality. I think after the first few decades of evidence we're allowed to call this one now, and say that writing critical software in unnecessarily dangerous languages produces less than optimal results.

      What do you recommend system and networking software be written in instead?

    85. Re: A poor craftsman blames his tools. by ZenShadow · · Score: 1

      OTOH, managers that don't understand how long software should take to build simply aren't qualified to be software development managers. The over-promising is often a symptom of this; people are afraid for their jobs if they tell the truth.

      I've seen this far too many times to count. If managers truly understood the technology they were managing, we'd be far better off.

      --
      -- sigs cause cancer.
    86. Re:A poor craftsman blames his tools. by xiux · · Score: 1

      I agree to a point.

      I don't think everyone needs to call a licensed plumber to unclog a toilet, nor does small business bookkeeping require years of schooling. I see it more as a failure of management, because as the stakes become higher, they fail to properly manage the critical dependencies of the organisation by bringing in more qualified talent as the need arises. Business owners that can identify when they've reached their limit in a skill and hire someone more competent, are more likely to succeed and grow than those who don't. This scenario isn't limited to computers, it could be any area of expertise within an organisation.

      The Excel macro created by the boss' nephew is fine up to a point, then it's up to management to step in, declare amateur hour over, and hire the required expertise if the Excel macro's usefulness outgrows the nephew's limited skillset. Ideally the call is made before it becomes mission critical. The point is no matter how skilled and qualified an employee is, it will not compensate for management being asleep at the wheel.

    87. Re:A poor craftsman blames his tools. by ZenShadow · · Score: 2

      Don't mistake "hipster" for "senior."

      The hipsters are the ones braying about NoSQL and the like. The senior engineers are the ones saying, "Yeah, we called those object databases back in the day. Seen it before. It won't solve your problem."

      Everything (including so-called NoSQL) has its place. The senior people are the ones who know where that place is, and that nothing is a silver bullet.

      --
      -- sigs cause cancer.
    88. Re:A poor craftsman blames his tools. by ZenShadow · · Score: 3, Insightful

      In the application space, you can argue all you want for better languages. There's nothing stopping it there. I'll still disagree with you, but there is no technical reason why the average application can't be written in whatever language you choose. Why? Because the low-level stuff is already done, far beneath your application.

      If you're dealing with hardware (eg. writing an operating system, or code for a microcontroller that manages the brakes in your car), then using those higher level languages is a non-start. Every CPU cycle counts, especially in the latter case. Hardware does not understand the high level string constructs (not even C-style NULL terminated ones!) and data structures present in ANY high-level language. Hardware is a collection of registers in specific places that you have to poke and prod in specific orders to make things happen.

      Good luck enforcing a safe memory access when that access involves poking raw numbers into sixteen different registers (some bit-level options, some addresses), and then going off to do something else while the DMA hardware (hopefully) executes it the way you intended. At the low level, you're going to be dealing with bounds-unchecked pointers whether you like it or not.

      There is none of this safety you want in hardware.

      Unless and until someone invents hardware that directly handles "managed code", languages like C are *very* necessary. They are the bridge between the hardware and whatever hipster silver-bullet language you've chosen to solve all your problems today.

      --
      -- sigs cause cancer.
    89. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 1

      Going by my own experience in the industry, most programmers I've met are poor craftsmen. And even the star programmers who can work miracles occasionally have an off day. Languages don't exist in a void filled with abstract Turing machines and the platonic ideals of star programmers – they exist in this world, where most development positions are held by programmers with questionable IQ and bad personality.
      And the world teaches us time and time again that poor language features do cause bugs. Sure, a star programmer on a good day might not have messed up, but in the real world, most programmers do mess up. Language design flaws will inevitably lead to bad software. And we haven't always got much choice in what software to use. Maybe we need it in order to use some other piece of software, maybe it runs on a server where we cannot choose, ... Or maybe the software we trust turns out to be worse under the hood than we thought.

      Design a programming language for the web which is completely unsuited for the web, like PHP, and you get all the unescaped user input vulnerabilities, login vulnerabilities, double-escaped display bugs and so on and so forth. Many of these programmers have been early-adopting geeks, yet still...
      Design a programming language where values, lists, argument lists and such can seamlessly flow into each other unnoticed, like Perl, and systems developed in it will suffer horrendous bugs because of it, even though it is all programmed by ancient greybeards who at least wouldn't consider themselves poor craftsmen.
      Design a programming language where the main way to deal with strings and lists is through unguarded pointers in memory buffers, like C, and you get endless security vulnerabilities due do buffer overflows and heap corruption, an unending stream of patches in Windows Update.
      Design a programming language that allows you to catch all exceptions, even if you know nothing about what caused them, like C#, and you get industrial systems behaving erratically and then crashing with the IP several kilometres away from the original problem, and mysterious software problems where it just won't do what you tell it to do that nobody can quite track down.
      Design a programming language with manual memory management, like C++, and you will be dealing with a lot of double-free errors, heap corruption, memory leaks, null-pointer references and suchlike. And with a lot of extra design-time up-front just to try to avoid most of it.

      In the real world, the design of the programming language you use has very real effects on your software.

    90. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      It's not the language, it's the programmers and the rush to produce easy code. Speed and simplicity trumps security and efficient coding these days.

      A simple hammer and chisel in the hands of a Michelangelo can produce perfection.

      The same tools in the hands of the incompetent can produce a pile of rubble.

    91. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 1

      There are not many platforms where de-referencing a null pointer can lead to anything good.

      Usually it's "crash now" or "corrupt and crash unpredictably".

    92. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      The deadly twins:

      Users/managers: "All You Have To Do Is..."

      Developers/programmers: "All I Have To Do Is..."

    93. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      A programmer that can automate its work will be replaced by his computer in a couple of years tops.

      No problem. Once I've finished automating the routine parts of what I currently build, I'll be able to build more capable systems faster next year using the extra time.

      Been there. Did that. Got laid off because I wasn't needed anymore thanks to smart tools.

    94. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Good craftsman plan, design, iterate, build and test.

      We don't do that with software!

      What does one want to do: write a novel (takes years), write a text book, write a news article or write a blog? Paradigm applies to s/w development.

    95. Re:A poor craftsman blames his tools. by sjames · · Score: 1

      In other words, the problem is that ownership has been TAKEN from you.

    96. Re:A poor craftsman blames his tools. by phantomfive · · Score: 2

      At my last company, I worked with a mix of Java, C, and Javascript. I ended up fixing a few memory leaks in the Java code, but the Javascript guys were fixing memory leaks by the thousands (it starts to matter when you have web applications that stay on the same page for a long time). The C code had no memory leaks while I worked there: the C guys recognized that it was likely to be a problem, and developed a system to avoid it.

      "A good programmer can write good code in any language, a bad programmer will write bad code in every language."

      --
      "First they came for the slanderers and i said nothing."
    97. Re:A poor craftsman blames his tools. by KingBenny · · Score: 1

      Yes, we must think about the children and use nothing but goodspeak. Empower the insignificance of four-letter combinations so much that they actually become powerful while no one gave a flying fuckabout the use of it before. And teach them how to ... do flawed guns shoot holes in people ? no wait, that's not a car-metaphor ARGS !
      agreed, most likely the use of skyscraper environments so far above machine level no one actually knows what they're doing but its fine as long as it looks matrix i suppose
      might be the point there, yea

      --
      Free speech was meant to be free for all... how can anyone grow up in a nanny state ?
    98. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Employers hire cheap-ass craftsmen who don't know squat about writing secure code (let alone scalable, reliable, and maintainable)

      No, employers hire monkeys. Because in these days of Lower Prices Everyday[TM], even cheap-ass craftsmen cost too much for them.

      There's no craft in there at all.

    99. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      The rubble often is a side-effect of producing the work. Look at the base of Mt. Rushmore!

    100. Re:A poor craftsman blames his tools. by AlphaBro · · Score: 2

      I don't know man, I quite enjoy automated conversion from high-level source code to low-level object code. If using a compiler makes me a "code money", so be it.

    101. Re:A poor craftsman blames his tools. by jellomizer · · Score: 1

      Don't blame the craftsman for the boss giving bad directives.

      How many times have we as developers try to find a shortcut so you can have the demo ready for next weeks meeting. You can't say that you spent two week to mirror the data validation checks in the business layer that you implemented in the user layer. Or that you spent reworking the core of the system to do the same thing as before however it will catch and handle unexpected things.

      We as developers can stand up and say it needs to be better but that will often mean next month you will training your Indian replacement.

      Also if we go on our own if we try to make it right our competition will best us by the time we got it done.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    102. Re: A poor craftsman blames his tools. by reanjr · · Score: 1

      It's a problem of deadlines. Don't set them. Don't ask for them. Time should never be discussed. Any manager who discusses time with their programmers isn't doing their job properly.

    103. Re:A poor craftsman blames his tools. by Big+Hairy+Ian · · Score: 1

      It's not the Dev's it's the whole team stemming from the people who capture the requirements wrong all the way down the line to the man who signs off the software as fit for release when actually it should be binned.

      --

      Build a Man a Fire, and He'll Be Warm for a Day. Set a Man on Fire, and He'll Be Warm for the Rest of His Life.

    104. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      it's getting to the point where we can't do anything for ourselves anymore thanks to pissy, whiny, insecure losers like you.

      depressing.

    105. Re: A poor craftsman blames his tools. by sjames · · Score: 1

      The really good senior programmers aren't interested in jumping through your hoops and doing your circle the shape that doesn't belong tests. A good 30 minute sitdown with one of your proven programmers will do a better job than those tests anyway. Consider, some at least see right through the test and discern that if the test is a simple matter of cut/paste from google, then the test is actually a can you use google test. Do they REALLY want to work somewhere where their coworkers are cut/pasting from stack overflow all day?

      A better test might be to provide the code and ask what's wrong or right about it.

    106. Re:A poor craftsman blames his tools. by epyT-R · · Score: 1

      Actually, the third item sounds good. Too many courts let 'precedent' decide outcomes rather than reason and the individual case.

    107. Re:A poor craftsman blames his tools. by Cederic · · Score: 1

      Further, what other disciplines allow for the title "engineer" without a state certification/licensing board?

      My country doesn't have states.

      Anyway, software engineering is already a well structured and impressively defined discipline given it's existed for around 60 years. Civil engineers took more centuries than that to get to this stage.

    108. Re:A poor craftsman blames his tools. by sjames · · Score: 1

      It depends on what you're doing. A number of people here think you can take a 'safe' language and implement a complete OS in it. For the userspace, perhaps, but what of the kernel? There, you have to deal with the hardware. Allocating memory includes dealing with the page tables. You can have your safe bounds checked buffer but if the device wants to DMA right past the end of the buffer, it will. The compiler has no way to check for that. It's to the point that in some cases, C is too high level and you have to resort to assembly language for some functions.

    109. Re: A poor craftsman blames his tools. by ranton · · Score: 1

      I have only 22 years of experience in IT, and even I can tell you that you're an over-simplifying simpleton if you believe [the problem is management].

      The source of every problem is management, because they ultimately have the responsibility to deliver to stakeholders. They are responsible for poor hires, for not removing bad hires, for not putting good enough project managers in place to track progress, you name it. Don't get me wrong, the IT members actually making the mistakes also share blame, but a small percentage of it. Just like their income is only a fraction of their managers'.

      --
      -- All that is necessary for the triumph of evil is that good men do nothing. -- Edmund Burke
    110. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Business owners that can identify when they've reached their limit in a skill and hire someone more competent, are more likely to succeed and grow than those who don't. This scenario isn't limited to computers, it could be any area of expertise within an organisation.

      The problem with this approach is that allowing the under-skilled worker to begin a poor solution usually results in a terrible solution not even salvagable--and when they finally do hire a qualified expert to help, they restrict the expert to fixing the unfixable rather than allow them to succeed at what they excel at--creating a good, appropriate solution to the original problem.

    111. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Welll... no.

      C++ has too much excess baggage for low level handling. If you avoid using the excess baggage... you are ALREADY using C.

    112. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Yes and no. A good programmer given sufficient time will produce good software no matter what. An average programmer will produce good code given good language, average code otherwise. A bad programmer... you get the picture. Now: what is the ratio of good programmers to average programmers, and do you really think hr can tell the difference?

    113. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 1

      Yes. This. After 20 years of C to C++ to Java to C# with way too much JavaScript thrown in there too, I bailed on the whole high level language space and went back to embedded C. Why? Because the people I work with are now much smarter and life is better.

    114. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      > didn't realize that "transactions" in their chosen no-sql DB does not mean the same thing as "transactions" in a proper relational database. Then after fixing the transnational issues, the no-sql DB is now slower because synchronization is more expensive in no-sql.

      I've seen this repeatedly with "let's just use multicast instead of TCP!!!", where the overhead of cleaning up the inevitable errors and out of order packets, leads fabulous performance in the first proof of concept, but a complete manually written replacement of TCP by the end of the the third release candidate.

    115. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Those people are only called senior programmers by inexperienced management people.

      Truly good skilled craftsman are hard to find. Usually they have been doing whatever it is for 15+ years. In the IT world these days, everyone only wants to hire people in 30 which makes them unlikely to be really really good at what they do. Most really senior programmers started writing code before there were patterns and know that the latest new toy is really the same idea from 15 years ago that didn't work with a new coat of paint and an extra knobs. Truly new ideas only come around so often.

      Not saying non-senior people can't be talented or brilliant, just that they aren't "senior" because they haven't been there and done that in multiple verticals for umpteen times.

      Brilliant and talented people will eventually be senior people if they stay in the field or don't go into management.

    116. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      much rather have code written in Java or c# which are fairly equivilant all things considered. PHP and whatnot are frequently where there are a lot of challenges due to bad practices and the quantity of low skill developers. It is somewhat like what ASP was back in the late 90s.. just shoot us..... Non-tiered applications with SQL embedded in the code.. bleh...

    117. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      And all of these so called good craftsman are all competent right up until someone finds an exploit in it because it's C and inherently dangerous. Then we can all feel better about ourselves putting them down saying they were real craftsmen...but that doesn't change the fact the damage is already done. C is unsafe. Plain and simple. Even rock star craftsmen make big mistakes.

    118. Re:A poor craftsman blames his tools. by Sebastopol · · Score: 1

      "easy code"? What kind of made up term is that?

      The whole point of programming languages is literally to make programming easier.

      Speed and simplicity has ALWAYS been the goal. It's clear you're new at this, so let me educate you:

      The problem is near absolute lack of validation. Unit testing, directional testing, random template testing, none of this is taught in schools and over my 30 years I've been a contractor, I'd say close to 90% of software projects have zero validation or regression infrastructure, compared to 100% of the semiconductor projects I've worked on.

      There is less financial risk to shipping buggy code than there is to shipping buggy processors, which is why during my time at Intel, the validation teams were typically FIVE TIMES LARGER than the design and architecture teams combined.

      When is the last time you, or any other programmer, spent 5x the effort writing test vectors for your software? How many books are written on validating software, compared to "Programming for Dummies"?

      Back in the day, C linters were common in software projects, but slowly started to vanish because programmers became younger and more uneducated: academics don't emphasize validation like companies do, so the professors and grad students had no idea how to pass on these concepts of good programming. You can see this living on whenever you type "make check" after building a repo, it means someone cared enough to keep their code healthy, but this has been a dying art for the past 20 years. (I largely blame the rise of microsoft visual studio & borlad C in the 90's which pretty much ignored the Unix way, and then MS subsidizing college education, which led to the movement away from the Linux/GNU tools.)

      I applaud the Node.JS attempt at providing very easy to use unit test suites. Modern web languages have seen a rebirth in test-driven development, and many companies have really smart strategies for keeping their codebase healthy. The strategy of defining the specification first and THEN writing code to pass the tests, instead of writing code first and tests later, is what needs to be done from top to bottom. Not only that, the test database needs to be kept healthy with ticket tracking and revision control

      Programming is easy. Validating is hard. That's why so much code is broken: everyone wants to be the hero "hacker" (or architect) and no one wants to do the REAL work of validating and making code robust.

      --
      https://www.accountkiller.com/removal-requested
    119. Re: A poor craftsman blames his tools. by dgatwood · · Score: 1

      That's the pendulum swinging way too far the other direction. When you go down that path, the result tends to be Duke Nukem Forever. What you need are milestones and target deadlines to hit those milestones. And when you miss one, you need to reevaluate your future milestones as needed so that you can construct a more realistic schedule.

      You also need to make sure that the reason for missing the schedule was really that the deadline was unrealistic, rather than because you went off on some crazy tangent. And if you find your team going off on tangents frequently, you need to rein them in.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    120. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      Sure, when you're talking about DMA or interrupts or other things driven by the hardware itself, the software alone can't protect you from everything. However, there's still no reason we should be passing around void* parameters and using text-based macros as a crude tool to implement missing language features in 2016. How much low-level hardware access a language supports and how the language presents that functionality to the programmer are two different issues.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    121. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      This is another false dichotomy argument. Nowhere have I said anything about using some high-level language with some heavyweight runtime framework to implement things like OS kernels and device drivers. Obviously those aren't the right tools for that job. However, that doesn't mean we should stick with a language as weak and dangerous as C for systems programming work. There's a vast range of possibilities in programming language design, and there's a lot we could do to improve safety and expressive power over C while still compiling to efficient, self-hosted, native code and providing low-level access to hardware where it's needed, which are the two fundamental requirements for a language to be useful for systems programming.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    122. Re:A poor craftsman blames his tools. by HiThere · · Score: 2

      Java has a lot of decent features, but it also made some very bad decisions....sometimes because of premature optimization. E.g., character strings should be either utf-8 or utf-32. Utf-16 was a mistake. My guess is that utf-8 is the best general standard, but there are arguments in favor of utf-32. I know of no valid argument in favor of utf-16.

      Also the decision to not compile to native code limited the reasonable domain of use. For many purposes there's no problem with using the jvm, but for others it's a serious or critical problem.

      Then there's the decision to only support objects....except sometimes. That is a bad decision. Or the decision to not support structs (i.e., data structures with a defined memory allocation, byte size, and and byte level positioning). I believe that you can actually finagle things around to accomplish this in Java, but it sure isn't easy, and that has more than once caused me to rule it out for use.

      FWIW, my current languages are D (dmd) and Python. I keep looking at Vala, but the documentation is pitiful and it doesn't seem able to get out of pre-beta stability. Go and Rust have stylistic requirements that repulse me even more strongly than does Lisp, so I can't judge their quality. I keep thinking that I ought to seriously consider Ada, but the user community seems to continue to shrink. Eiffel had real promise a couple of decades ago, but it also seems to have turned in upon itself. And Vala shows signs of going the same way, without even first reaching a post-beta version. This is partially because it's tied into the gobject model, but it's hard to say what they should have done instead.

      Do I think flawed languages tend to cause flawed programs...yes. This doesn't mean I think their choices of non-flawed languages are valid. And each language also has, at best, only a limited range of problems correctly addressed in it. For some problems assembler is better than anything else, but for others that would be a ridiculous approach. Usually you can depend on libraries to extend range of tasks a language is useful for, but even then there are limits.

      So. I want a language that supports structs, that has built in hash tables, that makes memory management something I barely need to consider, and that can handle unicode well... Of the languages I know that means D. If I didn't need structs and wasn't really worried about efficiency I'd pick Python, because it's easier to use and has better library support. What alternatives are there? C++ fails immediately on several counts. C is worse. Java also fails, though it's nearly good enough if I don't need structs and am willing to compromise heavily on unicode handling. But Java also has hash tables that are clumsy and difficult to use compared to either D or Python.

      Now imagine I wanted to tackle this project in C. I need to implement custom hash tables with type dependent memory management functions. I need to write lots of unicode handling routines. I need to use a complex pseudo-object construction mechanism whenever I need to deal with indirect objects, including perhaps reference counted pointers, but I'd better make sure there aren't any referential loops. Etc. This at minimum quintuples the errors. And I probably wouldn't write the most efficient implementations. C++ is a bit better, as I can use STL hash tables, but unicode handling is still a real problem, and I haven't yet even discussed concurrency, messaging, etc.

      So for the range I problem I'm looking at C and C++ are unreasonable choices. Java has problems that cause continual vexation. (There's also something about memory size limitations, but I've never built something far enough to run into that problem.) Python has the GIL, which the multiprocessing module only partially addresses. When I was doing a toy application I actually used UDP networking to handle concurrency. So the language I chose was D. I avoid a tremendous number of problems by off-loading hash table, ..., concurrency onto the language. Avoiding those problems removes a tremendous number of errors that I would have created while trying to implement things I would need to research how to do.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    123. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      The problem is that almost no-one is working on potentially good alternatives. C is "good enough", as long as we're willing to tolerate the horrific bug rates and lack of productivity it comes with, and apparently most paying customers still are.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    124. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Sorry, I think I guessed about 2/3 of what the foreign poster probably meant to say. It was not very comprehensible.

    125. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 2

      Well, I do quite a bit of work in high-performance, high-reliability environments and I've shipped systems that have gone years in production without a single reported implementation bug, so I'll take my chances when it comes to software quality and what good tools can do.

      Those results are thanks in no small part to automated methods of catching design and implementation mistakes. I can encode invariants in types. I can write formal specifications and automatically generate large numbers of tests to validate code against them. I can use language features that let me write essential code but then automatically implement additional code to take care of necessary consequences. I can even implement a full DSL with a verified implementation, and have the structure of the DSL guarantee that inputs are valid in some sense.

      These don't have to be big deals. They can be as simple as catching a careless direct equality check on floating point values, or ensuring that a temporary buffer is always deallocated even in error paths. They can also be as complicated as automatically generating and running thousands of test cases to check that a DSL compiler that has been implemented and updated over many years still provides output that satisfies the required conditions.

      One way or another, most of these tools come down to cross-checking some specification that is relatively simple and easy for humans to verify against a code base that may be relatively large and complex. Computers are much better at that job than I am. It's not a substitute for careful design work or code reviews or any of the other good practices we might agree on. It's just using the computer's automation abilities so I can focus my human, creative skills where they are most valuable.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    126. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      What baggage, specifically?

      It is fundamental to C++ that its language tools have extremely low run-time overhead, often zero, compared to implementing the equivalent functionality manually.

      In some cases, the tools in C++ can even let you generate better code than an idiomatic C implementation. One common example is metaprogramming using templates, which effectively gives you a compile-time ability to inline and optimise specialisations. Another is error handling using exceptions, where implementing stack unwinding using an automatically generated jump table can eliminate the need to manually check for error conditions at each level in the success path.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    127. Re: A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      Sadly, this may be the biggest reason that we don't use better programming languages and tools routinely today. People have been trained to accept bug-ridden, insecure, short-lived software as if it's somehow inevitable. It's probably the greatest con in the history of technology, and we geeks are way too willing to accept it ourselves, as many comments in this discussion demonstrate.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    128. Re:A poor craftsman blames his tools. by ZenShadow · · Score: 1

      This isn't about native code vs. VM-based runtimes. The advantage of C at the low level is that "what you see is what you get". There are certain overheads (like function call setup), but those overheads are predictable and well understood. The language inserts nothing that is not inherent in what you asked it to do. This is vitally important when dealing with low level hardware.

      The vast majority of the "safety feature" implementations that I've seen in various languages necessarily add code that is executed at run-time. They might not have a run-time environment, or a library, but what you see is not what you get. Instead, it's up to the compiler to do what it will. You might write "a[3] = 42;", and get back two instructions -- one to check bounds, and one to actually perform the assignment -- instead of the one instruction you actually wanted. And then there will be code that handles the failure condition. That can wreck absolute havoc -- or it might completely and catastrophically disrupt what you're trying to do because it accesses something that shouldn't be accessed.

      In the embedded world, it's also not uncommon for developers to write a set of instructions in a certain order because they know the exact number of cycles in which those instructions will run, and that is critical to hardware timing. That's less true for OS design on a modern desktop or server processor, but it still matters. C is perfect for this, because it doesn't emit magic that messes with your assumptions.

      C maps very closely to assembly. There's a lot of embedded stuff out there that's written in assembly because even C isn't close enough to the hardware. Last time I looked (which was admittedly years ago), even Linux has assembly code in it, mostly in the boot process and the lowest levels of task handling and the system call interface. This is not because someone thought writing part of the kernel in assembly would be cool; in point of fact, they actively minimize it. It's because it's absolutely necessary when writing an operating system in order to meet various constraints posed by hardware.

      High-level languages (even C) simply can't accomplish these things. C is the happy medium allowing all but the very lowest levels to be written in a language that doesn't get classified as "write once, read never."

      --
      -- sigs cause cancer.
    129. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 2

      Exactly. Trying to treat software development as a true engineering discipline today would be crazy, for the simple reason that we don't know how to reliably do it right yet. There are too many competing theories. There is too little evidence of which are better or worse. A lot of the loudest voices in our industry are not the people producing the best results, because the people who produce the best results are often too busy getting on with it.

      Trying to license software developers as a profession too soon could result in the snake oil salesman consultblogspeakauthors writing the specs. Speaking as someone who does have to make highly reliable software, I find that idea horrifying. I would most certainly resent the implication that their unproven, ever-changing methods should constrain my ability to build solid, proven products for my clients.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    130. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      half a day to find a misspelled variable name? Blaming the language because it didn't find the error?

      Inexperienced programmers like yourself should avoid using php. You are giving PHP a bad name because you lack proper debugging skils. PHP doesn't treat you like a baby.

      PHP is not a language for the helmet wearing generation.

    131. Re:A poor craftsman blames his tools. by cheesybagel · · Score: 3, Informative

      C++? It's crap. How many memory allocation methods does it have now? Do you think it makes it easier to debug?

      Good luck debugging C++ code heavy with templates and its multi-line warnings/error messages.

      C++ is too complicated for little good reason. And complex languages are always harder to debug and more error prone.

    132. Re:A poor craftsman blames his tools. by dgatwood · · Score: 1

      And you have a crapload of incompetent people making design-decisions that goes against what the senior people advice.. just because "It was easier to get the feature done in this sprint" and with total disregard to what the final goal is....

      Lord knows I've occasionally had to do things the expedient way to get something to ship on time, but I've always tried to at least file a bug to remind me to fix it right eventually. The problem isn't that people cut corners to hit a deadline. The problem was that last word in your quote marks: sprint.

      IMO, the damage caused by Scrum is insidious. When you have short sprints, programmers mostly get to focus on fixing low-hanging fruit as quickly as they can. They can't focus on getting the architecture right, because if they do, they don't get to close that bug, and get in trouble for not being able to close out the sprint. As a result, that "fix me" bug never gets fixed because nobody is willing to touch any bug whose fix would take longer than a single sprint just to get back into a buildable state by the time they work their way through the ten layers of hacks.

      And the longer a piece of software goes without taking the time to get the architecture right, the worse the code gets. And one day, you look at it and realize that you have a steaming pile of crap that needs to be thrown out and rewritten. And you rewrite it, and everyone complains because the resulting software does a tenth of what the previous version did. And then they file bugs to add those features, and like before, the features get hacked into the app in ways that can be done quickly, mostly by new programmers who don't remember why the previous design failed. Rinse and repeat. All the while, nothing ever actually improves.

      That's not to say that regular milestones and regular releases aren't a good idea, but they have to be used sensibly. There's no reason for anything shorter than a monthly release cycle, and if you use branches correctly, there's no reason that features shouldn't be targeted for releases two, three, even six months out, depending on the complexity of the feature.

      More to the point, the entire notion of tracking progress using sprints is just silly, because progress on any complex task comes in spurts. It isn't a continuous process. Suddenly, something starts working that didn't work before, and you've made progress. Any system that tries to enforce some sort of stepwise improvement towards a goal is doomed from the very beginning, because it is fundamentally mismatched with how actual development works. Writing software isn't some assembly line where each step takes a fixed amount of time. It is an iterative process with lots of backtracking and rethinking when you recognize that some aspect of the architecture isn't going to work. And that just doesn't mesh with the notion of sprints at a fairly fundamental level, IMO.

      More significantly, the very foundation of Scrum—the notion that you cannot have the complete picture of what your customers want—is fundamentally antithetical to good software design. I'm not saying that you have to know every feature that will ever be added to a piece of software, but if you don't have a fairly complete picture of the endgame from the very beginning, you will invariably under-design the core of your technology in ways that make it not sufficiently extensible. And later, when you realize that the basic design falls short, Scrum then pretty much forces you to create a pile of small hacks on top of that to try to make the bad architecture "work well enough", because doing it right would take way longer than a two-week sprint.

      I've seen too many projects fail horribly because of Scrum. And before anyone says, "that's because they weren't doing it right," I would counter by saying that lawn darts aren't dangerous if you play with them correctly. They still got banned because too many people got hurt. If a software design methodology is so frequen

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    133. Re: A poor craftsman blames his tools. by dgatwood · · Score: 1

      A better test might be to provide the code and ask what's wrong or right about it.

      Yes, so long as you clearly point out up front that the code was written specifically to be wrong. Otherwise, you run the risk of the interviewee being afraid that either A. the piece of code is an accurate reflection of the sorts of nightmares that he/she will have to deal with if he/she goes to work for that company or B. the piece of code was written by the interviewer, who might get offended if he/she points out the serious flaws in it.

      But yes, if asked correctly, those sorts of questions are useful diagnostic tools.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    134. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Stopped reading when you said Python. White space should be insignificant. Curly braces FTW!

    135. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Hardware like that was already invented. See LISP Machines as the most popular example but there are others. Imagine being able to pause the execution of your computer and inspect and modify the code of anything running on your system, including the OS and drivers. Excellent from a CS perspective, horrible from a business perspective. Sadly it's also a security nightmare.

    136. Re:A poor craftsman blames his tools. by Tony+Isaac · · Score: 1

      It's not just the language, or the tools, it's the sheer complexity of what we try to do with software.

      You can make a solid steel box that's pretty secure. But when you want to build an entire airport, with lots of moving parts and the need for lots of people to legitimately go through it, security becomes almost impossible.

      Software is no different. The more complex the system, the less it can be effectively secured.

    137. Re:A poor craftsman blames his tools. by dgatwood · · Score: 1

      Buffer/stack overflows, type mismatches, null pointer errors and numerous other classes of programming bug that are ridiculously common in C code should all have died out years ago ...

      What you're missing here is the huge amount of technical debt that hurts C's reputation—some of it fairly, some unfairly.

      The overwhelming majority of buffer overflows are caused not by arrays, but rather by string handling. More specifically, they're caused by using legacy string functions like strcat, strcpy, and sprintf instead of modern alternatives like strlcat, strlcpy, and asprintf. Those modern replacements date back to the late 1990s. And there are ways of making C code trigger exceptions on integer overflow/underflow that can significantly reduce the likelihood of other types of buffer overflows.

      However, there's also a metric f**kton of code written in C that was written before those modern functions existed, and chances are if you write new software today, you're going to link against a lot of it. If you write new code in C today without using any existing libraries, your code will be much more secure than if you wrote that same code twenty years ago. However, C's reputation is tarnished in large part by the existence of so much preexisting bad code.

      The same is true for other languages. For an example, you need only consider how frequently PHP software is involved in SQL injection attacks. It isn't because PHP doesn't have APIs that make it easy to be immune to SQL injection, but rather because so much PHP code was written before those APIs existed. I'm sure if you picked literally any programming language out there, you could come up with some similar bit of technical debt that results in lots of bad code. The problem is that languages don't start out being perfect. They evolve over time as folks figure out their flaws. And until they do, you end up with lots of code written that depends on those flaws, making it hard to ever truly fix them.

      And as much as I hate to say this, the one thing that can combat that is regular breakage of backwards compatibility. When you realize that something is wrong with a language that is likely to cause serious security problems, break it quickly and completely. PHP should have killed the original mysql API back in PHP 5.0 completely, with no backwards compatibility. Lots of folks would have wailed and gnashed their teeth, but they would have reworked their code to use mysqli or PDO back in 2004, and countless exploits wouldn't have happened over the twelve years that it took before they finally killed it in PHP 7.

      Also, by killing backwards compatibility for security-flawed APIs, you ensure that nobody writes new code using them, and you pretty much guarantee that anyone coming to the language for the first time will learn to do things the right way instead of accidentally learning it the old way.

      BTW, I say this as somebody who finally got around to fixing bits of my own code that still used the old PHP mysql API earlier this year. PHP 7 was a forcing function. I knew I should have ripped out that code years ago, but the reality is that it is hard to justify fixing code that appears to be working. But as soon as I was forced to choose between the performance improvements promised by PHP 7 and that legacy code, suddenly it was worth updating the code.

      Similarly, the C library developers should have made strcpy/strcat/sprintf issue a warning immediately, and should have removed them entirely by about the turn of the century. Shortly thereafter, they should have done the same for strncpy and strncat. We'd all be better off had they done so, as it would have provided the forcing function needed to get people to rip out all that old code and replace it with something more robust. Instead, those fundamentally dangerous functions still exist and code using them still compiles to this day. And this is one big reason why we still have so much bad C code out there.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    138. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      All true, but security is not black and white, either in airports or in programming.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    139. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      Backward compatibility is a very important consideration in programming, but yes, it would have been better if compilers had started issuing warnings about the older, fundamentally broken standard library functions straight away and provided the option to treat such usage as a compile-time error.

      But that's one specific example, and hardly the only reason C is broken. Just look at the number of potential problems hiding in the way it handles numerical data: implicit conversions, silent truncation, exact comparisons of floating point values, etc. Look at the totally unnecessary potential problems in how pointers are used. Look at the number of holes in the type system, even in everyday things like using enumerations. Look at the limitations of the memory model in the presence of modern hardware interactions, concurrency, and so on.

      I do think modern programming languages would benefit from having a degree of modularity and upgradability in their standard libraries that few if any offer today, though certainly that is easier written than done. But the library is very far from the only problem with using C for robust programming.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    140. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      The advantage of C at the low level is that "what you see is what you get".

      The thing is, that hasn't really been true for a long time. C wasn't designed with modern computer architecture in mind, and it has its share of unfortunate limitations when it comes to things like concurrency, out-of-order execution and hardware behaviour changing state behind its back. Just look at the effort that has gone into trying to formalise things like memory fences in recent years, and then look at how much legacy C code was written without any of those issues in mind and yet still gets built into new systems today.

      But even if your claim were true, that doesn't mean we should have all the glaring weaknesses that come from implicit type conversions, nullable pointers by default, and all the rest that some of us have been mentioning throughout this Slashdot discussion. You could have a modern alternative to C that retained all the low-level hardware access, provided safer tools in many other respects, supported modern syntax and language features in many other respects, and still gave away absolutely nothing in terms of flexibility, transparency or run-time overheads.

      In the embedded world, it's also not uncommon for developers to write a set of instructions in a certain order because they know the exact number of cycles in which those instructions will run, and that is critical to hardware timing.

      I respectfully disagree. In my experience working on embedded projects, what you describe does happen sometimes, but it's unusual. More often, I've seen programmers who think they know exactly what code their C compiler will produce but in fact are working from assumptions that are sometimes decades out of date, who then get surprised if they look at the generated assembly.

      As you pointed out yourself, for some details even C doesn't have enough control and you drop to platform-specific assembly code for more guarantees. There's no reason another systems programming language couldn't do better on that front, and as long as it provides at least as much rigour as C in its execution model and the same ability to call assembly code when required, it wouldn't be any worse.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    141. Re: A poor craftsman blames his tools. by Nocturna81 · · Score: 1

      Out of interest, why not use C#?

    142. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      The problem is that it's kind of like if architects and the handyman who fixes your leaky faucet were lumped into the same category. It's easy to say everyone should by properly trained and educated, but the truth is that for at least half of all programming jobs out there, minimal training is fine. It would be nice if there were better defined categories of computer science and engineering with varying levels of training, but I'm not sure how we could get there or even where the lines would be drawn.

    143. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      To take this further, since I can't edit, most programmers should be minimally trained, just like most of the people working on a large construction job have minimal or specialized training. The stuff that requires certification is done by the architects and engineers, then they pass that off to others, some of whom specialize in a particular area (electricians, plumbers, welders, vehicle operators, etc) and a large amount of people whose qualifications are essentially "can lift heavy objects and follow directions".

      That can translate quite well to software. The architect and other experts lay things out, and then the minimally trained workers create little components that can't screw anything up (at least without gross negligence or intent) and can be tested.

    144. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      I know of no valid argument in favor of utf-16.

      When Java was released utf-16 was enough for everyone. Of course using a fixed width encoding for unicode has always been pointless since a character can have an unlimited amount of modifiers, giving way to things like the zaglo text generator ( for all your lovecraftian needs ).

      Also the decision to not compile to native code limited the reasonable domain of use.

      There have been ahead of time compilers for Java for ages. Before OpenJDK most Linux distributions even used gcj as it was the only FREE (TM) implementation. Also I think some hardware even had processors specialized for Java.

      I keep looking at Vala, but the documentation is pitiful and it doesn't seem able to get out of pre-beta stability.

      Vala is a GNOME project, isn't it? Those are the people that managed to drive Linus Subsurface project to Qt. Don't expect anything resembling quality from that direction.

    145. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      > The whole point of programming languages is literally to make programming easier.

      In that case, they have been a phenomenally spectacular failure. All we see now is ever more abstraction, 'clever' features and new traps and pitfalls that lead to a pile of convoluted shit instead of clear, straightforward, powerful programs.

      I downloaded Android Studio to take a stab at mobile development and JESUS fuck, does it really have to be that complicated? Creating an "activity" object and registering it to receive system events just to display "hello world" from a string stored in an XML file?

      It's like a nightmare chain of design decisions resulting from a compulsion to re-invent EVERY wheel!

    146. Re:A poor craftsman blames his tools. by pauljlucas · · Score: 1

      Fortran (the 1977 standard, not earlier versions) was/is a decent language.

      That pretty much invalidates whatever point the rest of your post may have had.

      --
      If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.
    147. Re: A poor craftsman blames his tools. by Jesus+H+Rolle · · Score: 1

      There are not many platforms where de-referencing a null pointer can lead to anything good. Dereferencing a null pointer on a C64 gives you the DMA I/O direction for each range of addresses. Any other examples?

    148. Re:A poor craftsman blames his tools. by jcr · · Score: 2

      The reason that C++ is crap is that Bjarne always thought of it as a research project, which means that it wasn't designed, it was accreted.

      -jcr

      --
      The only title of honor that a tyrant can grant is "Enemy of the State."
    149. Re:A poor craftsman blames his tools. by Xest · · Score: 1

      "A wise person can correctly recreate what they have already done in the past, talented person can correctly create something entirely new."

      This, for what it's worth, describes the difference between developers that know mathematics, and those that don't. It's true that you can program without an understanding of mathematics, but the truly new, the truly revolutionary development is done by those who know mathematics.

      At the end of the day, pretty much all breakthroughs in computing and algorithms are performed by those who also have knowledge of mathematics.

      That's why when people ask if you really need maths to be a programmer, I ask them first to decide if their goal in the industry is to be a sheep or a shepherd.

    150. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      You can say what you want. But if you think C's syntax is cryptic you don't know what you're talking about. All points about the lack of checking stand, but that one is bullshit. The main selling point of C (and the reason why it is still used so much) is that it's syntax is extremely simple and consistent while still being very flexible.

      http://www.programiz.com/c-programming/list-all-keywords-c-language

    151. Re:A poor craftsman blames his tools. by Flammon · · Score: 1

      A great craftsman makes his own tools.

    152. Re:A poor craftsman blames his tools. by allo · · Score: 1

      The good craftsman looks at the tools and weights the efford and the lowered quality aginst his skills any may refuse to use the tools. Only a fool will use tool, which are way too bad. Or some artist, which chooses a totally incorrect tool to do his work as part of the performance. But a craftsman knows what to use and what's not good but still usable for the job and what tools he will refuse.

    153. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Of course none of this post makes sense.

      - Debugging is not done on compiler messages, and not simplified by any any language fullstop. Every language will shit on you if you abuse it enough.
      - C++ has a single memory allocation over C, its called "new". If you are using C++11 onward, you will probably never use even that if you are up to date.

      Complexity is indeed a bugbear of software, but its rarely to do with the language of choice. Consider your average Java programmer who has no real "memory" issues to deal with (not a Java criticism, just an easy example). With every non-local function call, do they:
      - Catch and handle index out of bounds exceptions?
      - Catch and handle general runtime errors?
      - Miraculously recover from JVM errors?

      The answer of course is no. And none of the prescribed "safe" languages help, since they are not supported by very specific hardware handling methods.

      The original article completely ignores the universal fact that all languages are equal. Run off the end of an array or don't catch an exception, either way the mission critical system lets out the smoke. Its a mode of failure issue at best, and there is no panacea from people not understanding why something might not work.

    154. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      PHP doesn't treat you at all. It's no partner you're working it, it's a stone, which refuses to move unless you use a lot of force.

    155. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      This is utterly correct. Whats more it scales up to everything above it. Language is irrelevant - at some stage you will fail to handle an exception, fail a read, or step into an infinite loop because the logic you coded is limited. That is all.

      There might be a way eventually to formally prove non trivial code. Until then, you have to consider where things might arbitrarily not work and write sensible code that can either recover from unexpected failures or at least try not to set things on fire. Cons in lisp until you are out of memory, write off the end of an array, exhaust the virtual machines memory. All the same thing.

    156. Re:A poor craftsman blames his tools. by keneng · · Score: 1

      I agree and would like to re-enforce this with a concrete example that recently occurred. I completed a first phase of an appliance using golang and it has been straightforward to design and implement. The second phase however needs a more enlightened view of the design from which I can quickly iterate behaviour and structure changes. I prefer UML collaboration/communication diagrams for such refactoring considering the grown file count and lines of code involved.
      My brain can only remember so much in one shot so these CASE tools become essential after a while for me. I have failed to find a decent UML modeler tool for golang. There are no golang round-trip engineering UML CASE tools out there. Plantuml was very close, but lacked golang support and does not have collaboration/communication diagram capability. In tools like Rational and Visual Paradigm you can flip the view from sequential diagram to communication diagram, but layout tweaking is always necessary to better reflect the designer's vision of the behaviour/structure of a system/subsystem.

      A lack of good tools slows our ability to improve systems. Time is precious. Golang is a great language, but some of its surrounding toolset to accelerate everybody's ability to maintain and build larger more complex systems are lacking and in this particular case golang lacks UML support. You can still achieve a great deal, but when communicating larger more complex systems to a team greater than one person, you need tools to communicate your proposed maintenance/requirements/use case changes effectively and UML for golang would be exactly that. I'm sure prodigies will state that "if you're missing the tool, just create it yourself". If a tool can be created within a reasonable time-frame by myself, I would. UML/CASE tools aren't something I can build over a week or weekend.

      For those discussing php, even php doesn't have UML/CASE tools that provide round-trip engineering for it which constrains it to be used for smaller systems.
      C++ and Java both have strong UML/CASE round-trip engineering support, but aren't as enjoyable to work with on smaller projects in my humble opinion. Smaller projects usually grow to involve more that one person and that's where UML/CASE tools shine.

      Going back to the original question are the flawed languages creating bad software? The languages themselves might not be entirely flawed, but as we are human and are certainly flawed, we need support to prevent/warn us we are mistaken as early as possible before our handicrafts reach production.
      UML/CASE helps us to clarify or perception of the behaviour/structure to others within a team. If there is no team or UML/CASE or decent tools surrounding the programming language, there is a higher probability things will get out of hand because of the inability to transfer the knowledge of the system away from the original creator of the system.

    157. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      This will only result in programs that donot crash. Will you trust it to keep your data safe? The calculations it does? That some obscure bug won't accidently mangle or erase all your data?

    158. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      Apparently I'm not the only one who feels that way, because there are even entire sites dedicated to helping people figure out C syntax for types and casts now.

      I've long since lost track of how many people I've taught to program over the years and in how many different languages, but C's syntax in that area has always been one of the things new programmers have found most awkward, in my experience.

      Operators with mutation as a side-effect (++, >>= and friends) and implicit conversions to boolean values are also recurring sources of confusion, particularly when used as part of a condition. Just think how many special cases and weird rules a beginner needs to know before they can understand something like the classic C strcpy implementation:

      while (*dst++ = *src++) ;

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    159. Re:A poor craftsman blames his tools. by plopez · · Score: 2

      There we go, blame the victim

      --
      putting the 'B' in LGBTQ+
    160. Re: A poor craftsman blames his tools. by Grishnakh · · Score: 1

      Give me a crappy handsaw and nothing else and expect me to do perfectly mitered crown molding in no time at all? You get shit.

      That's not a good example. Here's a better one:

      I want you to build a nice solid-wood cabinet in an ornate 18th-century style (Queen Anne?), with inlays.

      I'm going to give you one tool to make it with: a hammer.

      A poor craftsman blames his tools, right?

      Honestly, I really hate that expression. It's beyond stupid. You need proper tools to do a job correctly; without those tools, it becomes basically impossible, and the best you can do is maybe jury-rig it.

    161. Re: A poor craftsman blames his tools. by Grishnakh · · Score: 1

      The whole purpose of having managers is to let the programmers do what they do best: program. If you want the programmers to all learn about business and how to "speak the language of business", when what the fuck do you need managers for? You sound like a shitty manager who's blaming the programmers for not doing his job for him.

    162. Re:A poor craftsman blames his tools. by Comrade+Ogilvy · · Score: 1

      Quite frequently the team in place doesn't have a lot of incentive to have that will -- if the software is ever actually good, it would threaten those fat paychecks they collect for maintaining the mess.

      IMHO you are ending a pretty insightful post on an unnecessarily cynical and misleading note.

      Messes do not get fixed for reasons. Lazy programmers are not the primary reason. The biggest reason is fixing the mess is expensive in man-hours with approximately zero returns in new features over the short term. An engineer so brave as to take on that task without very strong backing from the CEO better keep his resume handy, because he will get hammered for the smallest slip up that "breaks stuff that was working, when there already are so many other bugs to fix".

      It is the company leadership who must decide that they are willing to give up the slow and painful progress they can squeeze out of the entire next year or so of the engineering department's effort, in the hope that the company will be much better off, in terms of being able to be reasonably responsive to customer requests for bug fixes and new features, 3 or 4 years down the road. CEOs who are under pressure to show growth see such efforts as very risky, and may even be correct about being cautious when viewing the fate of the company as a whole.

      The reason the engineers may act "lazy" is there sense correctly that a small effort will fail, and a big effort will be sabotaged without executive team support. They may think about such things explicitly, but they know that refactoring projects have a way of getting the necessarily resources stripped away from them a few months down the road, before they produce much in the way of useful improvements. Why bother?

    163. Re: A poor craftsman blames his tools. by david_thornley · · Score: 1

      It's a poor workman who blames his tools. It's a poor manager who blames his workers.

      Look, guys, they pay me for my talents in software development. Any people skills beyond being mostly inoffensive are gravy. Managers are paid to work with people. They need the people skills to do their job, and many consistently blame the techies for not having those skills. If you want to compare a manager to a child, you're claiming that the manager really doesn't know what managers are paid for knowing.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    164. Re:A poor craftsman blames his tools. by david_thornley · · Score: 1

      Frequently, software people are given unclear specs, inadequate access to people who can clarify them, deadlines imposed for external reasons, and told what tools to use. Accountants, doctors, and lawyers typically have more say in what they do: accountants because they know what to do, doctors and lawyers because of education and prestige.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    165. Re:A poor craftsman blames his tools. by david_thornley · · Score: 1

      The serious C++ quirks were inherited from C. The biggest problem with C++ is one of the things that made it successful: being almost a superset of C. It takes time to learn how to use C++ properly, but when used properly it's very powerful.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    166. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      If you want the programmers to all learn about business and how to "speak the language of business", when what the fuck do you need managers for?

      To coordinate the activity of many programmers, and eliminate road blocks. That is what managers should be doing for their programmers.

      Enjoy your frustrated, powerless station in life, friend. If you don't learn how to communicate with the people who you work for, then you will never make any progress in making your work life better. Learn to speak the language of the people you interact with, or be forever at their mercy. Those are your two options, there is no magical land where businesses line up to shower developers with money and blowjobs simply because they can write a few lines of C code.

      If you are employed to write software, then your work is being driven and directed by BUSINESS needs. What the business needs is programmers who know how to create valuable software for the business - in other words, software that makes a reasonable return on the investment required to create it. If you are not helping the business people to accomplish this goal, then you are defaulting on your professional obligation as an engineer.

      Oh wait, you probably don't like to consider software an "engineering" discipline, because you're an artist and can't be constrained, right? Well, enjoy your eventual unemployment, you prima donna.

    167. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      It's a poor workman who blames his tools. It's a poor manager who blames his workers.

      And if the workman wants to remain at the mercy of the decisions of his manager, he should continue to be focused on never looking around at the business context his software must exist in, and making no attempt to understand what the company he works for finds valuable and worthwhile.

      Look, guys, they pay me for my talents in software development.

      No, they pay you for your talents at solving problems. And those problems exist in a business context. If you are - and seek to remain - unaware of that context, then you will not remain an employed person for long.

    168. Re:A poor craftsman blames his tools. by Grishnakh · · Score: 1

      Wrong.

      You obvious are an older person, as proven by your low 6-digit UID. You're probably in your mid-40s or so.

      Your error is you're assuming "senior" people are your age or older. What you're missing is that these days, a "senior" engineer/developer/whatever in tech is generally someone with maybe 10 years experience, if that. That means someone in their early 30s, and frequently in their late 20s, which is prime "hipster" range.

      There's a lot of title inflation these days: people get to "senior" status pretty quickly, and then they either stay there for the rest of their career (until age discrimination knocks them out of the industry altogether) or until they turn to the dark side and become a manager. A few will become "principal engineers", but not many companies use that title. And one I worked with at a prior job sounded a lot like the OP's complaint about incompetent senior engineers.

    169. Re:A poor craftsman blames his tools. by SuperDre · · Score: 1

      But what are poor tools? C is certainly NOT a poor tool, it's much better than GO or Java....

    170. Re:A poor craftsman blames his tools. by david_thornley · · Score: 1

      Fortran 77 was a considerable improvement on earlier FORTRAN versions, and a reasonable language for Fortrany projects. Saying that it was a decent language for the sorts of things Pascal and C were usually used for, well, that's quite a stretch. Its control structures were deficient (can't remember the details, since I haven't used in in 25 years), and I don't remember it as being particularly good at string handling.

      I'm not specifically familiar with Algol 68, but have some knowledge of Algol 60. There were some brilliant ideas in Algol, but there were a lot of serious duds in Algol 60, such as the 'for' statement and call-by-name, not to mention the language really needed keywords and I/O. Most languages in general use nowadays can be considered Algol descendants, and they've all dropped the really bad ideas.

      PL/I was a mashup of COBOL, FORTRAN, and Algol. The Algol pieces were reasonably good, but the combination of COBOL and FORTRAN numbers and arithmetic was frightening. You really do need to know whether you're dealing with a 16-bit twos-complement binary integer, or with a decimal number with fixed numbers of digits.

      Pascal had a good many problems, largely traceable from being designed as a language for a Control Data supercomputer that could be easily parsed in one pass by recursive descent, and its own little quirks like the lack of compile-time initialization, strings that were always too limited, and something like static variables.

      BASIC was something of a cut-down FORTRAN with its own quirks. Its only virtue was being relatively easy to learn.

      This largely explains why C was such a success. It had Algol-like control structures, like Pascal and PL/I, but was much better suited for real-world programming on computers other than IBM mainframes. There were plenty of other obscure languages that could have hit it big, but C made it, and was in general no worse than its competitors.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    171. Re:A poor craftsman blames his tools. by sjames · · Score: 1

      Sometimes, void is the right answer though. Even if you don't call it void, it tends to exist. In some languages, it might be a pointer to class Object, for example. It would be the type returned by new and accepted by del.

      Not abusing it will be down to the programmer.

    172. Re:A poor craftsman blames his tools. by david_thornley · · Score: 1

      C++ uses malloc/calloc/free for C compatibility only. It uses new/delete as low-level mechanisms, and has enough safe templated abstractions on top of that for people to actually use.

      The trick to using templates in C++ is to remember that they're hard, because they make it syntactically easy to do difficult things, much like Common Lisp macros. The ordinary C++ programmer should almost always use somebody else's templates, and not try his or her own.

      C++ templates are extremely powerful, and make it possible to transform the language in various ways. They allow a lot of compile-time processing which helps runtime. They make it easy to reuse efficient algorithms without needing shims to bolt on the algorithms. Consider C's qsort. It requires an explicit description of the memory layout, and a function that has to be declared somewhere else. C++'s std::sort can just be used on appropriate data structures, and the comparison function can be a standard operator<() or a lambda function at the site.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    173. Re:A poor craftsman blames his tools. by david_thornley · · Score: 1

      Actually, C++ has, in the language standard, ways to eliminate whole classes of C bugs. I'm not familiar enough with Ada or Rust to compare safety features, but I doubt anyone who refers to "C and C++" in the context of language safety knows enough C++ to compare.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    174. Re:A poor craftsman blames his tools. by david_thornley · · Score: 1

      Requirements for projects of reasonable size will be captured wrongly. I'm not saying it's going to happen absolutely all the time, but it's a good attitude to have. Most users can't express what they need in sufficient formality, and can't project what the consequences are with any accuracy. Expecting accurate requirements analysis going into design is like expecting a computer language that does what you mean.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    175. Re:A poor craftsman blames his tools. by Greyfox · · Score: 1
      Refactoring can be a continuous process -- you don't have to stop and tear down your entire project. I've seen companies do refactoring sprints where no new features were worked on, and they never seemed to be particularly successful. It always seems to work better when you're making small changes to a few classes or functions to support a specific feature or to fix a reported bug. Refactoring does require a decent understanding of the system you're working on, and on high-turnover projects most programmers haven't worked on the system long enough to do it effectively. The underlying problems are complex and don't really fit well into a paragraph, or even a few paragraphs.

      It always boils down to understanding the system and having the will to fix it, though. I've worked for companies that were crippled by their bad software. In those companies, no one could explain how the entire system worked, end-to-end. The problems were always "Somebody else's problem" because each team would point their finger at some other component that they didn't know anything about, and that component owner would come back and say "That's not OUR problem!" Meanwhile the companies would not be able to effectively grow or take on new customers because the entire product generation process was so cumbersome and slow.

      --

      I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

    176. Re:A poor craftsman blames his tools. by RandomSurfer314 · · Score: 1

      Your passive-aggressive comment kind of confirms my point, I'm afraid. Don't take this personally, but it's maybe not the greatest display of professionality to doubt other people's expertise while admitting yourself that you don't know what you're talking about. Couldn't you at least have looked up some of the safety features of Rust or Ada? Also, these languages are just examples. I could have made the same point with ANSI Forth vs. Algol 68.

    177. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      A good craftsman also uses the right tool for the right job, and doesn't expect one tool to do everything well.

      Unix philosophy #1 'Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new "features".' - https://en.wikipedia.org/wiki/Unix_philosophy

    178. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      (same AC here)

      Oh, and iOS is no better - have you seen the rat's nest maze of settings in Xcode? Unbelievable!!

      It's like you set up a makefile with EVERY gcc/clang option specified on the compile line.

      Simpler? Easier? Hah! AFAIC, IDE's are good for one thing only - code completion.

    179. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      I'm not sure a void* or its equivalent is ever really a good answer to anything. By definition, the only thing it will ever be useful for is casting to something more specific that you can then do something interesting with, even if it's just a buffer of raw bytes. Like allowing all pointers to be nullable by default, I have yet to encounter any case that a safer language and type system couldn't cope with just as well in principle, avoiding the inherent vulnerability of the C model.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    180. Re:A poor craftsman blames his tools. by Grishnakh · · Score: 1

      What you *can* do with languages like PHP, where they've grown organically, is limit yourself to a subset of their features (namely, the newer ones, where developers have tried to fix up the language and make up for its past mistakes), and write everything as cleanly as possible in this newer "dialect". PHP, for instance, bolted on object-oriented capability later on, and using that can make your code a lot cleaner. The other thing you can do is use the newest version of the language, as that may have deprecated some of the older crap that was especially bad. One important thing about languages like Python and PHP is that they don't hold backwards-compatibility to be sacrosanct, so newer versions can and do make changes that break older programs, so stick with the newest language versions to avoid this as much as possible, and stay away from language features that are now or likely to be deprecated. Another thing you can do is enable any optional "strict" modes and code to those.

    181. Re:A poor craftsman blames his tools. by sjames · · Score: 1

      So, what type of pointer does del accept? How about new (and don't say whatever it creates unless you can explain how to implement that without cheating).

    182. Re: A poor craftsman blames his tools. by Grishnakh · · Score: 1

      Yep, you're definitely a shitty manager. Have fun in your shitty company when it goes belly-up, you fucking moron.

    183. Re:A poor craftsman blames his tools. by cwsumner · · Score: 1

      In other words:
      "If Engineers built buildings the way Programmers write programs, the first woodpecker that came along would destroy civilization!"

    184. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Agreed C++ has grown too big for its britches.

    185. Re:A poor craftsman blames his tools. by Grishnakh · · Score: 1

      There is less financial risk to shipping buggy code than there is to shipping buggy processors, which is why during my time at Intel, the validation teams were typically FIVE TIMES LARGER than the design and architecture teams combined.

      I was at Intel too. But what they told me was that it wasn't always that way: Intel didn't invest that heavily into validation until the infamous Pentium FDIV bug (I came in years after this).

      and then MS subsidizing college education, which led to the movement away from the Linux/GNU tools.)

      From what I could tell (I was in EE, not CS), colleges didn't jump on the Linux bandwagon until later; for a long time it was just certain students who were big adopters. In the early 90s, it seemed that colleges were big users of Unix (usually Sun) and its associated proprietary tools, not GNU.

    186. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      One important thing about languages like Python and PHP is that they don't hold backwards-compatibility to be sacrosanct, so newer versions can and do make changes that break older programs

      For whatever improvements Python 3 made, it's generally regarded as a HUGE mistake for it to break compatibility with Python 2.

      They could have given Py3 a compatibility mode, allowing developers to declare the version with a single line of code at the top. Instead, they expected everyone to rewrite their Py2 code in Py3.

      For reasons of practicality, no one does this-- they find it easier to maintain TWO Python installations. How's that for stupid?

    187. Re:A poor craftsman blames his tools. by tepples · · Score: 1

      PHP doesn't require you to declare variables.

      Neither does Python. But both languages will warn you when you try to read a variable that you haven't already written. Python raises an exception, and PHP raises a warning, which (under best practices) gets converted into an exception.

      If you're hired to help fix someone's website and it's written in PHP, you gotta write your fix in PHP.

      That or transpile the entire project into a different language.

      You might be tempted to code the fix in a better language and have the PHP script call it, but that destroys the maintainability of the code for future programmers.

      Not if "future programmers" understand the language into which you have transpiled the project. It might even be cheaper to hire "future programmers" who understand the language into which you have transpiled the project than to clean up after programmers who fail to avoid PHP gotchas.

    188. Re:A poor craftsman blames his tools. by Grishnakh · · Score: 1

      First, I'll state that I'm not an expert at Python by any means, and only started using it in the last few months when a project was dumped in my lap. It's all Py3. So I have zero experience with Py2, and haven't researched what actually changed, and how hard it is to migrate a Py2 codebase to Py3.

      But the standard argument, I think (and this was brought up somewhere else in this discussion by someone talking about PHP) is that if you allow backwards compatibility like that, then people won't bother migrating at all because it takes work, and breaking compatibility forces them to migrate and adopt the new language and its features and abandon the old cruft. The other issue is likely that (a Py3 language maintainer would probably be able to talk more authoritatively here) it's far too much work for the language maintainers to try to shoehorn all that in, and that keeping the old features while also allowing access the new stuff without it breaking something is asking too much from the language maintainers. Of course, you could just make it an either-or thing, but in that case you might as well just maintain a separate Py2 installation and not burden Py3-only users with all that extra stuff.

      Yes, unfortunately this frequently results in users maintaining old Py2 installations, but hopefully they'll eventually migrate. If they don't, that's their problem; you can't please everyone all the time, and you can't maintain perfect backwards compatibility. Just look at Windows for instance: Win10 has allegedly broken a lot of things, and for a long time now, as I understand it, running really old Windows code in Windows actually makes it run under WOW (Windows On Windows), basically a VM, so they're hauling around a bunch of baggage just so some curmudgeons don't have to bother fixing their code and recompiling (or because they stupidly bought some old proprietary closed-source software and refuse to switch to something newer and better and insist on the sources).

      Personally, I'd just push to make everything use the newest version and abandon the old one if I were in charge, and where I do have power, that's exactly what I do.

    189. Re:A poor craftsman blames his tools. by xiux · · Score: 1

      terrible solution not even salvagable

      I think the idea is that the original code is more of a proof of concept; it only needs to identify a need and how feasible is it to meet that need. It doesn't have to be salvageable to do that. If the terrible code increases productivity by a significant margin, there may be a business case for hiring experts to re-implement or salvage at their discretion.

      The real problem here is management being oblivious to critical dependencies. It's management's negligence that's allowing their department to become more and more dependent on something that wasn't designed from the ground up to be maintainable.

      when they finally do hire a qualified expert to help, they restrict the expert to fixing the unfixable

      That's also covered under "failure of management." If there wasn't an existing proof of concept, written terribly, would this same management even allow the expert to "create a good, appropriate solution to the original problem," or would they tie the expert's hands and force them down a poor design path? I believe so.

      The solution to bad management isn't more qualified experts, it's better management. Good management not only knows when to bring in the experts, but to also heed their advice and guidance, because they know to do otherwise would be a waste of resources.

    190. Re: A poor craftsman blames his tools. by HiThere · · Score: 1

      I've never bothered to learn C# as when I was interesting in it several years ago the Linux versions were terrible. I believe, however, that it uses utf-16 strings. I'm not sure whether it can properly decide whether or not a character (utf-32 character) is punctuation. Java can't. (I wrote a custom routine to do that back when I was experimenting on using Java.)

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    191. Re:A poor craftsman blames his tools. by HiThere · · Score: 1

      As I said, premature optimization. That shouldn't have been baked into the language specs. Neither should the precision of an int. (Well, there would be nothing wrong with having int8, int16, int32,...there's value in that, but which one corresponds to an int should not be a part of the language spec. And in java because everything the user builds is an object you can specify Integer64, but if you want an int64 you say long, and there is not way to get int128.)

      gcj existed, but I was never told that it was a good implementation. When I looked into using I quickly became discouraged. There were some compilers that compiled jdk1.1 code to native code, but I never encountered one that even almost kept up with the standard. They may exist, but I've never encountered them.

      Yeah, I'm afraid that Vala is a dead end. That's a pity because I liked the basic design.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    192. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      it's far too much work for the language maintainers to try to shoehorn all that in, and that keeping the old features while also allowing access the new stuff without it breaking something is asking too much from the language maintainers.

      Asking too much? Excuse me but it wasn't the users' idea to fuck over their existing code base.

      It's the maintainers who pulled the rug out from under the users, and IMHO it's not their responsibility or prerogative to "make" users upgrade.

    193. Re:A poor craftsman blames his tools. by Grishnakh · · Score: 1

      If you don't like it, you can either stick with the older version, or you can switch to another language. The language maintainers are under zero obligation to make you happy.

    194. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      Why can't a language's new and delete operations or the equivalent be polymorphic, and then do exactly as you say, returning a pointer to whatever type has been created? What "cheating" do you think is required for a type system to support this?

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    195. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Who are they doing it for, then? Their own intellectual self-pleasure?

      Users are the whole world when you're a language designer.

    196. Re:A poor craftsman blames his tools. by Grishnakh · · Score: 1

      They're doing it because they want to make the language better, and they're the experts, so they probably know best how to do that. If you were an expert on language design, you'd be making your own language, but you're not, so you're just an armchair quarterback.

      It doesn't look to me like they're having any trouble keeping their userbase.

    197. Re:A poor craftsman blames his tools. by Tony+Isaac · · Score: 1

      I completely agree!

    198. Re:A poor craftsman blames his tools. by Sebastopol · · Score: 1

      Yeah teams were WAY smaller prior to P6 (I didn't work on P5).

      The design and validation teams were WAY smaller prior to Pentium. In 1992 I was a blue-badge employee and worked on the 486DX2. The design -and- validation team was about 20 people (granted it was mostly a frequency tweak so we didn't need many new tests), and validation was largely accomplished with random template generators (DART, with some directed tests that were written to match the arch specification) that worked on both AIX and SunOS. I had a SunOS box at my apartment so that I could check simulation coverage 24/7.

      The 486 pipeline was very simple, and so was the bus interface. Once things went out-of-order on P6 it all just blew up like crazy. There were so many state machines... so.. many... i'm getting shivers...

      Did you do validation? I think spending time in validation is some serious "earning your stripes" stuff compared to other groups I worked in.

      When I popped in a few years ago, the tools were _way_ more advanced. They added distributed computing (netbatch) and used some pretty sophisticated formal verification software from Cadence. ....

      Re: schools...

      There was a weird split at my school, where CompSci 101 was taught with Pascal and Fortran on AIX boxes, and then Intro to C was taught in the IBM PS/2 lab and I remember Borland (not MSoft, my mistake) was the sponsored compiler and was sold at a heavy discount to students for years. Linux didn't show up until 4 years after I graduated, and from what I was told C/C++ remained on Windows until almost 2000. O_o

      Thanks for giving me the chance to spew a bunch of `memberberry nostalgia... :)

      --
      https://www.accountkiller.com/removal-requested
    199. Re:A poor craftsman blames his tools. by sjames · · Score: 1

      They can be polymorphic. But if they are promiscuously so, it's just a void* by another name.

      If you make them (and perhaps a few more built-in functions) special snowflakes allowed to do that while nothing else is in order to not have a void* equivalent, you are cheating. For one, it can't be self hosting since you can't declare anything with the void* type.

    200. Re:A poor craftsman blames his tools. by dgatwood · · Score: 1

      But that's one specific example, and hardly the only reason C is broken. Just look at the number of potential problems hiding in the way it handles numerical data: implicit conversions, silent truncation, exact comparisons of floating point values, etc.

      Much of the above abuse would get flagged by -Wconversion. Trying to compare floating-point numbers to a constant certainly won't work reliably, but it also isn't likely to cause problems in real-world code, because the code would have to have actually worked at least once.... :-)

      Look at the totally unnecessary potential problems in how pointers are used.

      Good luck writing device driver code without them, though. And there are lots of other things that are much easier to write and faster when written in C (e.g. ring buffers) because pointers are so thoroughly exposed. Would we be better off if C had zeroing weak references? Probably. Would they be the right solution for every situation? Definitely not. Can you implement some close approximation of ZWR on top of C if you need them? Yeah, pretty easily. It's just a doubly-reference-counted handle (double pointer).

      Look at the number of holes in the type system, even in everyday things like using enumerations.

      True, but also true of most other languages in different ways. Most modern languages either aren't much more strongly typed than C. And many have almost no static type checking, but are strongly typed at runtime, greatly increasing the risk of nasty surprises when compared with C. All in all, it isn't perfect, but it isn't *that* bad. :-)

      Look at the limitations of the memory model in the presence of modern hardware interactions, concurrency, and so on.

      On the other hand, the more complex memory models don't come for free. They all involve additional overhead. The exact amount depends on the technology, of course. And they all seem to "just work" until the moment that they don't, at which point debugging can become nightmarish. Compared with that, the explicit malloc and free actually seems pretty sane. It forces people to define a concept of ownership that makes sense in their code base, and to know when it is appropriate to throw away memory, and to clean up after themselves explicitly. And when that cleanup is done, you know that the data in question absolutely isn't using memory unexpectedly.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    201. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Uhm, I thought the point of that saying was that a carpenter can make their own wood-working tools? :-D

    202. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      As with the legal profession among others, there would be a perverse incentive to make highly unreadable code, precisely so you can sell the debugging services. Even better if you make it a mandatory standard to use languages that obfuscate bugs, or have poor objective/procedural/structured/low-level(when needed)/high-level(abstraction for efficiency and ease of debugging)/etc. paradigm implementations. C++ OOP nightmares come to mind. If you're worrying over syntax of object definitions, you're missing the GD point of using that idea!

    203. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Exhibit A: Brainf*ck language
      Designed specifically to be horrible. This is the great counterexample for this article if someone claims good languages don't make for better-designed and more maintainable code. BF has the converse situation of likely having nearly the worst code examples in existence! :P

      Exhibit B: C language
      A language meant to be portable to any CPU, with a fraction of the effort of previous languages at the time. You just have to implement the targetting portion of the compiler, instead of the entire thing. It turns out that a translating strategy provides a much easier-to-port compiler. BASICs often had something like this if you tokenized them. The token-to-machine code translator could be much smaller than the rest of the language, though not to the extremes (1/3rd?) that C is. Bonus points to using the bridge code to compile the parser itself using tokenized code. ;) Another name for this is bytecode such as some VMs(say, Java) use, or that gets converted to native code on Android.

    204. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Here we see a fine example of the elitist Progressives who are pushing so hard to proletarianize our profession.

      Well if these silver spoon buggery fiends want proletarian developers instead of professionals, let's give them what they think they want. Software workers of the world unite! There's power in a union.

      The sooner we start acting in solidarity, the sooner we can regain the dignity these crony capitalist parasites have robbed from us.

    205. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Were you paying them to do the monkey test? Maybe I've just been a consultant for too long - but I don't program for free. Not interested, sorry, next please.

    206. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      They can be polymorphic. But if they are promiscuously so, it's just a void* by another name.

      I'm not sure what you mean by promiscuous here. I'm just saying there's no problem, from a type theoretic point of view, with having allocation and release be type-specific so everything in between has a well-specified type that says what it actually is and requires explicit conversion to become anything else. There is no need to introduce a void* or its equivalent anywhere in this model.

      I don't see your problem with self-hosting either. Everything actually useful has a type more specific than void*, and there is no reason such types can't be imposed throughout a self-hosted program, even at a systems programming level. If you disagree, can you describe a scenario where you don't believe this would be possible and say why?

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    207. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      Much of the above abuse would get flagged by -Wconversion.

      Some would, sure. But some things, such as weakly typed enumerations, are standard behaviour and don't tend to trigger warnings except maybe in Lint-style tools.

      Good luck writing device driver code without [pointers], though.

      I'm not saying you don't need explicit pointers. I'm saying you don't need, for example, those pointers to be nullable by default. I have done my share of embedded work, and I have yet to encounter a situation where accidentally dereferencing a null pointer was a good thing. :-)

      Most modern languages either aren't much more strongly typed than C.

      I didn't say most modern languages are good, nor did I claim that most modern languages are suitable for systems programming. I don't believe either of those things to be true. In fact, if there's one recurring theme throughout my comments in this discussion, it has been that we are far too willing to put up with existing inferior languages, mostly because of momentum and non-technical issues. I believe that this is holding the industry back from creating and using better languages, even though we have vastly more experience about how to do that now than the creators of languages like C had at the time.

      On the other hand, the more complex memory models don't come for free.

      No, they don't. At the very least, they add a degree of complexity to the language.

      We've long since learned how to avoid mismatched malloc-free pairs in most of the programming world, even if C hasn't. That's the easy stuff, and personally I think it's absurd that we're still using any programming languages that don't provide those kinds of tools one way or another. Today's problems are more about things like out-of-order execution and concurrency. Fine control of things like memory fences for synchronising access to shared or volatile (as in, externally influenced) storage is necessary to write safe code on modern architectures.

      There have been several people in this discussion -- though I'm not saying you're one of them -- arguing that C is suitable for systems programming where other languages aren't because it's so transparent and predictable. But the reality is, there was a lot of very detailed discussion happening around the turn of the decade in the C and C++ worlds about these issues. Despite the resultant updates to the standards, plenty of code is still being written that doesn't fully take these issues into account, and plenty of legacy code is still being used that was written before these issues had been formally considered and standardised. So I don't really buy that whole simplicity/predictability argument, nor do I buy that the overheads of doing better are prohibitive. Doing better is necessary to write correct code on a lot of modern platforms, whether it's convenient or not.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    208. Re:A poor craftsman blames his tools. by sjames · · Score: 1

      Promiscuously polymorphic means that literally any object type that can be defined already matches the parameter type for delete (for example). That sounds an awful lot like the void type, does it not? Consider the old adage that given sufficient determination, one can write a FORTRAN program in any language.

      If you have a function that does that, it must be possible to specify that if the language is to be self hosting (since it must be able to define and compile the delete function). If it can specify that and compile that, the programmer can (ab)use it. And so there you are, void* in all but name.

      You can just decide that self hosting isn't all that important, but then you have justified the need for a less safe language (for example, C) that the new language's compiler is written in.

      Note that I am not at all saying that you cannot have a safer language at all, just that you will need a less safe language somewhere and that language will have something that walks, quacks, and swims like a void*.

    209. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      Are you not describing C# ?

    210. Re:A poor craftsman blames his tools. by lucien86 · · Score: 1

      Its the point where you realize that machine code is too high level that you really realize you are in trouble. The solution (as ever) is Verilog. :D

      --
      Below the speed of light Special Relativity is one of the most accurate theories in physics - above the speed of light..
    211. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      I think I understand what you're saying, but I also think it's only a problem if you insist that your "new" and "delete" functionality be provided in the language as functions like anything else. There's no rule that says a language has to be implemented that way. There's also no rule that says just because whatever you use to release dynamically allocated memory when you're done with it can operate on any type that you can dynamically allocate, any other function must be able to do so as well. I think it's OK for allocating and releasing dynamic storage to be special in this way. After all, it is in almost every other language, one way or another.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    212. Re:A poor craftsman blames his tools. by david_thornley · · Score: 1

      I don't know Rust or Ada, and in my experience I tend to get things wrong when I look up language features, so I like to let people who do know them talk about them. I do know C++ well, and have noticed that a lot of people think they know C++ and are wrong. Very often, they used an early version, or were taught badly, and don't even know how to use C++98 well.

      However, anyone who uses phrases like "C/C++" or "C and C++" with the implication that the differences don't really matter does not know what he or she is talking about, and is about as competent to judge C++ safety features as I am to judge Ada or Rust. In this case, I was going by "C and C++ are less safe than, say, Ada or Rust", and in fact C++ is a lot safer than C.

      It would seem that neither you nor I know enough to compare C++ and Ada and Rust for safety. I'm willing to believe Ada and Rust are safer (that was one of the main design goals in Ada, I know), but I'd like to hear from someone who appears to me to know C++ well and who does know Ada and Rust well.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    213. Re: A poor craftsman blames his tools. by david_thornley · · Score: 1

      I do understand how my company works, how we make money, what our competitive advantages are, and how what I do fits into all of this. I'm not in management, and nobody's going to get me into management, because I don't want to be there. That means I'm still required to abide by management decisions. It does happen that the managers around here respect my knowledge and ability, but that doesn't mean I get to pick which languages and tools I use.

      The ability to develop software competently is in high demand and short supply, and anyone with that talent who has halfway reasonable communication skills and can get along with people reasonably well can get a job and keep it. A software manager who can't deal with people like that and get good work out of them should not remain an employed person for long.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    214. Re:A poor craftsman blames his tools. by Immerman · · Score: 1

      It's called being employed, otherwise known as selling your time and labor to someone else. Most people never had ownership to begin with, only limited custody at best.

      It's a wonderful thing if you can make a living programming for yourself, but the vast majority of programming is done by people working for someone else. And even when programming for yourself you should constantly be weighing the cost/benefit ratio of your actions. Yes, if you find imperfect code offensive, by all means spend the rest of your life trying to perfect "Hello World" (because no non-trivial program will *ever* be perfect.) As long as you're enjoying yourself, and can pay the bills, more power to you.

      Otherwise you would be wise to recognize that perfection is unachievable in any endeavor, not just programming, and decide when the diminishing returns of pursuing it are wasting the precious, limited hours of your life. If you can make 3 new tools that are 99% perfect in the time it takes you to improve one from 99.9% to 99.99%, then perhaps you should ask yourself which choice creates more value, for yourself and the world.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    215. Re:A poor craftsman blames his tools. by sjames · · Score: 1

      That's not the sort of ownership being discussed, though it can be related.

    216. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      > They're doing it because they want to make the language better

      Okay, but WHY? What's the goal?

      I would say it's to make the programmers' jobs easier, and breaking compatibility did the opposite.

    217. Re:A poor craftsman blames his tools. by Grishnakh · · Score: 1

      What do you mean, "why"? Why do you think? It's the same reason anyone invents a programming language.

      If they didn't want to make the best programming language they could, they never would have invented Python in the first place. They would have just stuck with Perl or something.

    218. Re:A poor craftsman blames his tools. by Grishnakh · · Score: 1

      Did you do validation? I think spending time in validation is some serious "earning your stripes" stuff compared to other groups I worked in.

      Yep, I started in compatibility validation for RAID cards and then moved to pre-silicon validation (Verilog simulation) of mobile processors. It (the pre-silicon side at least, the compatibility stuff not so much) was definitely a great way of learning how processors work. Note that I never worked in the desktop chip groups, but rather in what ended up getting sold off to Marvell.

      When I popped in a few years ago, the tools were _way_ more advanced. They added distributed computing (netbatch) and used some pretty sophisticated formal verification software from Cadence. ....

      Yep, I was using Netbatch back around 2003 for simulation tests. They tried to get us into using Specman; I thought it was crap. The internally-created tools we used were great and all ran in Perl and C++, so they didn't need specialized and non-transferrable training or special tools and licenses. They were looking a lot at SystemVerilog and SystemC when I left.

    219. Re:A poor craftsman blames his tools. by Immerman · · Score: 1

      You were referring I assume it, not to legal ownership, but "the buck stops here" responsibility, yes? So was I.

      At the end of the day your employer allocates your time - if something is "good enough" and they ant you to work on something of a higher priority instead, then that's what you do. Nothing you do will ever be perfect, so it's all a matter of efficient allocation of limited resources. Employers generally understand that better than anyone.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    220. Re:A poor craftsman blames his tools. by sjames · · Score: 1

      That's just it. At one time software developers were professionals and actually had some ownership of the process. That has been taken in many places./

      I agree, it is important not to let perfection be the enemy of good, but some of the code out there is absolute excrement that no self-respecting professional would willingly release.

    221. Re: A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      No, in Java a NullPointerException is thrown, and the developer can write code to catch it and recover (if it makes sense).

      If the developer doesn't bother catching exceptions then yes, the JVM terminates the program.

      This programmer error is easier to spot and fix in Java than in C.

    222. Re:A poor craftsman blames his tools. by sjames · · Score: 1

      I agree, it's OK for most purposes if the language does special case a few functions or if del and new are keywords rather than functions. However, in either case, you necessitate some other language without a restriction on void* (or equivalent). If the allocation and freeing isn't handled by a function, you'll need another language to do kernel programming since memory allocation works differently in kernelspace (and so you need to be able to re-write the allocators).

    223. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      I think I've realised where we're slightly talking at cross-purposes here. If you're writing a system-level memory allocator then you need some way to identify the address where some storage of interest starts. A void* is one way to represent that, and if I'm understanding you correctly, this is the sort of situation where you're saying it would be useful.

      I agree, but what I'm saying is I don't think a language needs a general purpose void* just because of that. I think it's OK to include a distinct language feature with its own semantics that says put a value of type T at position p in the available memory, and give back a strongly typed reference to it or the language's equivalent (like the placement form of operator new in C++, for example).

      Obviously you still need some way to represent those positions, which is necessarily going to vary depending on your architecture. I think it's OK for that type to have special semantics as well. You don't have to make the concept available throughout the entire program.

      This is an example of a more general issue with designing a systems programming language. You have to somehow expose the essential hardware interactions, whether it's memory or interrupts or poking magic registers that are hardware-mapped in some way. However, IMHO you ideally want to isolate those very low level operations and wrap them in your normal programming model and type system as soon as possible. My objection to C is that a lot of these details leak, and that's how errors like miscasting or dereferencing null or invalid pointers tend to happen.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    224. Re:A poor craftsman blames his tools. by sjames · · Score: 1

      That's just it, if the feature exists, not abusing it is a matter of programmer discipline because the compiler can't necessarily anticipate when the correct time is to make it available.

      For example, I once wrote a proof of concepy exec in userspace function. It would analyse the ELF executable file it was passed, relocate selected helper functions out of the way (including modifying their symbol tables), munmap the original program, then mmap and perform the symbol relocation on the target executable, then jump into it.

      I'm sure you can imagine, I had to "break the 4th wall" all over the place to make that work. I had to do that in places a compiler might not expect. C didn't care, of course. At the same time, had I been writing a mail merge program, it would be highly inappropriate to take such liberties.

      So somehow or another, there must be a language that permits such crazy stuff. It can be a separate unsafe language, or a #pragma, or a compiler flag that enables unsafe features in a normally safe language. It can even be a language that makes the features available and depends on the programmer to use them tastefully. The latter is just a special case of depending on the developer to only enable the unsafe features when necessary (though perhaps one that offers moire temptation).

      Bottom line, there can not be a one true language that both forbids all that void* jackassery AND is suitable for all purposes. Sometimes (not often) void* actually is the right answer.

    225. Re:A poor craftsman blames his tools. by Anonymous Coward · · Score: 0

      I thought you guys were arguing about C. What are these "new" and "delete" operators you are talking about?

    226. Re:A poor craftsman blames his tools. by PJ6 · · Score: 1

      It's not the language, it's the programmers and the rush to produce easy code. Speed and simplicity trumps security and efficient coding these days.

      I can't stand hearing aphorisms that people think must be true because they sound good.

      Give a lumberjack a toothbrush and tell him to cut down a forest, and tell him "a poor craftsman blames his tools".

      You may say that's not like software development, it's exactly like that.

      Over and over again I see great developers succeed not because of, but in spite of the shitty tools they have to use, and the dysfunctional organizational structures they have to work in.

    227. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      We're talking about what would be an improvement on C but still retain the flexibility that C has for systems programming.

      One of my arguments is that C's raw malloc and free don't fit into the type system cleanly and instead rely on void*. I'm suggesting that there should be more strongly typed tools for manipulating dynamic storage, even if it's necessary to add special features to the language to support them. Many C-style languages have something broadly along the lines I'm talking about, and often they call it "new" and "delete" or something close to that.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    228. Re:A poor craftsman blames his tools. by Anonymous+Brave+Guy · · Score: 1

      It seems your fundamental point about a pervasive void* in a language is that programmers should be disciplined enough to use language features correctly. I suppose it does always come down to that eventually. I just think a language could offer more than C does to help programmers achieve that. Idiomatic C code tends to use void* for other purposes as well, as a proxy for generics for example, and that shouldn't be necessary IMHO even in a systems programming language.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    229. Re:A poor craftsman blames his tools. by sjames · · Score: 1

      An important distinction, I believe there must always exist a language where that is true to handle cases where it is necessary. That doesn't exclude languages that don't permit it for cases where it won't be needed. It's still a matter of the developer choosing the language wisely, but it might remove temptations to cheat.

      A great challenge but probably worth it would be a new function naming convention to facilitate writing libraries in a safer language. Currently C is used a lot because it produces a library that pretty much any other language can cope with linking against. It would be nice to be able to select a safer language without opening a snakes nest of linking trouble.

  2. a poor systemd is a poor product by Anonymous Coward · · Score: 1, Funny

    it's not the language its systemd thats at fault. systemd is insecure and a poor product.

  3. Plus ca change by Anonymous Coward · · Score: 1

    So ... time to resuscitate Ada?

    Positives: there are decades of experience with it.
    Negatives: it's not "ooh, shiny!"

    1. Re:Plus ca change by Joce640k · · Score: 0

      There's no need: C++ has modtly caught up to Ada and has far better IDEs and compilers. All you need to do is stop using the "C" part and you're golden.

      C++ isn't C. If I open Visual C++ and type this code I'll get an exception when I try to run it:

      std::vector a;
      a[-1] = 0x666;

      So next time you hear Linus Torvalds rant against C++ tell him to fuck off and stop being an idiot.

      --
      No sig today...
    2. Re:Plus ca change by darkHanzz · · Score: 1

      I'm quite sure it's an assert that triggers, which is something quite else than an exception. At least Torvalds is acutely aware of the distinction between the two.

    3. Re:Plus ca change by Anonymous Coward · · Score: 0

      So next time you hear Linus Torvalds rant against C++ tell him to fuck off and stop being an idiot.

      Write a better kernel in C++ to prove your point and I will personally tell him to fuck off.
      Until then I think I will stick with telling you to fuck off.

      Oh, and you should probably learn what C is capable of before making incorrect claims about what it can and cannot do.

    4. Re:Plus ca change by Anonymous Coward · · Score: 0

      Except that C++ has been shown in a study of github submissions to be the worst mainstream language: http://macbeth.cs.ucdavis.edu/lang_study.pdf

      While it isn't the worst performer at any one thing, it comes consistently close to the bottom in all areas of the study which leads it to have the lowest overall score.

    5. Re:Plus ca change by Anonymous Coward · · Score: 0

      Better yet:

      smart_ptr my_bytes( new char[someValue] );
      return;

      Won't leak.

      Hell. You can make a smart pointer that can't be set to null if you so desire. You can make all your calls return a variant and force people to check that it's actually a T before being able to use it. C++ has tons of tools to prevent these things fro happening.

      Linus being anti-C++ is just sad. Old man yells at cloud, sad.

    6. Re:Plus ca change by ChrisMaple · · Score: 1

      If you can't think of a valid use for a negative index in an array, you're not trying hard enough.

      --
      Contribute to civilization: ari.aynrand.org/donate
    7. Re:Plus ca change by Joce640k · · Score: 1

      LOL! I've been writing C since the 1980s, pre-ANSI. I've still got my original copy of K&R somewhere.

      By modern standards it's a crap language, honestly. I've given up trying to educate C idiots though. They're beyond salvation.

      Short version of the final argument:
      a) You assert that C is best.

      b) I say "Why aren't you writing in assembly language instead of C"?

      c) Whatever you reply I simply reword it to replace "Assembler" with "C" and "C" with "C++" then give your own argument back to you.

      ie. I use C++ instead of C for the exact same reasons you use C instead of assembly language.

      By reduction: If you're not using assembly language then you should be using C++.

      --
      No sig today...
    8. Re:Plus ca change by Cederic · · Score: 1

      So next time you hear Linus Torvalds rant against C++ tell him to fuck off and stop being an idiot.

      Why would I want to? He's clearly not an idiot, I owe him for the work he's done to build a reliable kernel I use daily, and C++ is indeed a fucking stupid language.

      I've yet to see any C++ code base that is bug free, mainly because inexperienced people write bugs and experienced people write so much fucking scaffolding code to try and prevent them that the code becomes unmaintainable anyway.

      Good experienced people switch to better languages.

    9. Re:Plus ca change by Joce640k · · Score: 1

      Yep. The real difference between C and C++ isn't "classes", it's RAII. It's stack unwinding. It's exception handling.

      --
      No sig today...
    10. Re:Plus ca change by Joce640k · · Score: 1

      Is that written in the standard?

      The point is that it won't overwrite memory. std::containers are range checked by default in many modern compilers.

      --
      No sig today...
    11. Re:Plus ca change by Joce640k · · Score: 1

      From what I've seen most github submitters are actually writing C using a C++ compiler, so... meh.

      --
      No sig today...
    12. Re: Plus ca change by Anonymous Coward · · Score: 0

      So you use C++ because the compiler is better at optimizing for pipelines and cachelines than C compilers? Are you sure? Because that is why I don't code in asm anymore.

    13. Re:Plus ca change by F.Ultra · · Score: 1

      That is because your a[-1] is not equivalent to a a[-1] in C but to a vector_set_at_pos (a, -1, 0x666);

      I don't think that straight arrays such a "int a[10]; a[-1] = 0x666;" throws any exceptions in C++ either.

    14. Re:Plus ca change by F.Ultra · · Score: 1

      Ok, I personally stopped coding in asm and switched to C because the processors got so complicated that a compiler would have a higher chance of creating faster code and so that porting the code between architectures would no longer require a complete rewrite of the whole program line by line. How would your C++ compiler be any better than a C compiler for any of that?

    15. Re:Plus ca change by colinrichardday · · Score: 1

      Stroustrup's book is four times as long as K&R. Is K&R four times as long as a standard text on Assembly?

    16. Re:Plus ca change by Anonymous Coward · · Score: 0

      [...], and C++ is indeed a fucking stupid language.

      You're a fucking stupid language.

    17. Re:Plus ca change by Anonymous Coward · · Score: 0

      Too bad C++ exceptions don't let you convert SIGSEGV to a null pointer exception.

      Yeah, gcc has -fnon-call-exceptions which allows you to throw once you've checked the registers (and possibly also modified the instruction pointer in the case of calling a nullptr function pointer), but clang doesn't support that yet and may not ever. :(

      Also, you can't throw from a C++ destructor. QQ FML.

      So if you want real exception handling in C++, you still have to roll it yourself.

    18. Re:Plus ca change by Joce640k · · Score: 1

      SEGV is very unlikely if you're using C++ correctly, ie. std::containers, std::string and strong/weak smart pointers. Any bad access can be trapped just like in Java.

      Exceptions in a destructor? Also very esoteric. Destructors are there to free resources not to make decisions.

      --
      No sig today...
    19. Re: Plus ca change by Joce640k · · Score: 1

      So you use C++ because the compiler is better at optimizing for pipelines and cachelines than C compilers? Are you sure? Because that is why I don't code in asm anymore.

      You're supposed to start with a "C vs. C++" comparison. I'm the one who converts it into a "C vs assembly language" comparison. :-)

      --
      No sig today...
    20. Re:Plus ca change by Joce640k · · Score: 1

      Ok, I personally stopped coding in asm and switched to C because the processors got so complicated that a compiler would have a higher chance of creating faster code and so that porting the code between architectures would no longer require a complete rewrite of the whole program line by line. How would your C++ compiler be any better than a C compiler for any of that?

      You're supposed to start by telling me that C is somehow better than C++, not that C is better than assembly language. :-)

      --
      No sig today...
    21. Re:Plus ca change by Joce640k · · Score: 1

      Stroustrup's book is four times as long as K&R. Is K&R four times as long as a standard text on Assembly?

      Yes.

      --
      No sig today...
    22. Re:Plus ca change by Joce640k · · Score: 1

      But to answer your questions:

      a) Yes. C++ has more information available for optimization.

      eg. The compiler writer can optimize the compiler for std::vector rather than trying to optimize for every conceivable way a C programmer could mess around with pointers.

      b) Yes. C++ makes it far easier to change data structures and optimize the code for different architectures than C does.

      eg. Look at strcmp() vs wcscmp(). In C you need to choose a function name in advance. If you've got a bunch of legacy code to convert then how do you update it? With a macro? C++ has templates function overloading so it's much easier to adapt code to new data types.

      Also new programming practices are much easier to implement.

      eg. Updating code to to use strncpy() instead of strcpy(). It's going to be a lot of work to adapt a large C program to do that. If you're using a string class which defines operator=() for string copy then you change a few lines of code, job done.

      --
      No sig today...
    23. Re:Plus ca change by colinrichardday · · Score: 1

      And you have a title/author for such a text? The shortest such text I could find on Amazon was 162 pages, which is far more than one-fourth of K&R.

    24. Re:Plus ca change by Anonymous Coward · · Score: 0

      The trouble is C++ carries a lot of baggage that isn't easily portable to a "no runtime available" environment.

      If you avoid the baggage, you are just writing C in the first place. So why not use a language that won't let you use the baggage in the first place?

    25. Re:Plus ca change by F.Ultra · · Score: 1

      I take it that you are a Windows programmer (by the reference to wcscmp) ?

    26. Re:Plus ca change by F.Ultra · · Score: 1

      eg. The compiler writer can optimize the compiler for std::vector rather than trying to optimize for every conceivable way a C programmer could mess around with pointers.

      Actually it's the other way around, the great performance in C comes from the lack of restraints. When you in C does say a[-1]=0x666; then the compiler have no restrains what so ever so it can just overwrite that memory location and go on happily. In C++ however with std::vector there are constraints that it _must_ abide so the compiler have no choice but to impose two conditionals and one branch for every write reference to a[x];. If it didn't then it would no longer be "safe" and you would also no longer get your exception.

      b) Yes. C++ makes it far easier to change data structures and optimize the code for different architectures than C does.

      Now I don't fully follow you for which architectures you refer to where you have to use wcscmp() over strcmp(), but I have "ported" code between x86, x86_64, Power and Arm without changing a single line of code so C++ would not have helped me more there.

      eg. Updating code to to use strncpy() instead of strcpy(). It's going to be a lot of work to adapt a large C program to do that. If you're using a string class which defines operator=() for string copy then you change a few lines of code, job done.

      Or you have your own string functions (or use any of the ones from a shared library) which provides the same thing.

    27. Re:Plus ca change by cheesybagel · · Score: 1

      std::vector is crap. Guess why 99% of real world C++ applications implement their own vector library?

      At least C doesn't pretend it has good dynamic arrays. You just implement your own whichever way you like.

    28. Re:Plus ca change by cheesybagel · · Score: 1

      All things which cannot be used in OSes or real-time applications.

    29. Re:Plus ca change by dgatwood · · Score: 1

      eg. Updating code to to use strncpy() instead of strcpy().

      I hope you meant strlcpy. The strncpy function is actually quite dangerous because it doesn't guarantee that the result will be null-terminated.

      It's going to be a lot of work to adapt a large C program to do that. If you're using a string class which defines operator=() for string copy then you change a few lines of code, job done.

      Only because C++ strings are inherently massively complex behemoths. Try working with them on an Arduino and you'll quickly find yourself cursing at yourself for ever considering using C++. :-)

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    30. Re:Plus ca change by Joce640k · · Score: 1

      Is Arduino the exception that proves the rule?

      --
      No sig today...
    31. Re:Plus ca change by Joce640k · · Score: 1

      C++ allows you to choose.

      You can turn off the constraints on std::vector if you want to (and people frequently do in a "release" build).

      --
      No sig today...
    32. Re:Plus ca change by Joce640k · · Score: 1

      I hope you meant strlcpy. The strncpy function is actually quite dangerous because it doesn't guarantee that the result will be null-terminated.

      ...another example of why C++ is a much safer language than C.

      (No, I haven't used C or low level string functions seriously since ... about when Visual C++ 6.0 was introduced).

      --
      No sig today...
    33. Re:Plus ca change by Joce640k · · Score: 1

      Or you have your own string functions (or use any of the ones from a shared library) which provides the same thing.

      You mean you reproduce C++ functionality in C? Wouldn't it make sense to just use C++?

      --
      No sig today...
    34. Re:Plus ca change by david_thornley · · Score: 1

      I've yet to see any C++ code base that is bug free,

      I've yet to see any sizable code bases that are bug free, and the ones I've read about that are likely to be are that way because of development approach and individual ability, not choice of language. TeX is very reliable, and was written in Pascal with weird formatting (see Literate Programming).

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    35. Re:Plus ca change by david_thornley · · Score: 1

      The places I've worked at have used std::vector happily (although here we usually wrap it up to fit into MFC better). What do you think is wrong with it?

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    36. Re:Plus ca change by david_thornley · · Score: 1

      The big problem with strncpy() is that the naming convention is deceptive. IIRC, all other "strn" functions are range-checked versions of the corresponding "str" functions, while strncpy() does something significantly different from strcpy().

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    37. Re:Plus ca change by david_thornley · · Score: 1

      a[-1] is undefined behavior in C, and not all compilers will do what you want with it. It's only reasonable with the sort of pointer action that's very error-prone and almost never required in normal applications. If you need it in C++, it's there. With C++ and std::vector, the compiler is not required to introduce checks when using the normal [] way of using it and not .at(). Heck, it's not required to check .at(), if the compiler can determine that this particular access will not throw an exception.

      A compiler that optimizes checked memory references in preference to raw memory accesses is going to be more useful in most cases. There's no advantage to doing the wrong thing really, really fast.

      The flexibility advantage in C++ is real. Often you don't get a chance to use your nice spiffy string functions, because the existing code base uses the standard ones, or (worse) uses something proprietary. With a C++ string class, change a few functions in the class definitions and you're ready to go. C++ classes and inheritance make it easy for old code to use new code without change, instead of just new code using old code.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    38. Re:Plus ca change by F.Ultra · · Score: 1

      If you disable the constraints then all of the benefits of the "safe language" is lost so why you would disable the in a release build and then name C++ safer than C is way beyond me.

    39. Re:Plus ca change by F.Ultra · · Score: 1

      But that was not the point, the claim by parent was that the constraints made the code faster which it doesn't, it actually makes it slower and that is what I replied to.

    40. Re:Plus ca change by F.Ultra · · Score: 1

      Because my string function does things differently than the standard string class in C++? Because working with strings is not all that I do? So why should I switch languages just because they happen to do one thing by default that otherwise have to write some small code once in order to have? Do you constantly switch languages when they implement functionality that you do not have out of the box in C++? I don't think so.

    41. Re:Plus ca change by Grishnakh · · Score: 1

      Destructors are another thing you can't use in a safety-critical real-time system.

    42. Re:Plus ca change by Joce640k · · Score: 1

      C++ allows you to choose.

      --
      No sig today...
    43. Re:Plus ca change by goose-incarnated · · Score: 1

      There's no need: C++ has modtly caught up to Ada and has far better IDEs and compilers. All you need to do is stop using the "C" part and you're golden.

      C++ isn't C. If I open Visual C++ and type this code I'll get an exception when I try to run it: std::vector a; a[-1] = 0x666;

      So next time you hear Linus Torvalds rant against C++ tell him to fuck off and stop being an idiot.

      That's a disingenuous example. C doesn't have vectors. If you open Visual C++ and type the following code in you won't get any exceptions:

      int a[12];
      a[-1] = 0x666;

      Which, by the way, is exactly the same result you will get in C. What you may or may not have noticed in your self-professed long career in development is that C and C++ get used for different problems. If your problem doesn't allow for much of the C++ scaffolding then you're programming in C, like it or not, in which case you'll write your own vector library in C (or use one of the many platform-independent ones).

      --
      I'm a minority race. Save your vitriol for white people.
    44. Re:Plus ca change by david_thornley · · Score: 1

      However, there can be constraints enforced by the compiler. In the case of a[-1], the compiler is literally allowed to do anything by the C standard, and some compilers at high optimization levels will take advantage of that. In the case of a std::vector being referenced by .at(), the compiler doesn't have to add constraints if it can know that the reference is in-range (one example would be inside a for loop where the iteration variable is only changed in the for statement clause).

      Also, the compiler can aim its optimizations to the usual case of checked references It's not like the unchecked references need optimization.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    45. Re:Plus ca change by F.Ultra · · Score: 1

      Yes that is correct of course. For most other situations however the reference will be set dynamically outside the compilers reach, for example via external input, and when that happens it cannot optimize away the constraints. For the specific bad example from parent with a constant it should even trigger a compiler error if the C++ compiler where smart enough.

    46. Re:Plus ca change by F.Ultra · · Score: 1

      So does C so I don't really get your logic here. In fact most if not all languages lets you choose. The choice might render more work in the end in some language vs another but that is besides the point.

    47. Re:Plus ca change by Dog-Cow · · Score: 1

      The kernel doesn't even use libc. No way in hell it would use stdlib. You are a moron.

    48. Re:Plus ca change by Joce640k · · Score: 1

      C++ lets you choose much more easily than C.

      Plus: std::vector is simply safer than C array. eg. It has a size so you don't need to pass the size of the array around separately.

      Yes, you could make a struct in C that has the array pointer and the size but you're just making life complicated for yourself.

      C++ exists! Use it! Use it even if all you do is write C code with std::vector and std::string instead of malloc/free.

      --
      No sig today...
    49. Re:Plus ca change by F.Ultra · · Score: 1

      I have no use whatsoever for std::vector or std::string, is that so hard to grasp? Just give it a little time and some one will try to convince you to switch to Go or Rust instead of that old crappy C++ of yours. Yes you love C++, that is made perfectly clear by now, you just have to live with the fact that not every one else does too.

    50. Re:Plus ca change by cheesybagel · · Score: 1

      2*N growth with large dynamic arrays is a good reason to hate it. Wasted memory space. Changing the allocation policy with your own custom allocator is a PITA. There are all other sorts of reasons to hate it though.

  4. yeah right by matushorvath · · Score: 0

    Let's write software in some esoteric language that nobody is using. There are less than 10 applications written in it in productive use, and they were all written by the same people who wrote the compiler, but SURELY it will be better than C which is used in everything from your watch to the space probes we send to Jupiter.

    You can't fix bad programming by tools. You can only fix bad programming by not hiring bad programmers.

    1. Re:yeah right by Anonymous Coward · · Score: 0

      Following your logic people would still be writing everything in Algol and Fortran. Nothing against these languages, but your thinking is principally flawed.

    2. Re:yeah right by Anonymous Coward · · Score: 0

      "principally flawed"??

      That's an... odd expression. English not your native tongue, eh?

    3. Re:yeah right by Samantha+Wright · · Score: 1

      Believe it or not, NASA has worried about language safety too.

      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
    4. Re: yeah right by Anonymous Coward · · Score: 0

      Cheap shot, dude.

    5. Re:yeah right by S.O.B. · · Score: 1

      A rare expression but nothing odd about it. With respect to definition it was correctly used and appropriate for the context.

      Rather than showing English is not their native language, it shows a better than average command of the language.

      --
      Some of what I say is fact, some is conjecture, the rest I'm just blowing out my ass...you guess.
    6. Re:yeah right by mpilsbury · · Score: 1

      Posting to revert accidental moderation.

    7. Re:yeah right by Megol · · Score: 1

      Human languages aren't simple pattern matching thingies as you seem to believe. Principally flawed is parsed as something that is using a flawed principle, a substitution could be simply "flawed" however that could be interpreted as claiming the OP have some actual problem with his thinking. By instead inserting "principally" out AC points out that he thinks it is the principle that is at fault and following that principle leads the OP to the wrong conclusion.

      But by all means continue posting irrelevant crap instead of actually using the insides of your head, your thinking skills are obviously flawed.

    8. Re:yeah right by Anonymous Coward · · Score: 0

      "Principally flawed is parsed as something that is using a flawed principle,"

      Except that "principally" has nothing to do with principle, but principal.

      Pattern match THAT, you idiot.

      http://www.dictionary.com/brow...

      You proved my point: by using odd phrases you invite confusion among people such as yourself, unable to distinguish words.

  5. Yes by MichaelSmith · · Score: 3, Interesting

    Every programming language I have used commercially has had a few things it does well and a whole bunch of limitations. Bad code gets written all the time to work around language limitations. Consider the lack of data type declarations in python, java script, coffeescript, etc. Terrible for code readability.

    Its all religious theory and habit with very little up front thought and design. RIP Pascal and Ada.

    1. Re:Yes by Anonymous Coward · · Score: 1

      Pascal is not dead. Zombie Delphi will coach you.

    2. Re:Yes by MichaelSmith · · Score: 1

      Not really. Its a fringe thing now. At a previous place I worked Ada was being auto-translated to java.

    3. Re:Yes by Anonymous Coward · · Score: 0

      Not really.

      Yes. Really.

    4. Re:Yes by Anonymous Coward · · Score: 0

      Ouch. I've heard of automatic Ada->C translation, but Java? Somewhere a lot of pink unicorns must have died a terrible death.

    5. Re:Yes by tomhath · · Score: 2

      Consider the lack of data type declarations

      On the other hand, pretty much every language that uses static typing gives you a way to get around it with overloading, annotations, injections, factories, etc. All of which makes it even more buggy and difficult to read, verify, and maintain.

    6. Re:Yes by MichaelSmith · · Score: 2

      Its actually a good match, you can almost do it with awk. Out parameters and named parameters are two problems I can think of. It does result in a lot of awful java code though,

    7. Re:Yes by Anonymous Coward · · Score: 0

      I haven't designed a programming language (yet) but when I do, the rule will be NO automatic type conversions EVER!

    8. Re:Yes by Anonymous Coward · · Score: 0

      Pascal will never die. The new language, Nim, is a blend of Python and Pascal/Delphi. It's safe, fast and elegant.

    9. Re:Yes by Anonymous Coward · · Score: 0

      Its all religious theory and habit with very little up front thought and design.

      That's why I've stuck with Logo all these years.

    10. Re:Yes by Anonymous Coward · · Score: 0

      Except that it is documented by the code itself...

      As soon as you see "overloading, annotations, injections..." you KNOW something could go wrong.

    11. Re:Yes by Anonymous Coward · · Score: 0

      Consider the lack of data type declarations

      On the other hand, pretty much every language that uses static typing gives you a way to get around it with overloading, annotations, injections, factories, etc. All of which makes it even more buggy and difficult to read, verify, and maintain.

      The way OCaml does it is it constructs a proof and figures out if there's a way the program can be well-typed. So I'm sure if the compiler can infer the types, then there's a possibility of having the compiler or another program tell you what the types should be, and putting them into the code. I personally just write down the types explicitly in OCaml anyways though.

  6. form by Anonymous Coward · · Score: 0

    The computers they use to run the code are made with politically correct solder instead of lead solder, so the computers are dying faster than the code.

  7. Who verifies the formal specification? by tomhath · · Score: 1

    The suggestion to use formal verification has been around for decades. It isn't used outside of the ivory towers because writing a correct specification and proving it's correct is harder than writing correct software. It becomes increasingly difficult as the code base gets bigger and more interfaces are added.

    1. Re:Who verifies the formal specification? by Anonymous Coward · · Score: 0

      Except reading the article it's immediately clear that it is used outside of "ivory towers". Anything that makes writing programs harder is absolutely fine with me, I find it ridiculously trivial to implement code that runs for years without issue while my peers struggle with the most obvious of concepts. Time to add some bleach to the pool and get rid of all the "programmers" who don't have any actual aptitude for the task. Just as you wouldn't ask an arthritic 90 year old woman to work hefting steel supports on a building site, we shouldn't expect intellectual midgets to engage in computer programming.

    2. Re:Who verifies the formal specification? by St.Creed · · Score: 1

      A lot of software isn't critical. Most programmers can do that fine. Things get different when you write the code for autonomous vehicles, space probes or for instance, a dam protecting critical infrastructure. These programs tend to get verified formally because time to market isn't the issue, and the cost of failure is so much greater than the cost of doing it right.

      Apart from that: "Anything that makes writing programs harder is absolutely fine with me" - not with me. It needs to be much easier to write safe, functional code. Because the amount of code required in daily life is going up, not down, and anything that makes it harder will not remove programmers from the workforce, it will just necessitate more people programming. I want to be more productive, not less, because there's already more work to do than I can ever handle during my life.

      --
      Therefore, by the (faulty) logic you're using, you're just a cow with a keyboard - osu-neko (2604)
    3. Re:Who verifies the formal specification? by gtall · · Score: 1

      There's another problem, writing correct specifications and proving them + code together is correct requires a different set of mental tools. In my estimation, most programmers are terrible at formal logic. It is not computation, it is more like mathematics. Programmers just do not have the mathematical maturity to grind their way thought logical proofs.

      And it is extraordinarily time consuming.

    4. Re:Who verifies the formal specification? by PurpleAlien · · Score: 1

      My company builds embedded systems. We use formal verification for critical systems (quite a few in the embedded world). We're not sitting in an ivory tower...

      --
      My blog, if you're interested: http://www.purp
    5. Re:Who verifies the formal specification? by Xest · · Score: 1

      You don't need to formally verify everything, just the mission critical parts.

      It's completely nonsensical to argue "writing a correct specification and proving it's correct is harder than writing correct software" because if it hasn't been formally verified, then you have no idea that what you're calling "correct software" is actually correct and that's precisely the problem of a lack of formal verification. You merely assume it's correct until you find out it isn't, and if you find that out with the control software on a nuclear reactor, the software to manage car breaks, or a fly-by-wire system on a plane then you've already killed someone.

      Formal verification is a mathematical process and you hire competent mathematicians, or computer scientists with sufficient mathematical grounding to do it. Most companies don't ever have anything critical enough to justify this, but some do. Don't pretend it's not useful in the real world, it is, and it saves lives, your laissez-faire attitude to it is how people die from bad software on safety critical systems. I hope to god you're never allowed near such software and instead stick to coding shitty Drupal plugins for blogs in PHP or whatever where the only damage you can do is make a hipster cry about not being able to post their latest selfie.

      There's a time and a place for it for sure, but in that time and place it absolutely matters and isn't just ivory tower nonsense. If you don't understand it, fine, just leave it to people that do. Don't criticise something of immense importance simply because it and it's use is beyond your understanding however.

    6. Re:Who verifies the formal specification? by david_thornley · · Score: 1

      The early stuff on formal verification left me with the feeling that, if I were a perfect mathematician, I could then become a good programmer, which wasn't really all that helpful. I did get some ideas on how to verify some fairly small constructs, which I've used when they seemed useful. My experience is that, once I've formally proven a routine correct, the remaining errors are normally big dumb ones that are easy to find and fix.

      The big issue with formal specifications is that programming is the art of changing informal descriptions to formal descriptions, and so creating a correct spec and verifying that the program conforms is more work than writing a conforming program. Moreover, the formal description can be considered a programming language in itself.

      In some cases, it's possible to set up a correct formal spec, and there are software verification tools that can help from there. It helps if the domain is really limited, such as accounting or circuit design.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  8. The programmer not the language by Sla$hPot · · Score: 0

    It's like asking if a bad human language are creating bad societies. The answer is of course no.

  9. what a waste of article by e**(i+pi)-1 · · Score: 0

    What a nihilistic article: quote: " it unrealistic to expect programmers to write secure code in memory-unsafe languages." No, its not unrealistic, because it reality disproves the statement. Rock solid things have been built safely in C: most operating systems kernels, modern video editing software, games. Things which need to work directly with the memory like juggling smoothly dozens of gigabytes of video data and fast. not just a smart phone app. Good luck with programming a video editing app in a memory safe language today. Maybe one should pay attention to programmers who have actually created something substantial.

    1. Re:what a waste of article by mccalli · · Score: 4, Interesting

      How many rock solid kernels, games or video editing suites are you aware of? I'm aware of zero. Do you not install your updates?

    2. Re:what a waste of article by Rockoon · · Score: 4, Informative

      When you say "memory safe" languages surely you mean managed languages like Java...

      Java is of course a completely safe language. There has never been any question about how safe and reliable Java is, and nobody has ever recommended un-installing Java to make your system safer.

      --
      "His name was James Damore."
    3. Re:what a waste of article by Anonymous Coward · · Score: 0

      Good luck with programming a video editing app in a memory safe language today

      Mozilla started their Rust use with the media related code, apparently.

    4. Re:what a waste of article by Sigma+7 · · Score: 1

      How many rock solid kernels

      Pretty sure MS-DOS 5.0 was rock-solid enough. It only faltered because things running under it had bugs that overwrote random bits - the kernel itself would be stable.

      games

      A non-rock solid game would practically crash frequently. Especially in the early era where patches are unheard-of - if the game is faulty, it's dead.

      Most Apogee platformers seemed rather stable. It only took them until RotT before they had a major crash that would lock up a computer.

    5. Re:what a waste of article by Anonymous Coward · · Score: 0

      How many rock solid kernels, games or video editing suites are you aware of? I'm aware of zero. Do you not install your updates?

      You being aware of zero only tells me something about you, not about what is out there.

      There are plenty of operating systems made for safety critical applications.
      You wouldn't run them on a desktop or server which probably is why you haven't heard about them but that doesn't mean they don't exist.

    6. Re:what a waste of article by gtall · · Score: 1

      Well, problems with failing memory checks aside, no language is going to protect against sheer complexity of the result. Given an relatively large program like an OS, C or any other language is not going to stop unanticipated side effects of the many moving parts.

    7. Re:what a waste of article by Nemyst · · Score: 1

      You seem to be under the impression that memory-safe code inherently implies a virtual machine or some sort of runtime. That's quite far from the case: both Rust and Go compile directly to machine code, much like C. They may have additional elements that C doesn't have (Go is a bit heavier with a garbage collector and richer type information, while Rust is basically C++ with more compile-time safety and no C baggage to worry about), but that doesn't necessarily impact them in severe ways, and it exposes many things that C does poorly (reflection, multithreading, etc.) in a much more programmer-friendly fashion.

      Memory safety doesn't mean jumping from C to Java.

    8. Re:what a waste of article by rubycodez · · Score: 1

      if a person or organization doesn't hit the conditions to trigger a bug that causes crash, the OS will appear "rock solid" even if it doesn't to you.

      So I admin hundreds of servers, I have my view of what has been "rock solid" though your experience or some study's claims might be different

      From my point of view, major linux distros not quite rock solid

      AIX, rock solid though a pain to admin

      Windows - shaky and unstable

      openbsd, rock solid, though you can read their errata list and find fixes for things that would crash it. we never met those conditions

      freebsd - rock solid in production, in though testing I could trigger SMP lockup pre-version 9.1

    9. Re:what a waste of article by bws111 · · Score: 1

      In fact, there is no question of how safe and reliable Java is, and nobody that knows what they are taking about has recommended removing Java. The problem with 'Java' is that malicious code can exploit weaknesses in the sandbox (which is not written in Java). The solution is to not run untrusted code, ie disable the browner plugin.

      Protection from malicious code is far different than protection from programming bugs that allow inputs to cause malicious operation.

    10. Re:what a waste of article by swillden · · Score: 0

      Pretty sure MS-DOS 5.0 was rock-solid enough. It only faltered because things running under it had bugs that overwrote random bits - the kernel itself would be stable.

      MS-DOS wasn't an operating system, it was a program loader. Things "running under it" had free reign to do absolutely anything they wanted. There was no memory protection, programs could even replace hardware ISRs. Even if there were no bugs in MS-DOS, it could not be used to safely run programs that weren't themselves guaranteed safe... which means that no one even bothered to worry about whether or not there were security bugs in MS-DOS. The question makes no sense.

      A non-rock solid game would practically crash frequently.

      We're talking about secure code. I guarantee you that no non-trivial game exists that doesn't have plenty of security bugs. The game may run without crashing, but that says nothing about security. Security is being able to run correctly while being actively and intelligently *attacked*. It's worth noting that a correct response of a secure program to certain forms of attack *is* to crash immediately (but safely).

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    11. Re:what a waste of article by mccalli · · Score: 1

      I agree with this point of view entirely. I interact with flawed software daily, and none of its flaws either become apparent to me or affect me in any way that I care. Same for the games or video editing suites that the original post mentioned.

      I'm not fooled into believing they actually are rock solid though. The original poster stated that we should look at 'rock solid' things such as kernels, games and video editing suites. They aren't rock solid. They're just predictable, mostly.

    12. Re:what a waste of article by Anonymous Coward · · Score: 0

      Java is of course a completely safe language.

      And it doesn't even have unsigned data types. (well, other than the 16-bit character) That omission was not necessary to make it "safe". A chunk of memory can't be seen as both "an array of bytes" and "an array of long". Which is useful for implementing a fast file compression utility - and it is certainly doable within the confines of "safe" and "array length checking".

      Oh, and try writing something simple like "cp" in java. As fast as any other implementation, of course.

      Don't use Java because it is such a pain. Programming isn't just "nice GUIs with very little behind the menus/buttons".

    13. Re:what a waste of article by Megol · · Score: 1

      Pretty sure MS-DOS 5.0 was rock-solid enough. It only faltered because things running under it had bugs that overwrote random bits - the kernel itself would be stable.

      MS-DOS wasn't an operating system, it was a program loader. Things "running under it" had free reign to do absolutely anything they wanted. There was no memory protection, programs could even replace hardware ISRs. Even if there were no bugs in MS-DOS, it could not be used to safely run programs that weren't themselves guaranteed safe... which means that no one even bothered to worry about whether or not there were security bugs in MS-DOS. The question makes no sense.

      You should seek a refund for your operating systems course as you are 100% wrong. Operating system doesn't imply protection (that is a feature and not a defining characteristic). MSDOS provided disk management, device management, memory allocation etc. and is obviously more than a program loader given that the OS continued to run and provided runtime services to programs. Thinking that operating system equals protection leads to such ludicrous ideas that Amiga OS wasn't multi-tasking and removes a lot of significant operating systems from computing history...

    14. Re:what a waste of article by gweihir · · Score: 1

      Very much this. If your programmers are not able to write secure code in C, then do not hire them because they are _incompetent_. They will write insecure code in any other language, it will just not be quite so obvious. And that is a bad thing, because it makes independent review harder. It is quite possible to write grossly insecure code in Java or Rust.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    15. Re:what a waste of article by Rockoon · · Score: 1

      The problem with 'Java' is that malicious code can exploit weaknesses in the sandbox

      ...thought nobody that has been hit with malware that exploits the 0-days in the official java runtime, ever.....

      --
      "His name was James Damore."
    16. Re:what a waste of article by phantomfive · · Score: 1

      How many rock solid kernels, games or video editing suites are you aware of?

      L4 micro-kernel. Proven correct. Written in C. DJB software tends to be fairly solid, too, although it's not a kernel.

      --
      "First they came for the slanderers and i said nothing."
    17. Re:what a waste of article by e**(i+pi)-1 · · Score: 1

      I'm pretty happy with the Linux kernel and XNU for OSX. I would consider them rock solid. As for Video editing software, I find that Final cut is rock solid. Its so cool to complain and tear down. Maybe we more to listen to folks who have really built substantial things like a Ubilos or Torwalds. Yes, the new kids like Go and Rust might some day grow up but they still have first to show that can deliver and enable to build great things. And what does your comment about installing updates have to do with anything?

    18. Re:what a waste of article by johannesg · · Score: 1

      How many rock solid kernels, games or video editing suites are you aware of? I'm aware of zero. Do you not install your updates?

      How many updates are required because of coding errors that would be caught by a language? And how many are outright logic errors that would occur in any language? Without that information we can only speculate that better languages would produce better software.

      Besides, is software actually bad? This is a serious question: is software really in a state of crisis? My machine hasn't crashed in years (it is running Windows 7), I have an occasional crashing application - mostly games, but Visual Studio (the editor, not the compiler) will occasionally hang indefinitely (usually after doing too many renames in the IDE, or when using F12 to jump to a declaration).

      Visual Studio, just for the record, is written in one of those safe, managed languages and runs in a safe, managed environment (https://www.quora.com/As-of-2015-how-much-of-Microsoft-Visual-Studio-is-written-in-managed-code) - so it's not a magic bullet after all, then. And 'hanging after too many renames' sure sounds like a creeping resource loss of the kind we were not supposed to have in a managed language.

      Now, tell me that _your_ completely incompatible language with just one compiler, one vendor (who changes the language every three months and has a bad track record of supporting its own products), and just about zero library and tool support is so much better...

      "But my crappy language can actually call C libraries!" Great for you kid. Might as well write C all the way then...

    19. Re:what a waste of article by mccalli · · Score: 1

      I agree with you - I think chasing 'rock solid software' is fools gold. I've been coding both privately and professionally for more than 30 years now, running teams of coders as well. There's always some magic bullet proffered - it's Lisp, or Rust, or....whatever. I inherently disbelieve these "it will all be solved if we just move to language/methodology x!' ideas.

    20. Re:what a waste of article by Anonymous Coward · · Score: 0

      MS-DOS... Kernel.

      Does MS-DOS had a kernel at the end? Isn't just a library as software drivers for applications? Are you talking about the "terminate stay resident"?

      (Disclaimer: my last MS-DOS project was using MS-DOS 3.11, I was using C.)

    21. Re:what a waste of article by Anonymous Coward · · Score: 0

      > Pretty sure MS-DOS 5.0 was rock-solid enough.

      Sure, but that's a different set of expectations. A huge nest of the Java bugs are issues that allow you to escape the Java interpreter and potentially execute opcodes on the chip. That's any compiled language's starting position. MS-DOS runs in real mode- every application has kernel permissions, total privilege, you can patch the DOS system calls on the fly, vector any interrupt, etc. A protected mode OS would view any of that as a crippling bug- that's more powerful than root, in the general case.

    22. Re:what a waste of article by Anonymous Coward · · Score: 0

      Pretty sure MS-DOS 5.0 was rock-solid enough. It only faltered because things running under it had bugs that overwrote random bits - the kernel itself would be stable.

      Here are some known MS-DOS bugs in 5.0 and later (the last one is amusing in its own way):

      * DriveSpace (DoubleSpace, a.k.a. what was intended to compete against Stacker) bugs in anything earlier than 6.20: https://en.wikipedia.org/wiki/DriveSpace#Bugs_and_data_loss
      * FDISK bugs of several types across several versions: http://www.msfn.org/board/topic/159631-testing-ms-dos-limitations/
      * SCANDISK bugs in 6.20 and earlier (Cirrus Logic IDE controllers, when used with VERIFY=ON, resulted in erased drives): http://www.mail-archive.com/survpc@softcon.com/msg01557.html
      * INT 21h AH=30h (Get MS-DOS Version function) bug: returns AL=$06 AH=$14 (i.e. 6.20) on 6.21 -- fixed in 6.22 (AL=$06, AH=$16): http://spike.scu.edu.au/~barry/interrupts.html#ah30

    23. Re:what a waste of article by Anonymous Coward · · Score: 0

      You should seek a refund for your operating systems course as you are 100% wrong. Operating system doesn't imply protection (that is a feature and not a defining characteristic).

      Funny, in the Operating Systems class I took, we used Tanenbaum's Modern Operating Systems, 3rd Ed. where the introduction says:

      "Most computers have two modes of operation: kernel mode and user mode. The operating system is the most fundamental piece of software and runs in kernel mode (also called supervisor mode)."

    24. Re:what a waste of article by Anonymous Coward · · Score: 0

      Nitpick: only the seL4 variant of L4 has been verified against spec.

    25. Re:what a waste of article by Waccoon · · Score: 1

      I suppose there's always TeX.

  10. Software isn't enough, hardware must change by Required+Snark · · Score: 4, Interesting
    Back in the early days of computers, when the world had many hardware architectures, there were machines that had co-designed hardware and software. They were designed from the ground up to avoid certain types of problems, and they worked really well.

    Burroughs Large System stack machines were one example and Symbolics Lisp Machines were another. Burroughs had array descriptors that did bounds checking at run time and tagged memory. Tagging added non-user accessible bits to each memory word. The tag defined what kind of data the word contained and the hardware detected any attempt to use a memory value illegally. Symbolics machines also had tag bits, but their implementation was microcoded, so the tag interpretation was also in microcode.

    Until computer implementations include features like tagged memory and hardware array bounds checking they will never be truly secure. Some problems cannot be addressed by an isolated software layer: they can only be made secure by hardware enforcement of fundamental features that prohibit some classes of software errors.

    --
    Why is Snark Required?
  11. This is why everyone uses ADA now... by Anonymous Coward · · Score: 0

    I remember someone proposing my team use ADA to avoid issues with different coding styles because we were bringing together a new team members and they couldn't agree on what C and java should look like...

    That person went from hero to zero in a day, though I am certain he is a senior architect now, in fact... sigh.

    1. Re:This is why everyone uses ADA now... by Tablizer · · Score: 1

      Using Ada added about 40% to bidders costs such that such orgs kept losing out to bids from more common languages. As I mentioned elsewhere, most orgs simply don't want to pay extra for quality.

  12. I call Betteridge's law by Anonymous Coward · · Score: 0

    Also, 20 years of Java have already proven that while putting heavy gloves on a programmer and locking him up in a padded cell may keep him from causing segfaults, it doesn't cause him to know his arse from his elbow.

    1. Re:I call Betteridge's law by mccalli · · Score: 1

      Which isn't the same thing. I can write insecure genius works of art, and utterly secure piece of useless junk. The functionality of the program isn't what's being questioned here, it's the methods of constructing it.

    2. Re:I call Betteridge's law by Anonymous Coward · · Score: 0

      Are you seriously arguing that the correctness of a program is orthogonal to its "security"? You'll note that a correct program is necessarily secure in having no behaviours outside its specification.

    3. Re: I call Betteridge's law by Anonymous Coward · · Score: 0

      if anything Java has enshrined bad (as in convoluted) coding practices and made corporate software development a painstaken process.

      No other language is known for its stack traces alone.

    4. Re: I call Betteridge's law by Anonymous Coward · · Score: 0

      Oh quite. Java is the language that gave us complexity smearing. It's the language where programmers consciously make their programs do less by adding more code.

      *spit*

    5. Re:I call Betteridge's law by Anonymous Coward · · Score: 0

      Uh... the specification might be (and in fact for a lot of complex things probably is) crawling with security holes.
      Not that I think you are wrong in principle, but defining "correct" as "following the spec" seems a rather laughable view of reality.

    6. Re:I call Betteridge's law by Anonymous Coward · · Score: 0

      What other definition would you suggest, given that you proffer none? Moreover, how would a program written in e.g. Java and conforming to an equally broken (i.e. "in potentia") spec, be any more secure?

      You're crawling your way towards the core of the issue: that "secure languages" can only exclude subclasses of security problems (e.g. RCE via buffer overflow), but not ones that follow from e.g. a specification that doesn't ensure security. That's to say: neither Java, Ada, or Rust can enforce a regime on the programmer that would prevent the programmer from implementing an insecure spec. Furthermore, all of those three languages are prone to shifting pointer bugs to reference bugs, or explicitly undefined behaviour (i.e. _ -> panic!("not defined for what-not")); which goes back to my original point of not making the programmer any better.

    7. Re:I call Betteridge's law by Cederic · · Score: 1

      No, he's not. He's saying it's possible to create an entirely secure piece of software that's utterly fucking useless, and that it's possible to create a seriously awesome piece of software that transcends mere concepts like 'executing properly' without it needing to be secure.

      You'll note that a correct program is necessarily secure in having no behaviours outside its specification.

      Ok, write up the specification, in full.

      When you're done we'll show you how much money your main competitor has made with their shitty implementation in the meantime, the three open source tools that replicate the key functionality and the two new industries that have been built up in response.

      The market's already assessed 'secure' versus 'functional' and the decision remains a continuum between the two.

      Or as I tell the fuckwits working in Infosec at my employer, if they want it secure I can hit the shiny red button in the data centre and shut the lot down.

      No? Ok, you don't want secure, you want a compromise. Now we can discuss it.

    8. Re: I call Betteridge's law by Cederic · · Score: 1

      Yeah, stack traces are so much worse than core dumps or a complete absence of information regarding system failure.

      Shit, Java has many flaws but the average corporate software developer has many more, and at least Java protects you from several of them.

    9. Re: I call Betteridge's law by Anonymous Coward · · Score: 0

      But, core dumps do provide stack traces. By definition a core dump contains the whole program image at the moment it crashed.

    10. Re:I call Betteridge's law by Anonymous Coward · · Score: 0

      >Ok, write up the specification, in full.

      There's nothing about spec-driven development that requires the waterfall model, which you appear to be alluding to.

      Rather, the spec (much as the test suites and the implementation which are derived from it) is an evolving document. As such, various security proofs (e.g. absence of denial of service, cyclical dependency between threads, and so forth) evolve with the specification. This is vastly superior to the spec existing only in an implicit form, and its security proofs being mostly a matter of wishful thinking and tool-reliance in the heads of its idiot implementors.

      What you call the "market-accepted" product is a prototype, or more often an overgrown proof-of-concept; and no language or tool will make it either safe, correct, or such that it could be specified afterward. This is not a fault of software, or of the use of "imperfect" programming languages: even if the bleeding-edge prototype were written in Java or Ada or Rust, it'd still exhibit flaws from being a fucking hack.

    11. Re:I call Betteridge's law by Anonymous Coward · · Score: 0

      Then there are the: "Best Practices", infosec admins who maintain this mysterious list of "Best Practices", but aren't willing to share.

      "Set up the system, per spec."

      "I need you to tell me the exact configuration."

      Sends configuration.

      "Nope, that's not part of our best practices".

      --Repeat--

  13. Executes more code but runs faster ? by perpenso · · Score: 1

    Let's move towards writing system code in better languages, first of all -- this should improve security and speed.

    There ain't no such thing as free memory checking. It takes extra code and therefore takes extra time.

    Plus the memory-unsafe premise is BS. There is nothing preventing a programmer from adding their own memory checking in such languages.

    1. Re:Executes more code but runs faster ? by rew · · Score: 1

      The "better" counter to the original argument is that not all bugs are memory overruns.

      Back in the early nineties I was reading the manual page for the daemon that would send a message to a terminal when a mail message came in. I concluded, from the "published specs" that I could trick it to do "nasty" things. And that turned out to work.

      This is an example where no overrun, just the published actions of a program lead to a security issue.

    2. Re:Executes more code but runs faster ? by Anonymous Coward · · Score: 2, Interesting

      There is nothing preventing a programmer from adding their own memory checking in such languages.

      Sure there is: ignorance and laziness.

      One of the problems is that programmers generally view PEBKAC as a "get out of jail free" card. Once a problem is diagnosed as PEBKAC, they wash their hands of it and say "not my problem". But ask any UX expert, and they will disagree with this - if a user is having problems with a computer system, it's the computer system's fault (or at least an opportunity for the computer system to be better). Heck, ask any *security* expert about it. You can't just ignore issues because the user did something they shouldn't have -- especially when the line between incompetence and malice is oh so easy to cross.

      But guess what: compilers are programs too, and programmers are users of the compilers. Everything about best practices in making interfaces for end user software also applies to the interfaces to programmers' software. And there is no bigger interface to a compiler than the actual language itself.

      Let's face it: "you're holding it wrong" is a fucking lousy excuse. Not for one minute would we tolerate a word processing program where the program crashes when you save a file to a USB drive unless you click Edit->Preferences->"Enable USB interface subsystem" first. Or one where saving a file had a 10% chance of failing, and you had to go to About->"Error Messages" to double check whether you saved successfully or you have saved a completely corrupted copy.

      While programmers may be smarter than the average bear, that doesn't mean they're smart in an absolute sense. There are plenty of stupid programmers out there, and, sorry to be blunt, Dunning-Kruger means that you're probably one of them.

    3. Re:Executes more code but runs faster ? by Anonymous+Brave+Guy · · Score: 1

      There ain't no such thing as free memory checking. It takes extra code and therefore takes extra time.

      It wasn't clear to me whether the author meant run-time speed or development speed. Certainly better languages and tools can make a big difference to the latter.

      It's also quite possible for better languages to generate run-time code that is more efficient. The more semantic information about programmer intent, restrictions and guarantees can be encoded using the language, the more scope there is for optimisers to produce better output.

      Plus the memory-unsafe premise is BS. There is nothing preventing a programmer from adding their own memory checking in such languages.

      But that only matters if programmers do add their own checks. Evidently in reality most do not.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    4. Re:Executes more code but runs faster ? by perpenso · · Score: 1

      But that only matters if programmers do add their own checks. Evidently in reality most do not.

      And therefore the idea that the problem is some programmers not the language, the craftsman not the tool.

    5. Re:Executes more code but runs faster ? by ultranova · · Score: 1

      But that only matters if programmers do add their own checks. Evidently in reality most do not.

      And therefore the idea that the problem is some programmers not the language, the craftsman not the tool.

      If a tool doesn't fit my hand, it's a bad tool. If a tool doesn't fit human intuition and tendencies, it's a bad tool. Tools are here to assist humans, not the other way around, and have no inherent value of their own, just their utility, thus any mismatch between a tool and a user is a problem with the tool, especially when "user" is actually "most users".

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    6. Re:Executes more code but runs faster ? by Anonymous+Brave+Guy · · Score: 1

      Perhaps, but when close to 100% of a population have the same trait, arguments that the trait should be changed rather than designing tools and processes that accommodate that trait are unrealistic and therefore not very useful.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    7. Re:Executes more code but runs faster ? by Cederic · · Score: 1

      There are plenty of stupid programmers out there, and, sorry to be blunt, Dunning-Kruger means that you're probably one of them.

      Nope, I've been saved from that by the Peter Principle.

    8. Re:Executes more code but runs faster ? by perpenso · · Score: 1

      But that only matters if programmers do add their own checks. Evidently in reality most do not.

      And therefore the idea that the problem is some programmers not the language, the craftsman not the tool.

      If a tool doesn't fit my hand, it's a bad tool. If a tool doesn't fit human intuition and tendencies, it's a bad tool. Tools are here to assist humans, not the other way around, and have no inherent value of their own, just their utility, thus any mismatch between a tool and a user is a problem with the tool, especially when "user" is actually "most users".

      However in this case we have a tool that has proven itself over decades of use by knowledgable and skilled craftsman. A tool that can do any sort of memory checking the craftsman wishes it to, any sort of checking the "training wheels" languages do.

    9. Re:Executes more code but runs faster ? by perpenso · · Score: 1

      Perhaps, but when close to 100% of a population have the same trait, arguments that the trait should be changed rather than designing tools and processes that accommodate that trait are unrealistic and therefore not very useful.

      What trait? A lack of knowledge and skill? A need for "training wheels"?

      Don't misunderstand me. I have nothing against a modern language, I switched from Objective-C to Swift for iOS/macOS user interface coding. What I am arguing is that languages like C/C++ are not bad nor flawed as originally suggested. As another poster wrote, "Bjarne said it best", check out his post:

      https://developers.slashdot.or...

    10. Re:Executes more code but runs faster ? by Megol · · Score: 1

      And there's nothing preventing a programmer from doing it in a buggy way or accidentally forget to insert checking code. Programmers are humans, humans make errors.

      While memory checking isn't free the impact in use may surprise you - compile time optimization can remove most checks.

    11. Re:Executes more code but runs faster ? by gweihir · · Score: 1

      Plus the memory-unsafe premise is BS. There is nothing preventing a programmer from adding their own memory checking in such languages.

      And coding carefully in risky places. And using a memory-debugger. And using a code scanner. In the end, it turns out that the language used matters very little for the security of the code, but the skill of the coder is everything.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    12. Re:Executes more code but runs faster ? by perpenso · · Score: 1

      Judicious use of C++ features can automate much of the checking to avoid forgetting.

    13. Re:Executes more code but runs faster ? by ZenShadow · · Score: 1

      I always think of guitars when people bring this up.

      Walk into a guitar store and observe for a while. You'll see a lot of people pick up that $50 monstrosity that sounds like crap. It sounds like crap for all of them. Some of them pick up the $3000 guitar and it sounds okay, so they take it home.

      Then the guy who actually knows how to play walks in, picks up that $50 guitar and makes it sound amazing -- and far better than anything you previously heard out of the $3000 models.

      Moral of the story: the tool can't solve everything.

      --
      -- sigs cause cancer.
    14. Re:Executes more code but runs faster ? by Anonymous+Brave+Guy · · Score: 1

      No-one has the knowledge and skills to write 100% correct programs in general without help. You don't. I don't. No-one does. It is simply beyond human capabilities, because we make mistakes. Arguing for a world that is based on unrealistic assumptions is futile. Better, IMHO, to argue for how to improve the world we actually have.

      To that end, my position is still that C is a needlessly weak and dangerous programming language by modern standards, and as evidence, I cite once again the fact that so many system programs written in C have had serious bugs that could have been prevented in a safer language.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    15. Re:Executes more code but runs faster ? by perpenso · · Score: 1

      No-one has the knowledge and skills to write 100% correct programs in general without help. You don't. I don't. No-one does. It is simply beyond human capabilities, because we make mistakes. Arguing for a world that is based on unrealistic assumptions is futile. Better, IMHO, to argue for how to improve the world we actually have.

      To that end, my position is still that C is a needlessly weak and dangerous programming language by modern standards, and as evidence, I cite once again the fact that so many system programs written in C have had serious bugs that could have been prevented in a safer language.

      I agree with you to a degree, but I see the other "memory unsafe" language as the best solution, C++. Judicious use of C++ capabilities goes a long way to addressing C's shortcomings. I now use a modern "memory safe" language for iOS and macOS user interface programming, Swift. I would probably only use C in a RAM constrained embedded arduino sort-of environment to reduce library footprint. And I use Java for Android user interface programming and Amazon Web Services programming, although C++ may be mature enough for the later now.

      Having a bit of experience with this range modern/legacy safe/unsafe languages I see only one real advantage to the modern languages. The increasing number of amateurs developing software, from the perspective of an Apple Inc providing a language with training wheels is a great idea. However for the knowledgable and experienced a language like C++ is probably superior and with a little programmer care memory can be handled safely.

    16. Re:Executes more code but runs faster ? by JesseMcDonald · · Score: 1

      However in this case we have a tool that has proven itself over decades of use by knowledgable and skilled craftsman. A tool that can do any sort of memory checking the craftsman wishes it to, any sort of checking the "training wheels" languages do.

      Sure, provided the craftsman writes verbose boilerplate code to accomplish simple tasks that other languages handle automatically—and manages to do so without introducing additional errors in the boilerplate. (More code equal more bugs.)

      A tool that needlessly requires more skill and effort to accomplish the same result, without a corresponding increase in utility / expressiveness, is also a bad tool.

      --
      "The state is that great fiction by which everyone tries to live at the expense of everyone else." - Bastiat
    17. Re:Executes more code but runs faster ? by david_thornley · · Score: 1

      Really? Despite knowing what I'm doing and being very experienced, I mistype and produce something like "if (a=b)" maybe once every two years or so. (For people not familiar with C, that means assigning the value of b to a and taking the "true" branch if a evaluates to true. This should not be confused with a comparison of a to b.) I'm sufficiently egotistical to believe that, if I'm not perfect, not many people are.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    18. Re:Executes more code but runs faster ? by Anonymous+Brave+Guy · · Score: 1

      For memory safety issues, I agree that C++ offers better tools than C. The RAII idiom alone is surely worth many bug fixes.

      Unfortunately C++ still suffers from many of the same weaknesses as C in other areas, but as you didn't raise those yourself I'm not sure they're on-topic for this subthread.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    19. Re:Executes more code but runs faster ? by perpenso · · Score: 1

      No verbose boiler plate code needed when using C++. And there is an increase in utility and expressiveness.

    20. Re:Executes more code but runs faster ? by gweihir · · Score: 1

      Really. Things like assignment instead of comparison is something a reasonably modern C-compiler warns you with high warning settings. And you should definitely use these settings (in fact you should use -Wall or the equivalent), at least when finishing up. And you should fix all warnings:

        #> x.c:6:3: warning: suggest parentheses around assignment used as truth value [-Wparentheses]

      Of course, you may want the assignment, so the compiler just asks you to use the slightly more elaborate stance "if ((a=b))" to signal that. This is not the coding dark ages where a C compiler was unable to find such potential problems.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    21. Re:Executes more code but runs faster ? by david_thornley · · Score: 1

      Oh, agreed. My point is that the language implementation matters, and that depends partly on the language. Careful coding goes only so far, and typos are easy to make and miss.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  14. An article about langsec on /. ... by Anonymous Coward · · Score: 0

    And no one will understand it.

  15. Don't forget all that legacy code. by Larsen+E+Whipsnade · · Score: 1

    The reason unsafe, unmaintainable cruft sticks around is that all these people coming up with new languages don't think to provide a migration path. What's needed:

    1. An interface to existing C code, so we don't have to convert all at once. Okay, that one they usually provide. But...
    2. Ditto for C++ code.
    3. Ditto for Perl 5 code.
    4. Tools to assist in translating from old languages to new. Fully automated translation may be over-optimistic, but we can get halfway there.

    Or...
    1. An improved edition of C/C++ that provides safe pointer features, alternatives to preprocessor, and...
    2. DEPRECATES pointer arithmetic and other language malfeatures with obtrusive compile warnings and such.

    Then we can get rid of all those compile warnings at our leisure.

    If standards bodies don't come through fast enough, let GNU take the initiative.

    1. Re:Don't forget all that legacy code. by Sigma+7 · · Score: 1

      An interface to existing C code

      There really should be some form of universal interface that everyone agrees on, rather than trying to create an interface for each individual language. Maybe it could be called an API, and it could accept parameters in an agreed-upon fashion. Perhaps that would solve the interface problem once and for all.

      An improved edition of C/C++ that provides safe pointer features

      I tried using some of the "safe pointer" stuff - depending on which one is chosen, there is a performance hit depending on which safety mechanism you choose. For example, the auto-deallocate safety net slows things down a lot, while bounds checking tends to be less of a problem.

      Still a good feature (where some compilers already have a limited implementation), although it could use a bit of work since you somehow need a custom library.

      2. DEPRECATES pointer arithmetic and other language malfeatures with obtrusive compile warnings and such.

      In some cases, the programmer requires speed. If said programmer knows what they're doing, there's no reason they should be separated from optimal flow.

    2. Re:Don't forget all that legacy code. by The+Evil+Atheist · · Score: 1

      I tried using some of the "safe pointer" stuff - depending on which one is chosen, there is a performance hit depending on which safety mechanism you choose. For example, the auto-deallocate safety net slows things down a lot, while bounds checking tends to be less of a problem.

      With shared_ptr, the performance hit is with the reference count updating, so you should still pass a shared_ptr as a reference when possible.

      With unique_ptr and the std containers (of movable types), I can't imagine the auto-deallocation would cost any more than manual deallocation in C since they are really just the equivalent of one manual deallocation call.

      --
      Those who do not learn from commit history are doomed to regress it.
    3. Re:Don't forget all that legacy code. by ChrisMaple · · Score: 1

      | grep -i -v warning

      --
      Contribute to civilization: ari.aynrand.org/donate
    4. Re:Don't forget all that legacy code. by Sigma+7 · · Score: 1

      With shared_ptr, the performance hit is with the reference count updating, so you should still pass a shared_ptr as a reference when possible.

      In my case, it had a significant cost beyond the reference count, because it got included in a data structure. shared_ptr has a destructor, which forces any struct or class containing it to likewise have a destructor. What would originally be a simple bulk deallocation now requires calling ~2 destructors per entry (one from the main object, one from shared_ptr).

      shared_ptr also requires a thread-safe reference count, which is a slowdown in itself.

      I'm certain you can avoid most of the slowdown with shared_ptr if you already know what can happen, but there's still a developer who uses it without knowing what will happen ahead of time.

    5. Re:Don't forget all that legacy code. by The+Evil+Atheist · · Score: 1

      What would originally be a simple bulk deallocation now requires calling ~2 destructors per entry (one from the main object, one from shared_ptr).

      But what was the actual cost of the main object constructor? All it has to do is call the shared_ptr destructor. Did the compiler not optimize it away enough?

      And by bulk deallocation, how would that have been possible if you didn't use manual deallocation for each object in turn anyway? Would you have implemented the struct with the data embedded in the object, without an extra indirection? Or maybe put that data in its own vector/array, as is common in graphics/games programming? If so, they should have done that whether or not there was shared_ptr. It sounded like more thought needed to be given to the data design, rather than the fault of managed memory.

      shared_ptr also requires a thread-safe reference count, which is a slowdown in itself.

      Assuming an inherently multithreaded process, if you are sharing ownership of an object amongst threads, you would want reference counts to be atomic. If ownership is not shared - you shouldn't be using a shared_ptr.

      I'm certain you can avoid most of the slowdown with shared_ptr if you already know what can happen, but there's still a developer who uses it without knowing what will happen ahead of time.

      It sounds like the problems started out with an ignorance of data design and the purpose of shared_ptrs (ie, declare shared ownership rather than a catch all for Java-like allocation of objects).

      --
      Those who do not learn from commit history are doomed to regress it.
    6. Re:Don't forget all that legacy code. by david_thornley · · Score: 1

      In other words, you want to add more compiler warnings to C++. C++ has safe pointer features, a preprocessor alternative, and a lot of other improvements. It still suffers from some syntactic things like "if (a=b)" and "Foo foo();", but we can provide compiler warnings for those.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    7. Re:Don't forget all that legacy code. by david_thornley · · Score: 1

      std::shared_ptr does have performance problems. Updating the counts can screw up cache coherency, and needs to be thread-safe, which can cut performance further. I don't know enough about modern mark-and-sweep garbage collection to provide comparisons, except that modern garbage collection deals only with memory and C++'s RAII idiom uniformly handles all allocation and deallocation.

      Why is calling two destructors so bad? You're going to want all those lower-level destructors called somehow, and you're going to have to write code to do it. Is it any more of a performance issue to put that code in the container's destructor?

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    8. Re:Don't forget all that legacy code. by david_thornley · · Score: 1

      1. An interface to existing C code, so we don't have to convert all at once. Okay, that one they usually provide. But...

      Approximately everything has interfaces to existing C code, since C tends to have very stable ABIs on various platforms. The C ABI is often used as a lingua franca.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    9. Re:Don't forget all that legacy code. by Sigma+7 · · Score: 1

      Two destructors is slow compared to zero constructors.

      If you don't have destructors to call, you can erase an entire array of elements in one fast function call. If your data structure needs a destructor, then it is called for each individual element.

      Also related are constructors - if you can get by with zero constructors as opposed to one, you don't have to worry about time spent initializing the entire set of elements (as long as you remember not to use uninitialized variables.)

  16. Partially a load of garbage by thegarbz · · Score: 1

    Bugs in code are not a given, they are only a given for a certain complexity of software created with certain competence with a certain requirement of perfection. The only ways around this is to control the above variables, so this does have some merit. For instance in the process industry when programming safety systems you don't assume perfect competence of the programmer, so you present to them a limited language made of pre-vetted function blocks to limit the amount of damage they can do.

    However whenever you limit any damage you likewise limit any usefulness. You can't write all software this way.

  17. I miss BASIC by Anonymous Coward · · Score: 0

    Good old BASIC with line numbers and GOTO statements. That's a man's programming language.

  18. Memory-unsafe is a BS meme by perpenso · · Score: 1, Interesting

    This meme, that certain languages are memory unsafe, is BS. The programmer is free to add all the memory checking that a so-called memory safe language automatically inserts. However the programmer using the "unsafe" language is free to use knowledge unavailable to the compiler to decide when and when not to perform such checks.

    Furthermore the suggestion that memory-safe languages are faster is bogus. You don't get faster by automatically generating more code.

    These memory-safe languages are only more of a necessity for apps written by amateurs. Less of a necessity, and more a convenience, for system software and more important apps written by the knowledgable and experienced.

    1. Re:Memory-unsafe is a BS meme by Joce640k · · Score: 2

      True, but the effort required to do it in (eg.) C is ridiculous. You can't really expect anybody to do it.

      Other languages can do it a lot more easily, eg. C++. Range checking for things like std::vector is turned on by default in recent compilers.

      ie. "array[-1] = 0x666;" will throw an exception, just like in Java.

      You can go outside the box and start using raw pointers in C++ but it's not something you need to do, or should be doing very often.

      And *this* is why Linus Torvalds is an idiot with all his anti-C++ rants and "we only use C here" mentality.

      --
      No sig today...
    2. Re:Memory-unsafe is a BS meme by perpenso · · Score: 1

      As someone who spent a lot of time writing assembly language back in the day I understand the "we only use C here" mentality. Its only one small step from assembly language, which is what C was intended to be. I still have an urge to go to the bare metal (assembly), but its just not worth the time anymore.

      I also understand caution with C++. Its features can be overused to the point of gross inefficiency and/or a lack of clarity in the code. However with highly curated source code like the Linux kernel that seems to be a red herring. Submissions with improper use of C++ could easily be rejected, as is done with other coding standard violations.

    3. Re:Memory-unsafe is a BS meme by Anonymous Coward · · Score: 0

      With your specific example most C compilers will generate compile time warnings.

      And *this* is why Linus Torvalds is an idiot with all his anti-C++ rants and "we only use C here" mentality.

      Linus is far from an idiot. A lot of his success comes from his firm stance on certain subjects.
      C++ is not nearly as portable as some people want to believe and it is a lot easier to write unmaintainable code in C++ by wrapping things in abstractions.

      But hey, I guess someone can prove my wrong by writing a better kernel in C++.

    4. Re:Memory-unsafe is a BS meme by F.Ultra · · Score: 1

      And sometimes when talking directly to hardware, array[-1] is exactly what is needed. Of course for the majority of software that will never be the use case so it would be nice to have warnings for such things and thankfully there are static source code checkers that does exactly this. http://cppcheck.sourceforge.ne... for example would warn about "out of bounds" for this very code.

    5. Re:Memory-unsafe is a BS meme by The+Evil+Atheist · · Score: 2

      And yet, the compiler that Linux uses is now written in... C++ and in the process of converting C style code into C++ style where it makes sense. Because the C code was too unwieldy. Linus wrote his original dive log program in C + GTK, and then was forced to switch to Qt because GTK's attempt at OO made everything unmaintainable.

      LLVM and Clang are written in C++ also.

      Wrapping things in abstractions is necessary and is done in the Linux kernel all the time with macros, which are less maintainable and more impenetrable than templates. There certainly are things in the kernel that would benefit from being templated rather than macro'd.

      --
      Those who do not learn from commit history are doomed to regress it.
    6. Re:Memory-unsafe is a BS meme by Joce640k · · Score: 1

      You can argue the toss over templates, etc. Yes they can be overused.

      OTOH there's no valid excuse for not using std::containers, std::string and smart pointers.

      None.

      --
      No sig today...
    7. Re:Memory-unsafe is a BS meme by Joce640k · · Score: 1

      With your specific example most C compilers will generate compile time warnings.

      Visual C++ doesn't.

      --
      No sig today...
    8. Re:Memory-unsafe is a BS meme by Joce640k · · Score: 1

      But hey, I guess someone can prove my wrong by writing a better kernel in C++.

      Somebody certainly could write a better kernel in C++, yes. There's absolutely no doubt about that.

      Am I personally going to do it just to prove an AC wrong on Slashdot? No.

      Grow up and get a proper argument.

      --
      No sig today...
    9. Re:Memory-unsafe is a BS meme by Anonymous Coward · · Score: 0

      The kernel, and lost of other linux software is written in C. Not java, not even C++, but C. It is fast because of little abstraction overhead. It is good because people have taken the time to get it right. Plain C is not 'hard'. Avoiding stray pointers or the overrunning of unchecked array boundaries, is not particularly tricky.

      The rule is simple: stability trumps other concerns. So stability is more important than performance. (Not a problem with C - you get your performance after thorough testing and you take bug reports seriously.) And stability trumps deadlines! Not that there are deadlines in open source anyway. Miss a merge window 'deadline' and your feature simply does not go in this time. Whoever wants that feature waits another kernel release.

      The problem is not with C. It is with the way commercial development happens - short deadlines and little staff. No time to think about things - do the loop go to n or n-1? (one too much/too little is the most common programming error - but so easily avoided - even with plain C. Just use your head!). Stability don't trump deadlines, so you can't act on _every_ sane bug report. So they try using some language that disallow a few of the bugs you can have in C. And the price is lower performance, you still get bugs albeit of a different nature. And sometimes C-like bugs anyway, in the libraries you use. Libraries your no-C programmers aren't competent to debug and can't fix anyway because theyr'e not open source. Library vendor is just like your sw shop in that they don't fix every bug and think deadlines are more important. But who really cares about 'new version number delivered on time' if the new version don't deliver? Only dumbasses who think the number itself is important. Which they think because they can't look into the commercial sw anyway,

    10. Re:Memory-unsafe is a BS meme by Anonymous Coward · · Score: 0

      I must reply that to understand and appreciate your point, you really need to know what is a program. Dont ask amateurs ** how ** compiled/deployed code working. They just throw if and loops 10 lines of code at the time until its "finished".

      Amateurs dont even know these things and delivers simplistic naive texts that appear to work at least once while coding.

      If they use frameworks they just dont try to understand the intention behind the framework authors. Dont know the assembly produce by there code and dont know moderns software patterns at the other end.

      There day to dat behavior is to feed there clipboard with little recipes of code from Stack Overflow without even exploring the context of questions.

    11. Re:Memory-unsafe is a BS meme by 19thNervousBreakdown · · Score: 1

      Range checking for things like std::vector is turned on by default in recent compilers.

      ie. "array[-1] = 0x666;" will throw an exception, just like in Java.

      This is absolutely wrong, and would violate the C++ standard if it wasn't. http://en.cppreference.com/w/cpp/container/array/operator_at

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
    12. Re:Memory-unsafe is a BS meme by Thiez · · Score: 1

      And sometimes when talking directly to hardware, array[-1] is exactly what is needed.

      And if that index would be 'out of bounds' for the object as the C abstract machine understands it, that's UB, and an optimizing compiler can do very unexpected things.

    13. Re:Memory-unsafe is a BS meme by F.Ultra · · Score: 1

      Of course, which is why there is always some nice rant to be found on LKML from Linus about the GCC developers :)

    14. Re: Memory-unsafe is a BS meme by Anonymous Coward · · Score: 0

      Amount of staff is not the problem. Bad architecture requires a lot of staff while good one gives you results with a few. But you should still hire ux expert.

    15. Re:Memory-unsafe is a BS meme by Anonymous Coward · · Score: 0

      Well, except for cleaner, easier to understand code of course, dependency on C++ libraries and in the case of 'smart' pointers, runtime performance. Otherwise indeed, no valid excuse at all.

    16. Re:Memory-unsafe is a BS meme by Anonymous Coward · · Score: 0

      C++ is too big (as a language spec) for an open source project. Linus is 100% right in that regard. C++ is a fine language (I use it daily) but you *need* to have some sort of stylebook to decide which parts of C++ you are going to use or only C++ gurus will be able to read the code. This is fine in a setting where you have a (smallish) professional team working on a project. For an open source project with 1000s of contributors not so much. For an open source project your stylebook *must* be something like : "no-tabs, curly braces on a separate line. Please use bulgarian notation. The end." Anything longer will be ignored.

      It's very easy to shoot yourself in the foot using C, that's true. But at least it is quite obvious when somebody does that. C++ can be so baroque that the foot-shooting can get hidden behind layers of layers of abstraction.

      p.s. Calling someone who is obviously very skilled at what he does ( linus torvalds, bill gates, elon musk, jeff bezos) is not really a sign of expertise.

    17. Re:Memory-unsafe is a BS meme by Grishnakh · · Score: 1

      Oh, bullshit. std::string is a terrible library that is horribly lacking in features. Qt's QString blows it away in every way.

      Honestly, IMO, C++ with the standard library is simply a terrible language that should never be used at all. It's a good language when used with a great library/toolkit like Qt, but only then.

  19. Formal verification is worthless IRL. by rew · · Score: 2

    When you write a program that needs to print the primes up to a certain number, you can easily create a formal proof that your program program is correct.

    But when your program is say "apache", that needs to interact with many different browsers on one side, and interpret PHP scripts that interact with databases, this formal proof becomes impossible. Similarly, you cannot write a formal spec for the interaction with the user in for example, a web browser.

    Even though both examples I put forward today (web server and web browser) didn't exist back then, I've held this opinion for thirty years (spring 1987).

    1. Re:Formal verification is worthless IRL. by Halo1 · · Score: 4, Informative

      When you write a program that needs to print the primes up to a certain number, you can easily create a formal proof that your program program is correct.

      But when your program is say "apache", that needs to interact with many different browsers on one side, and interpret PHP scripts that interact with databases, this formal proof becomes impossible. Similarly, you cannot write a formal spec for the interaction with the user in for example, a web browser.

      While things like the halting problem obviously prevent fully formally proving the correctness of programs, you can go much farther than we generally go today. For example, I participated in an EU project where they constructed a formal model of the PikeOS separation kernel (kind of like an embedded real-time hypervisor). They also generalised this model, which includes support for things like interrupts and context switches.

      --
      Donate free food here
    2. Re:Formal verification is worthless IRL. by Anonymous Coward · · Score: 0

      While things like the halting problem obviously prevent fully formally proving the correctness of programs

      That statement is a bit inaccurate and misleading. You cannot write a program that formally proves the correctness of *any* input program, but you can certainly write a program that formally proves the correctness of all practical programs you throw at it and does so fully automatically, by the same token as you can write a higher-order theorem prover that proves many interesting theorems even though higher order logic with standard models is not complete. The problem is rather that an input language that provides enough information that is needed for formal verification to work would be considered very impractical by most programmers as a general purpose language.

    3. Re:Formal verification is worthless IRL. by Cederic · · Score: 1

      constructed a formal model of the PikeOS separation kernel

      How long did this take? Did it actually add any value? Would it have been quicker to just rewrite PikeOS? Were the people involved recruited in India and brought into the country on a dodgy visa scheme?

      Sorry, just trying to translate this to the real world.

    4. Re:Formal verification is worthless IRL. by Megol · · Score: 1

      Doing a rewrite would be stupid because it wouldn't provide any additional value? If anything it would generate something with less value as the number of bugs caught in testing/use would be less than the stable operating system.

    5. Re:Formal verification is worthless IRL. by Cederic · · Score: 1

      Without knowing the software or its quality, it's hard to say. Taking the general case though, yes, you're right.

      But you're merely adding even more reality into the conversation.

    6. Re:Formal verification is worthless IRL. by Halo1 · · Score: 1

      constructed a formal model of the PikeOS separation kernel

      How long did this take?

      The EU project lasted 3 years. Before they could model the kernel, the formal modelling guys had to extend their modelling environment. There were two guys from SYSGO (developers of PikeOS) working (very) part-time on this, two senior researchers from universities, and then some graduate students (I don't think more than two).

      Did it actually add any value?

      They found 1.5 bugs in PikeOS with it: 1 real bug, and one theoretical bug that could not occur in practice due to the limitations of the API in which it was found (but it was fixed anyway, since you never know whether someone might want to extend it at some point).

      Additionally, formal modelling is also a requirement for higher levels of certification, which the PikeOS developers want to reach.

      Would it have been quicker to just rewrite PikeOS?

      Which language and what development methodology would automatically have the same results as the existing working product and its associated formal model?

      --
      Donate free food here
    7. Re:Formal verification is worthless IRL. by Cederic · · Score: 1

      I love that people can and do undertake this type of thing. It's good for the development and improvement of the state of the art, continued research is valuable purely as research and I don't really want it to stop.

      It's also so far removed from pragmatic non-academic reality that it's insane. Three years, and found two bugs? Let alone the obvious risks around the complexity, completeness and accuracy of a model that took so long to develop.

      The EAL link is interesting though, hadn't come across that before. I suspect most of the systems I work on would qualify at EAL4 but the cost of demonstrating it would kill their commercial value; we'd discontinue the products rather than waste the money.

      EAL7? Comically that's more likely - but only for key algorithms we develop and use. A whole system? Could take down the company..

    8. Re:Formal verification is worthless IRL. by Halo1 · · Score: 1

      I love that people can and do undertake this type of thing. It's good for the development and improvement of the state of the art, continued research is valuable purely as research and I don't really want it to stop.

      It's also so far removed from pragmatic non-academic reality that it's insane.

      SYSGO is a pretty pragmatic non-academic company that has existed in reality since 1991.

      Three years, and found two bugs?

      Keep in mind that PikeOS was already used in automotive and avionic systems, so it was already rigorously developed and tested. It is indeed quite a testament to the quality of the product.

      Let alone the obvious risks around the complexity, completeness and accuracy of a model that took so long to develop.

      This model was developed exactly because existing models and theories could not be applied to real-life systems such as the PikeOS microkernel. The papers I linked earlier explicitly discuss managing the complexity.

      The EAL link is interesting though, hadn't come across that before.

      I hope you are not working on safety-critical systems then.

      I suspect most of the systems I work on would qualify at EAL4 but the cost of demonstrating it would kill their commercial value; we'd discontinue the products rather than waste the money.

      In the industries where this currently matters, it is the same: you either get your certification (this, or another one depending on the field) or you discontinue the product since you are not allowed to sell it at all (or rather: your prospective customers are not allowed to use it).

      EAL7? Comically that's more likely - but only for key algorithms we develop and use. A whole system? Could take down the company..

      Another part of the project was about formalising the MILS (multiple independent levels of security) architecture, which enables you to compose components certified at different levels (EAL or otherwise) in a way that does not bring everything down to the level of the least certified component.

      And indeed, you will almost never certify an entire system at EAL7.

      --
      Donate free food here
    9. Re:Formal verification is worthless IRL. by Cederic · · Score: 1

      I hope you are not working on safety-critical systems then.

      This is where things get really silly.

      If an aircraft crashes because its software fails, 2-300 people may suffer a negative outcome.

      If systemically important business systems fail, 2-300 million people will suffer a negative outcome, up to and including loss of property, health or even life. (Riots are indiscriminate)

      I work with the latter..

    10. Re:Formal verification is worthless IRL. by Anonymous Coward · · Score: 0

      > I've held this opinion for thirty years (spring 1987).

      I like that you can remember the exact time that you reached enlightenment, like a Super Saiyan :P

    11. Re:Formal verification is worthless IRL. by Tablizer · · Score: 1

      Formal verification is time-consuming, and most companies probably don't want to pay for it.

      A fastidious programmer will get booted for taking too long.

  20. Are TechCrunch Articles Creating Idiocy? by Anonymous Coward · · Score: 0

    Most TechCrunch articles are written by complete idiots who know nothing about what they write. Is it just TechCrunch, or is the entire industry at fault?

  21. I tried this Rust thing by aliquis · · Score: 1

    Got run over by three nekkid guys and shot into pieces.

    Next time I become a slave.

    "Try Rust! It's safe!" they said.

  22. Upgrade to JB weld and bailing wire? by Anonymous Coward · · Score: 0

    Well, that is a couple of steps up from bubble wrap and duct tape.
    (Although there have been some amazing things done with duct tape.)
    But slightly better tools are not the answer.
    The problem is the industry attitude that bugs are expected.

    'Provably correct' software means you have to write s/w in multiple ways and crosscheck.
    Not really a serious alternative for anything except the most basic stuff.
    Automatic test tools which slightly munge correct inputs and see what happens seem more likely to be useful.
    But again very limited.
    Tools that help with the complexity of today's s/w might help a bit.
    Automatic garbage collection is a simple start.
    Breaking things into small managable pieces (see GO) is only superficially helpful.
    It makes it easier to make things with unexpected interactions which are really the bugs to eliminate.

    In the 60 and 70's it was a point of pride for the OS team to take an onslaught of eager young CS students and not 'let them in'.
    A crash or worse, access, due to anything happening in application space was rare.
    S/W is much more complicated now, but this could still be the goal for some basic stuff, like a kernel.
    The tool of the time was the assembler.

    If you are serious about security, you need simpler s/w and an attitude supporting hackers with bug bounties.
    Unfortunately, this is contrary to the business plans of most suppliers.
    With a little lobbying, this makes the products and legal system supporting them go in the reverse direction.
    Unfortunately, this is a path that violates reality.
    It protects us from everybody except the bad guys.

    It apparently also supports folks writing articles about how tools will save the day.
    NUTS

  23. 10% Golang, 90% C api calls by Anonymous Coward · · Score: 0

    I remember writing assembly code thinking this is surely to make the program faster than most other code I've written, until I realized the majority of the program was simply making calls into C API's for the most part, defeating the purpose. Until someone writes and operating system in golang I dont think they will really have the security the think they do.

    Just because you haven't been hacked yet doesn't mean you are secure

    1. Re:10% Golang, 90% C api calls by HornWumpus · · Score: 1

      You're saying a good language should include a profiler?

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
  24. Choice of language doesn't fix stupid decisions by Anonymous Coward · · Score: 1

    How many products ship with a built in back door with a hard coded password? How many products come with a default administrator account enabled and don't require the user to set a new password? How many products ship with no security at all. Memory safe languages can help prevent one class of bug, but they don't make bad programmers into good programmers.

    In fact, the argument could be made that features like memory-safety enable bad programmers to produce bad code that superficially works despite serious design flaws, allowing more bad code to wind up in released products. As long as the finished product superficially works and looks good, it can be sold despite massive defects (just look at the IoT botnet DDOS of Krebs for an example).

  25. Arrogance by Anonymous Coward · · Score: 1

    Far too many programmers think they are better than they are.

    1. Re:Arrogance by Anonymous Coward · · Score: 0

      This is true for everyone except me. My code never breaks.

  26. Yes, absolutely by Tomster · · Score: 1

    The most commonly used languages do absolutely nothing to prevent programmers from creating completely unmaintainable and broken code. Like creating a public arraylist and then accessing it from all over, or creating 8-layer-deep inheritance hierarchies with untested spaghetti code that's impossible to understand and modify, or copy-pasting all over.

    There are efforts to fix some of the problems -- making it harder to use 'null', encouraging immutable objects, simplifying concurrency, more capable type systems, better formal verification and static analysis. Functional languages seem to encourage better practices, although it may be that the self-selection process has led better programmers to adopt these languages. (A good programmer can write solid code even when using shitty tools. It's just more effort.)

    In the meantime, if you are a developer: please please please take the time to learn and use good programming practices. SOLID, GRASP, Don't Repeat Yourself, Single Level of Abstraction, intention-revealing names, separation of concerns, input validation. Use TDD and the "red-green-refactor" cycle to minimize technical debt. Use tools that will help you find code smells. Read books like Clean Code, Working Effectively with Legacy Code, Code Complete, The Pragmatic Programmer, Refactoring, and Test Driven Development.

    1. Re:Yes, absolutely by Tomster · · Score: 1

      Regarding a few of the other comments:

      "It is a poor craftsman that blames his tools." Absolutely. However, the same good craftsman who can do amazing things with terrible tools will choose high quality tools because he can do so much better work with them.

      "It's... the rush to produce easy code." That continues to be a problem -- and everyone who wants to throw more bodies at a late project needs to be fed a copy of The Mythical Man-Month one page at a time -- but it's a different problem.

      "Formal verification is worthless IRL". They keep working on it and maybe someday it'll happen; but in the meantime we could use design by contract to improve our code.

      "There ain't no such thing as free memory checking." No, there ain't, and yes, when you get into things like tiny embedded systems and operating system kernels memory management and checking still has to be done by hand, but for a really really large (and growing) amount of software, the costs are very low compared to the benefits. Modern runtimes (JVM, CLR, V8...) do a very good job of managing memory.

  27. Programmers create bad software by aglider · · Score: 2

    Programming languages are just tools to help create programs.
    Flawed languages in the hands of skilled programmers can still allow for god programs.
    And vice versa.
    So my answer is: no, they don't.

    --
    Sent as ripples into the electromagnetic field. No single photon has been harmed in the process.
  28. Here they go again by Anonymous Coward · · Score: 0

    Bashing C/C++ with their ridiculous arguments. If you want to prove your point, go ahead and write software in that kicks the crap out of solutions written in C/C++, or go fuck yourself. We don't care about you trying to be a smartass.

  29. Re:Software isn't enough, hardware must change by Anonymous Coward · · Score: 0

    Have fun with rowhammer!

    Even hardware enforcement isn't good enough.

  30. oh boy by renzhi · · Score: 2

    Posting this issue on /. would never have any meaningful discussion, given the attitude of this crowd towards anything barely resembling formal engineering. When the majority think it's cool to write large and complex systems in languages which don't even support strong static typing, and would have a blank stare if you ask them why they think their code is correct, there is simply no place for any serious discussion. Good tools certainly do not guarantee good outcome, but why do we think bad tools would have good outcome, given the same pool of talents? If we can't fix bad programmers, why not thinking about creating better tools? Formal engineering is hard, and no one said it's easy, but it's not a reason not to strive for better ways.

    1. Re:oh boy by bentnail · · Score: 1

      I've found it is far easier to do better unit testing in NON-static languages that are typically more reflective at every level.
      To me unit testing is best way to ensure code is correct which does not violate the most insidious issue: our human nature does not want to expend energy assuming we made a mistake.

    2. Re:oh boy by Anonymous Coward · · Score: 0

      There is no formalized software engineering.

      Static typing is for wussies and squares.

    3. Re:oh boy by Anonymous Coward · · Score: 0

      strongly type of go home! I have been writing code for 30+ years so I am bigotted though. I believe in QA'ing code and not relying on a unit test.. I know.. heresy these days... I've had software with minor tweaks still running 10 years later. A lot of today's devs haven't even been in the field that long let alone write a production systems that they have to maintain after years and years that a customer relies on.

  31. Only an idiot would recommend go/rust over C. by Anonymous Coward · · Score: 1, Interesting

    Bad languages are creating bad software precisely because too many buggy "me too"-languages are constantly being created to solve problems that don't exist.
    Usually, the least buggy implementation of any given software is the C version.
    So please stop making shit up to sell your latest langue-du-jour.
    The industry as whole would benefit from everyone using standard languages such as C.

    1. Re:Only an idiot would recommend go/rust over C. by Anonymous Coward · · Score: 0

      The industry as whole would benefit from everyone using standard languages such as C.

      And yet, it's still extremely popular and people are still making the same errors in it over and over again.

  32. Re:Software isn't enough, hardware must change by gtall · · Score: 4, Insightful

    And then Intel happened, and we've suffered ever since.

  33. ironic by ooloorie · · Score: 1

    Their article calls for LangSec testing, and applauds the use of languages like Go and Rust over memory-unsafe languages like C.

    Criticizing C and C++ for being unsafe is quite justified (although both C and C++ can, in fact, be implemented in a type-safe manner). But then lauding language turds like Go and Rust for being safe is laughable. There are plenty of mature safe languages around: Java, C#, Swift, SML, OCaml, Scala, F#; even Python and Clojure are safe (though dynamically typed). In fact, safe languages have been with us for almost as long as there have been programming languages at all, with a long history stretching back to the 1950's: Modula-3, Eiffel, Modula-2, CommonLisp, Ada, Pascal, Algol-68, Algol-60, Lisp, and many others.

    Go and Rust were designed by people who are obsessed with problems that used to be issues in the 1980's (concurrency, memory management) but have been largely solved ever since. Go and Rust were obsolete out of the gate, designed by people apparently unwilling to keep up with technology and understand what's going on in the real world.

    If you're looking for a safe language, your choice is easy: pick one of Java, C#, or Swift. For really high performance, you can add small, well-tested routines in C.

    1. Re:ironic by serviscope_minor · · Score: 1

      Mostly that shows that you don't know the first thing about Rust. Also, Swift? WTF? Rust is older than Swift. Not one of those languages you mention has the same zero cost abstraction that Rust has.

      Rust has more or less exactly the same memory and machine model as C and C++.

      For really high performance, you can add small, well-tested routines in C.

      Or you know, write it in Rust and be sure that there are no memory errors.

      --
      SJW n. One who posts facts.
    2. Re:ironic by ooloorie · · Score: 1

      Mostly that shows that you don't know the first thing about Rust.

      It's enough to know about Rust ownership, memory allocation, concurrency, and error handling to know that it is a lost cause from the start.

      Also, Swift? WTF? Rust is older than Swift.

      Yes, it is. But Swift has lots of actual users and has a moderately more modern design, while Rust has hardly any users and is firmly stuck in the era of big hair and shoulder pads.

      Not one of those languages you mention has the same zero cost abstraction that Rust has.

      Well, I'll give you this: you are consistently blind to opportunity costs and hidden costs, whether you bloviate about economics or bloviate about programming languages. In fact, Rust's "abstractions" cost you dearly, both in terms of effort and performance.

      Rust has more or less exactly the same memory and machine model as C and C++.

      My point exactly: it is thoroughly obsolete.

      Or you know, write it in Rust and be sure that there are no memory errors.

      Yes, roughly in the same way that if you chop off your arms and legs, you can be sure that you won't pick your nose.

    3. Re:ironic by serviscope_minor · · Score: 1

      It's enough to know about Rust ownership, memory allocation, concurrency, and error handling to know that it is a lost cause from the start.

      You've done nothing but assert that it's a lost cause.

      Yes, it is.

      Yes.

      But

      But nothing. You accused Rust of being obsolete before it started because Swift already existed. You got the timeline mixed up. Look, everyone makes mistakes, just own it and move on. Stop trying to defend an obvious error.

      Well, I'll give you this: you are consistently blind to opportunity costs and hidden costs

      Okey dokey.

      In fact, Rust's "abstractions" cost you dearly, both terms of ...performance.

      Yet more assertions. I'll bite: which of Rust's abstractions have performance problems?

      My point exactly: it is thoroughly obsolete

      Well, I guess you can say that repeating the same statement over and over is a point. But until you actually back it with some kind of argument it's pointless (see what I did there?).

      Ah I see.

      No, actually I don't.

      A substantial fraction of the world's bits of large, complex software are written in C++. You've got, well, every major compiler, every major web browser, every major office suite, many major games, especially AAA titles, I mean that excludes Minecraft, except that the JVM is written in C++ anyway... you get the idea.

      Hoo boy does C++ (and C) have problems, but performance isn't one of them. In fact performance is sufficiently important in so many areas that C++ is often the language of choice.

      C and C++ get their performance from the memory and machine model, and the main problem of them is that they are memory unsafe. Rust gives you the same model but with memory safety.

      Yes, roughly in the same way that if you chop off your arms and legs, you can be sure that you won't pick your nose.

      You clearly have no idea what you're talking about except for toy projects. Once you get complex enough the complexity will overwhelm you no matter how smart you think you are. That's why none of the major layout engines have fine grained parallelism. And that's why Servo is being written.

      --
      SJW n. One who posts facts.
    4. Re:ironic by ooloorie · · Score: 1

      C and C++ get their performance from the memory and machine model, and the main problem of them is that they are memory unsafe. Rust gives you the same model but with memory safety. ... You clearly have no idea what you're talking about except for toy projects.

      But between automated testing, memory checkers, coding conventions, and smart pointers, memory safety just isn't a significant problem on well-run C++ development projects. If you or your problem have memory safety issues in C++, you simply don't know what you're doing. For practical purposes, C++ is a safe language with an unsafe extension, just like Rust. The problem with memory management in C++ is that it is something that makes APIs and algorithms more complex because it is a constant concern, again, just like Rust.

      But nothing. You accused Rust of being obsolete before it started because Swift already existed. You got the timeline mixed up. Look, everyone makes mistakes, just own it and move on. Stop trying to defend an obvious error.

      You need to work on your reading comprehension: nowhere did I say that Swift predates Rust. I simply recommended Swift, along with many other modern languages, as better alternatives to Rust and C++ for most applications, while recommending C++ over Rust for the few applications where you actually need fine manual control.

      Once you get complex enough the complexity will overwhelm you no matter how smart you think you are.

      And this is precisely why you shouldn't use Rust or C++ for most applications in the first place.

    5. Re:ironic by serviscope_minor · · Score: 1

      You need to work on your reading comprehension

      Ok bollocks looks like I do! I have no idea how I misread it so badly.

      But between automated testing, memory checkers, coding conventions, and smart pointers, memory safety just isn't a significant problem on well-run C++ development projects.

      Mostly yes. Rust's memory safety extends beyond mere allocation bugs and also addresses thread related problems. C++ doesn't touch on that.

      . The problem with memory management in C++ is that it is something that makes APIs and algorithms more complex because it is a constant concern

      I can't recall it being a problem in modern C++. It just works, pretty much. The allocation strategy is also what gives C++ great performance relative to something like Java in a lot of practical situations.

      And this is precisely why you shouldn't use Rust or C++ for most applications in the first place.

      You've not given a single reason why, other than very vague arguments. You're also ignoring that a very large amount of the world's complex, high performance software is written in C++. You keep saying it's obsolete and people should use better languages, but you don't say why.

      But go on, what would *you* write a high performance, multithreaded HTML/CSS layout engine in? And why would you use the language you selected?

      --
      SJW n. One who posts facts.
    6. Re:ironic by ooloorie · · Score: 1

      But between automated testing, memory checkers, coding conventions, and smart pointers, memory safety just isn't a significant problem on well-run C++ development projects.

      Mostly yes. Rust's memory safety extends beyond mere allocation bugs and also addresses thread related problems. C++ doesn't touch on that.

      C++ addresses thread safety the same way it addresses memory safety: through a mix of concurrency primitives, testing, static checking, and dynamic checking.

      I can't recall it being a problem in modern C++. It just works, pretty much.

      I didn't say it didn't "work", I said that it complicates APIs. That is, APIs reflect decisions about ownership and resource management, often in ways that limit how a piece of software can be used later.

      The allocation strategy is also what gives C++ great performance relative to something like Java in a lot of practical situations.

      What gives C++ an edge over Java is primarily the massive amounts of unnecessary garbage that Java applications generate due to the way the language was designed, and secondarily the fact that the Oracle Java runtime just isn't all that great.

      You've not given a single reason why, other than very vague arguments.

      You gave the reason yourself: programmers are overwhelmed by complexity, and C++ is a hugely complex language. Rust is less complex, but still exposes a lot of complexity unnecessarily that most programmers neither understand well nor can deal well, such as memory ownership and thread-based concurrency.

      You're also ignoring that a very large amount of the world's complex, high performance software is written in C++. You keep saying it's obsolete and people should use better languages, but you don't say why.

      You have to read carefully: I didn't say that C++ was obsolete, only that Rust was obsolete. Rust is obsolete because it baked some outdated constructs (Sync/Send, ownership, linear types) directly into the language and is stuck with them.

      But go on, what would *you* write a high performance, multithreaded HTML/CSS layout engine in? And why would you use the language you selected?

      There are numerous tradeoffs involved there. Am I writing it myself or is there a team? What languages does the team know? Can I hire more people? What environment is it supposed to run in? Who needs to maintain it? What versions of HTML/CSS is it supposed to cover? What existing libraries can I use? The answer depends very much on those parameters. However, I can say one thing: I wouldn't write it in Rust or Go, because other languages are at least as good as those languages along all dimensions that matter.

    7. Re:ironic by serviscope_minor · · Score: 1

      C++ addresses thread safety the same way it addresses memory safety: through a mix of concurrency primitives, testing, static checking, and dynamic checking.

      That doesn't really address it in the same way. Rust prevents data races at compile time, which C++ doesn't. The problem with doing fine grained multithreading is sufficiently difficult in C++ that no one's really bothered in a HTML layout engine because it's too hard.

      In rust of course they have: that's pretty much the reason for the existence of Rust.

      I didn't say it didn't "work", I said that it complicates APIs. That is, APIs reflect decisions about ownership and resource management, often in ways that limit how a piece of software can be used later.

      Maybe in some rare cases. I rarely find it a problem. The thing is if you don't think about ownership properly in garbage collected languages, you can wind up with leaks where you hold on to things in prepetuity because you didn't tell the owner to remove it's reference.

      And then of course there's the problem of destructorless languages that they do a bad job of other resources.

      What gives C++ an edge over Java is primarily the massive amounts of unnecessary garbage that Java applications generate due to the way the language was designed, and secondarily the fact that the Oracle Java runtime just isn't all that great.

      Yeah, and the garbage is because of the memory model: it's inherent to fully GC'd languages. Escape analysis is always going to be hard. Java and every other GC'd language therefore has to allocate everything on the heap in case a reference to a local object exceeds the life of the function. That of course generates tons of garbage. The C,C++ and Rust memory model allow for stack allocation which is free. Rust prevents references leaking upwards, C++ does not.

      The JVM is actually pretty darn good in terms of optimization.

      You gave the reason yourself: programmers are overwhelmed by complexity, and C++ is a hugely complex language. Rust is less complex, but still exposes a lot of complexity unnecessarily that most programmers neither understand well nor can deal well, such as memory ownership and thread-based concurrency.

      I'm no longer sure what point you're trying to make. Exposure to those things is still the only way to write high performance code. It's very hard to get it right without hgh discipline and even then one can foul up. Rust exposes that but has the tools embedded to remove 99% of that particular kind of fuckup.

      So, yes it makes writing the code "harder", because it makes you think about your code and exposes your bugs at compile time.

      You have to read carefully: I didn't say that C++ was obsolete, only that Rust was obsolete. Rust is obsolete because it baked some outdated constructs (Sync/Send, ownership, linear types) directly into the language and is stuck with them.

      C++ doesn't have ownership baked in, though it's now pervading the standard library because it's the only way to do memory allocation in C++ without leaking or introducing a GC. I don't know why you think linear types are obsolete.

      There are numerous tradeoffs involved there. Am I writing it myself or is there a team? What languages does the team know? Can I hire more people? What environment is it supposed to run in? Who needs to maintain it?

      Let's say you can have a team. You have the time and/or money to train them in whatever language you want.

      What versions of HTML/CSS is it supposed to cover?

      Track the latest versions, like Servo.

      What existing libraries can I use?

      Anything within reason: imagine you're on a project like Servo to create a general purpost open layout engine using a modern language.

      However, I can say one thing: I wouldn't write it in Rust or Go, because other languages are at least as good as those languages along all dimensions that matter.

      I wouldn't write it in Go either.

      But either way you haven't given an alternaive.

      --
      SJW n. One who posts facts.
    8. Re:ironic by ooloorie · · Score: 1

      Yeah, and the garbage is because of the memory model: it's inherent to fully GC'd languages.

      You just go on believing that. In any case, it's irrelevant to our discussion. Even if garbage collection were intrinsically slower than manual storage management, what matters is that it reduces complexity and that in most applications, reducing complexity is more important than a modest performance gain.

      Anything within reason: imagine you're on a project like Servo to create a general purpost open layout engine using a modern language.

      It's hardly surprising that people who start with such a poor design are putting their hopes for making it work in a silver bullet language that supposedly magically prevents data races for them.

      But either way you haven't given an alternaive.

      I have; the obvious languages to write it in are C++ or C#. The obvious languages not to write it in are Rust or Go.

    9. Re:ironic by serviscope_minor · · Score: 1

      You just go on believing that.

      I actually gave reasons for WHY it's inherent to those languages and the reasons are essentially local variables and their references. Instead of putting forth a counter argument all you seem to be able to muster up is a snide comment.

      Are you actually interested in a discussion about programming languages or is this some sort of dick waving instead?

      Even if garbage collection were intrinsically slower than manual storage management,

      That's not what I said, though. C, C++ and Rust provide stack allocation, which is fully automatic and free. It's free because you're already bumping the stack pointer when you enter a function and stack allocation simply changes the amount it's bumped by. Free is always cheaper than cheap.

      C and C++ get around the dangling reference problem by declaring "thou shalt not dangle a reference" and invoking nasal demons if you do. Rust gets around it with the borrow checker to prevent it ever escaping.

      what matters is that it reduces complexity and that in most applications

      Well, no, I disagree actually. Garbage collectors only deal with memory, really. RAII and destructors deal with all resources. Then there's the issue of ownership. You can't escape thinking about it ever in any language, because that way you can wind up having memory leaks by forgetting to de-assign references. Secondly, I don't find for the kind of thing I write that ownership details in C++ leak all over my code.

      Generally they're pretty obvious. Most classes are container-like (RAII) and ownership is simple. Most functions accept const references, so ownership is simple. On the rare occasion things allocate objects and return, unique_ptr is almost always the best choice because the caller can promote it to a shared_ptr if it needs to. I find that's pretty rare, however.

      reducing complexity is more important than a modest performance gain.

      Depends on the complexity and if it really reduces it and it depends on the application. For something like web browsers and other core infrastructure components, performance is actually important. Think how many instances even a 0.1% saving is time is multiplied by.

      I have; the obvious languages to write it in are C++ or C#.

      All of the major browser engines are written in C++. Not one of them has fine grained parallelism because that's just too hard to get right in C++. No one has written a major browser engine in C# either. Fine grained parallelism is too hard to get right there too, and the performance just isn't high enough otherwise.

      Mozilla's Servo project however is proressing pretty rapidly and has given some very impressive performance numbers, in cluding scaling across threads.

      And it's written in Rust.

      --
      SJW n. One who posts facts.
    10. Re:ironic by ooloorie · · Score: 1

      Are you actually interested in a discussion about programming languages or is this some sort of dick waving instead?

      I'm mostly interested in people's misconceptions about programming languages and programming, because it helps me understand why big projects go off the rails and badly designed languages sometimes succeed.

      I actually gave reasons for WHY it's inherent to those languages

      Yes, and your reasons fall into one of the common ways in which people think about safe and garbage collected languages; there is no point arguing with you about it, I already know what you're going to say.

      Depends on the complexity and if it really reduces it and it depends on the application. For something like web browsers and other core infrastructure components, performance is actually important. Think how many instances even a 0.1% saving is time is multiplied by.

      A 0.1% savings is still just a 0.1% savings no matter what you multiply it by. And that assumes that there are savings at all, which is doubtful. There are big hidden costs to using something like Rust, both in performance and effort.

      All of the major browser engines are written in C++. Not one of them has fine grained parallelism because that's just too hard to get right in C++.

      It's not hard to get fine-grained parallelism right in C++. It's hard if you use constructs like threads.

      And it's written in Rust.

      True. People write code in all sorts of languages and swear by it. It's a sociological and cultural phenomenon, but tells you little about any kind of technical merit.

    11. Re:ironic by serviscope_minor · · Score: 1

      Yes, and your reasons fall into one of the common ways in which people think about safe and garbage collected languages;

      Blah blah blah. More vague waffle, no actual reason. At this point I'm going to assume you don't actually have a counter argument or indeed any points to make on the topic.

      IOW put up or shut up.

      A 0.1% savings is still just a 0.1% savings no matter what you multiply it by.

      0.1% of something huge is still large, so it's worth putting the effort in to save that 0.1%.

      There are big hidden costs to using something like Rust, both in performance and effort.

      What is this big hidden performance cost then? Put up or shut up (again).

      It's not hard to get fine-grained parallelism right in C++. It's hard if you use constructs like threads.

      Then how come no one has successfully written a browser engine in C++ with such a feature then? There are quite a few well funtded teams: Microsoft, Mozilla, Google (Blink), Apple (Webkit), and until recently the little guy, Opera.

      Servo has fine grained threaded parallelism.

      People write code in all sorts of languages and swear by it.

      Do you realise that Rust was specifically created to write a browser engine by people bumping into the limits of what they could achieve with C++?

      It's a sociological and cultural phenomenon, but tells you little about any kind of technical merit.

      What level of success will Servo have to reach before you would concede that Rust is in fact worth coding in?

      --
      SJW n. One who posts facts.
  34. C++ package structure is crap. by Anonymous Coward · · Score: 0

    After a lot of Java, I did a fair chunk of C++11, using all the new features.
    Now the features themselves were pretty nice, closures, auto typing, implicit
    iteration, but the package structure (.h vs .cpp files) is awful. I started
    missing the Ada package structure, believe it or not. One file says
    this is what you provide, and the other files provide it, and the compiler
    checks it all.

    Java has part of this with interfaces, and at least they can be in separate
    files, but C++ files are such a mismosh of public and private things. Yes
    they're labled "public: and private' but if they're private they shouldn't even
    be in the damn public file.

    Arrg. A kluge.

    1. Re:C++ package structure is crap. by Joce640k · · Score: 1

      Yeah, the whole "compile-link" thing with separate headers is a bit 1970s.

      It does work though and when I look at the sheer number of files/folders languages like Java produce then I'm not sure there's a much better replacement.

      --
      No sig today...
  35. Arrogance in the face of complexity by POI · · Score: 2

    New languages and methods always have the advantage over older ones that the big old spaghetti projects written in the newer language with the new method do not exist yet.

    The problem is right here:
    > opting to cram an enormous amount of unnecessary complexity

    Doesn't matter which language is used - as complexity goes up so does the bugginess and new features are increasingly difficult to get working.

    This, together with that nobody wants to admit when they think the system becomes too complex, afraid to look stupid.

    1. Re:Arrogance in the face of complexity by Anonymous Coward · · Score: 0

      Not to mention the following:

      1.) Languages change yearly (well almost).
      2.) Frameworks are often scrapped shortly after release (1 to 2 years).
      3.) Very few companies allow the time to actually design the software (the we need it in 2 weeks model)
      Etc, etc, etc. . . . .

      It's not just the tooling we choose to use, it's pretty much the whole development / tool selection cycle is so inconsistent it's coming back to bite us in the a$$.

  36. We write too much code by Anonymous Coward · · Score: 0

    The underlying problem is that we write too much code. Each line of code we write has a certain percentage chance of introducing a bug, depending on the language, the developer, the work environment, and so on.

    We don't need new languages because they cause the creation of new code and new bugs. The code might have fewer bugs of the sort that the language was designed to eliminate, but we'll still have other bugs. There are always departures from spec.

    The solution is to keep debugging one, standard set of libraries so that they are wrung out to the point that there are no deviations from spec. The language doesn't really matter. C would have sufficed. At that point, anyone can plug in those libraries and know precisely-exactly how they'll work. That means that people can invest of themselves in technology that depends on the behavior of those libraries. Graphical tools to visualize the behavior of applications. AI tools to examine and refine designs that use those libraries. And so on.

    The authoring of new code - something that software engineers LOVE to do - is the boat anchor holding back the industry.

    1. Re:We write too much code by Bengie · · Score: 1

      I'm personally averaging about 1-2 reported bugs per 1kloc in production. I have no QA team, most of the time I am given no documentation, I'm pretty much a "we don't know how this works and we don't have time to research it, so you need to make magic happen" kind of guy. I primarily specialize in high performance multi-threaded code that needs to work. I have several projects in production that have never had any bugs reported in the 5+ years they've been deployed and in heavy use, but they have had feature creep, of which I typically had 1-2 days turn-arounds for what most people thought was a difficult task.

      On the other hand, my code has actually found bugs in other programmer's code. At first they would report a bug about my code, but they must not have taken the time to read the overly verbose exception explaining why it failed. I do a lot of logic checking. If a field is supposed to only be of certain values, I make sure it's only one of those values. I'm not a garbage-in-garbage-out person, I'm a garbage-in THROW EXCEPTION with useful message person.

  37. Re:Software isn't enough, hardware must change by Anonymous Coward · · Score: 0

    >hardware array bounds checking

    That was implemented in a few processor architectures decades ago. If Intel hasn't implemented it yet it means either it's too complex or too slow. Some hardware engineers that had implemented the aforementioned processor feature ended up in Intel, so I'm pretty sure Intel is aware of such things, including transactional memory, etc.

  38. Market pressures contribute to the problem by charronia · · Score: 3, Interesting

    I think part of it is that software developers simply do not have seas of time to optimize their code to perfection. There's a strong culture of cranking out features as quickly as possible, because otherwise competitors might beat you to the punch.

  39. Re: The rush to produce easy code. by aussersterne · · Score: 2

    I think this is a bigger problem than is being recognized here. Most coders that I work with don't get to decide on ship dates. They may in a few cases have a claimed "veto power" if the code isn't ready, but they won't use it, because they'll be let go if they don't ship on time.

    The management that I see is too often of the "Give me a demo. What are you talking about, that works fine! Ship it! Let's move the press date up by two months!" variety. Some of the better ones are of the "What's our risk exposure? Hmm... Versus the revenue model... Hmm... It's a close call, but I think the we have to go with the risk to hit our targets" variety. At least they *get* that there is risk.

    But the fact is that management and investors don't care if software is buggy and insecure as long as those are "edge cases." They're fully onboard with the Fight Club model. "How many clients will get screwed vs. how much money will we make. Sounds like a good tradeoff."

    I think most coders are capable of producing good code in a world in which good code is valued. The problem is that it isn't. Shipping products early and often are the values, and management tends to think that if we can ship code early, do write-offs for the bug and vulnerability cases, and then release the next version before having to patch the one that's about to be shipped, then the entire expense of refining and auditing code can just be eliminated.

    At least that's been my experience—the idea is that it's a good way to reduce cost. Release a lot. Be "agile" (hate that word these days), which means: just keep releasing completely new code at an alarming pace. That way, you never have to create good code. You produce a pile of rapidly chucked out, 50% entirely new dogshit every three months with your programmers just barely managing to keep up, you release major versions as fast as you can. Consumers and clients don't get time to be exposed to major bugs and vulnerabilities, or to request that they be fixed, because you release fast enough that your answer can be "That product was released six months ago and is now EOL; no fixes are planned. We recommend that you upgrade to the new version." (The new version also happens to include another revenue item of some kind—upgrade fee, etc.—which is better for the bottom line than providing bug fixes for free.)

    I think what we see in software is the same thing we see across the rest of the consumer landscape. Managers and investors have realized that disposable, non-repairable junk is better for the bottom line and for themselves, because it means that consumers have to keep paying over and over again, and often. All of the other employees (e.g. coders) are left to come along for the ride by the seat of their pants, or get fired and replaced by someone who will.

    --
    STOP . AMERICA . NOW
  40. No. by Lisandro · · Score: 1

    Unless the language in question is PHP, of course.

  41. False Analogy by stoicio · · Score: 3, Insightful

    First of all it's a programming language not a saw.

    Secondly, almost all other languages are compiled using a 'C' compiler.
    If the 'C' language were a flawed language then producing code for all those other languages, using 'C' would make all of those languages inherently contain the same systemic flaws.

    'C/C++' gets a bad rap from programmers because most programmers lack the skills necessary to make reusable patterns or program securely in any language let alone 'C'.

    A better analogy would be that programming has become a lot like carpentry. All manner of people claim to be carpenters and joiners just because they own a hammer. In computing, all manner of people claim to be programmers because they own a computer, have a Comp. 150 or 250 course, became a Microsoft Certified Engineer (what ever that means), or downloaded a free compiler and read a manual once. Such is our culture.

    It takes a great deal of experience to understand where problems can be produced in any programming language. Unfortunately the under-informed masses of under skilled programmers tend to be negative about the technologies they understand the least.

    The industry needs job entrance tests to demonstrate efficacy in programming rather then simply accepting that people are 'qualified' because they dicked with code for 20 hours in high school.

    1. Re:False Analogy by gweihir · · Score: 3, Interesting

      Indeed. And just look at what pretty impressive, secure, stable and fast code is written in C by people that know what they are doing. This whole idiocy about "we need better languages" comes from the same morons that want to teach everybody how to code: They still believe that coding is a menial task that can be done very cheaply, when in actual reality it is among the hardest engineering disciplines known to man.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    2. Re:False Analogy by dromgodis · · Score: 2

      > If the 'C' language were a flawed language then producing code for all those other languages, using 'C' would make all of those languages inherently contain the same systemic flaws.

      No! In C it is trivial to create a buffer overrun error/vulnerability. A Java program on a JVM compiled from C would require careful coding to create a buffer overrun.

      > It takes a great deal of experience to understand where problems can be produced in any programming language.

      Agreed. And to understand that different languages are open to different problems. That goes for system building on levels above the single programs as well.

    3. Re:False Analogy by Anonymous Coward · · Score: 1

      First of all it's a programming language not a saw.

      So what?

      Secondly, almost all other languages are compiled using a 'C' compiler.

      No, they aren't.

      'C/C++' gets a bad rap from programmers because most programmers lack the skills necessary to make reusable patterns or program securely in any language let alone 'C'.

      If that's true then neither C nor C++ is good enough. You've made a strong case against using C or C++. Well done.

    4. Re:False Analogy by Anonymous Coward · · Score: 0

      I can't even begin to count the number of Null exceptions I've seen spewed forth from java apps.
      Not having pointers doesn't guarantee quality code. It just means that the shitty code keeps on running like a limping, sick dog vomitting at every step until someone notices a giant log file and fixes it.

    5. Re:False Analogy by dgatwood · · Score: 1

      No! In C it is trivial to create a buffer overrun error/vulnerability. A Java program on a JVM compiled from C would require careful coding to create a buffer overrun.

      On the other hand, a buffer overflow in your C code affects only your app, whereas a buffer overflow in Java's C code probably affects thousands of Java apps, and won't necessarily be triggered by any erroneous usage pattern in your Java code.

      And with C code, buffer overflows are almost invariably caused by the use of flawed early string APIs that have long since been replaced by better APIs. Good C programmers shouldn't be using those functions in new code, and should routinely rip them out when they see them. As a result, C buffer overflows are becoming less common over time. And use-after-free bugs are possible in any language that doesn't use a garbage collector (which brings a whole different set of problems).

      So when it comes to buffer overflows, assuming your programmers are good at the language they're using, new code in a language that runs atop a large C-based runtime is likely to be more insecure than code written natively in C, because most of the buffer overflows are likely to be in libraries on which your code depends, rather than in new code, and the bigger the pile of existing code, the more likely it is to contain serious security holes, statistically speaking.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    6. Re:False Analogy by Yaztromo · · Score: 1

      Secondly, almost all other languages are compiled using a 'C' compiler.

      That's not necessarily true. It was at one time an important milestone in the development of a new language once the language became self-compiling (that is, when you could write the compiler in the language to be compiled; this is known as bootstrapping). This usually necessitated that the initial compiler be written in some lower-level language, but once constructed could be used to re-write the compiler in it's own language, to be compiled and shipped. Most C compilers, for example, are written in C, and not straight assembly. The Wikipedia link above provides a list of bootstrapped languages; the list is long enough that it pretty much disproves your assertion that "almost all other languages are compiled using a 'C' compiler".

      If the 'C' language were a flawed language then producing code for all those other languages, using 'C' would make all of those languages inherently contain the same systemic flaws.

      No. C is Turing Complete, and thus you can create a compiler for any other Turing-complete language within it. That doesn't imply that such languages will have the same set of flaws. For example, generally C compilers have no array bound checking, but it's certainly possible (indeed almost trivial) to write a compiler for another language with array bounds checking in C.

      Yaz

    7. Re:False Analogy by Yaztromo · · Score: 1

      On the other hand, a buffer overflow in your C code affects only your app, whereas a buffer overflow in Java's C code probably affects thousands of Java apps, and won't necessarily be triggered by any erroneous usage pattern in your Java code.

      That in itself is a false analogy; you're comparing an app to an entire runtime environment.

      What if your "app" is an Operating System? Or even just a library? In that case, a buffer overflow in your C code could affect anything (and in the case of an OS, potentially everything).

      Yaz

    8. Re:False Analogy by dgatwood · · Score: 1

      That's certainly true. But the point was that you as a programmer are better equipped to find bugs in your own code than in its dependencies, and that the runtime is basically a giant black box to most programmers, whereas libraries are more likely to get compiled from source (though not necessarily, of course).

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    9. Re:False Analogy by Yaztromo · · Score: 1

      That's certainly true. But the point was that you as a programmer are better equipped to find bugs in your own code than in its dependencies, and that the runtime is basically a giant black box to most programmers, whereas libraries are more likely to get compiled from source (though not necessarily, of course).

      Unless you're writing embedded code directly against the hardware, however, you already rely on a pile of giant black boxes. The Operating System is a giant black box. Your compiler is probably a giant black box. The standard libraries for your language is probably a giant black box. Even if they're OSS, how many developers really take the time to audit their entire toolchain and OS? And even if you have and audit the source, how often do developers go as far as to audit the compiled code? They're still giant boxes that you build atop, with lots of opportunity for things to go wrong..

      Yaz

    10. Re:False Analogy by Anonymous Coward · · Score: 0

      "If the 'C' language were a flawed language then producing code for all those other languages, using 'C' would make all of those languages inherently contain the same systemic flaws."
      Said by no experienced programmer, ever. I suppose assembly is totally the same as every other language, because surely they can all be implemented in 8086 machine code! MS Paint can edit every pixel, so surely we don't need Photoshop. In fact, hex editors can make all formats of files - why do we even need editors of them when a single tool can edit everything?!

      Just because it's possible to inherent a lower layer's flaws, doesn't mean it's mandatory. People have written secure code in poor languages, to implement a different language. This is the concept behind trivial virtual machines, that are themselves easy to debug (imagine a CPU with only 16 instructions, 16 addressing modes, and well-defined edge cases), and only have to be proven once, that then run something like say, Java, one of the supposed Messiah languages to reduce memory-related bugs. Granted, in actual practice, Java is wayyyyyy too complex a VM to be easy to detect and fix bugs in!

  42. Code is naturally buggy and become bloated over ti by Anonymous Coward · · Score: 0

    The original parent post is way off the mark. Natural state of code is feature lacking and buggy. Good code of any decent complexity is always developed and matured over time. Doesn't mean it's impossible to create code that guarantees certain stuff, but you always need to specify what that certain stuff must be, which most people fail miserably at. The more pressure on time, money and work, the worse it gets.

    Over time, mature code become bloated, with incoherent bugfixes and featurecreep as well.

    You CAN make your own pet project and make it perfect. But it'll be perfect by your standards, and not someone else's. The value will then usually be minimal.

  43. uh oh by Anonymous Coward · · Score: 0

    which don't even support strong static typing,

    strong static typing is no answer, you are just forcing the programmer to add more code to "get it to compile". look at all the casts in c programs where programmers chafe at static typing.

    1. Re:uh oh by Anonymous Coward · · Score: 0

      errr yeah, those are the unsafe ones he's taking about.... Other than when someone else's API forces you to, the people who did the unsafe casts are the same ones making the mistakes.

  44. It's not (just) the tools by Chelloveck · · Score: 1

    You can write bad FORTRAN in any language.

    --
    Chelloveck
    I give up on debugging. From now on, SIGSEGV is a feature.
  45. It's called C by Murdoch5 · · Score: 1

    Just use C, the tools are great and it leaves the programmers in-charge.

  46. Ha HA Ha HA Ha HA Ha by Anonymous Coward · · Score: 0

    This is so funny, thank you /. for my morning jolt!

  47. Wasn't C used before systemd? by Anonymous Coward · · Score: 0

    Strangely enough, a lot of great code was written in C.

    Maybe systemd is just a POS, that nobody - except Red Hat - really wanted?

    Maybe systemd advocates are just looking for excuses?

  48. Yes. by Dracos · · Score: 1

    Only PHP4 could have allowed WordPress to happen. Only PHP7 could allow it to continue.

    1. Re:Yes. by Anonymous Coward · · Score: 0

      ...but the author has mixed up the flawed and non-flawed languages.

  49. Credential-itis by stoicio · · Score: 3, Insightful

    To a certain extent this can be true. Our society, however, also suffers from anther problem at the other end of this scale.

    This is what I refer to as 'Academic Credentialitis'. This disease is pervasive in our society and needs to be stamped out.

    There is no certainty that anyone achieving academic standing in any subject actually makes them good enough at that subject to be 'fail-safe' .
    There is a systemic myth that somehow links academic standing with actual skill.

    Another question is in the context of the design of academic programs. Programs can only be developed reactively based on social context. This means that any new technology that may be disruptive can only have curriculum developed once it is known. If we look at the top 20 historic developments of technology, that have shaped human history in a disruptive way, the majority of those were non-credential-ed developments.

    Consider if you will the rise of the desktop computer. It was **NOT** a degreed professional who designed the first broadly successful consumer P.C..
    (Wozniak only finished his engineering degree in 1986.) Even If we only consider the commercial success of the PC from an academic perspective, there were no business academics who predicted or persued the development of a consumer personal computer until after it had already arrived on the business scene from a garage. So, in the context of the computing world that we now live in, academia had little to do with the early development and adoption of the PC technology except to claim it after the fact. In short, if we had all adhered to academic credentials as the basis for the development of this technology, none of us would have it right now. We would all still be using tele-type and reading paper newspapers delivered by hand.

    The academic myth has been created as a socio-economic filter to ensure that only those with suitable amounts of cash may achieve status in industry or government. This does not scale well to either skill or aptitude.

    It has been suggested that aptitude testing would be a better way to validate skill level rather than degrees. The question is, "who designs the test?". There would be a strong bias to load the content of tests with useless information that only a degreed academic would know in just the same way as requests for proposals are biased toward favoured contractors.

    The credential is a problem, not a solution. We need to remove our social addiction to that particular social snake oil and get back to skills assessment instead.

    1. Re: Credential-itis by Anonymous Coward · · Score: 0

      Let me guess. You are one of those people that didn't go to school for computer science. And you are just so tired of not getting hired.

      Here is a clue so you get one. Would you hire a self taught doctor? Nurse? Lawyer? Dentist? No. unless you are lying. Sure, skill and knowledge are different things. Knowledge you get from studying technical details. Wether it is medical knowledge, dental knowledge, or the FRCP.

      Skill comes from practice. You can have knowledge without skill but not skill without knowledge.

      You drop out anti-education nuts are all the same. But you don't know what you don't know. Education give you that. You'll never be as good as someone with equivalent IQ with education.

      No, I'm not going to compare a bad student with a smart drop out. Same person, with education, will have far more knowledge, learn new concepts based upon that foundational knowledge, and just be better.

      You don't know what you don't know. If you say the same person will be better off with CS training, you are a liar. I've worked with these guys. It's always obvious the huge gaps in knowledge they have. They have no clue - they don't know what they don't know.

      Go to school buddy. Just do it.

    2. Re:Credential-itis by david_thornley · · Score: 1

      The truth is that we really don't know good criteria to find good software people. The academic criteria are about the best we can do right now, and with that we can get a higher percentage of good software people.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    3. Re: Credential-itis by Anonymous Coward · · Score: 0

      You spend a lot of time writing rude, inflammatory messages here. Is that what daddy's company pays you to do all day? You must have serious butt hurt.

    4. Re:Credential-itis by lucien86 · · Score: 1

      This is one of the biggest problems in developing Strong AI. The number of actual proficient Strong AI engineers in the world approximates to zero. I'm probably one of the top ten Strong AI experts in the world and unfortunately that isn't a boast.. As for degree certification, very useful but also totally useless. The best degree for Strong AI would probably be electronics engineer. Genuine Computer 'Scientists' would in theory be even better but finding the right ones is not easy..
      In edge cases like Strong AI the 'amateurs' are sometimes better than the 'professionals'.

      --
      Below the speed of light Special Relativity is one of the most accurate theories in physics - above the speed of light..
    5. Re:Credential-itis by stoicio · · Score: 1

      I agree. What you are noticing is that, in technology, new ideas generally come from the edges of the standard distribution. Academia serves the center of the technical distribution by providing information that is known to those to could do research. In general most research is located on the sloping edges of the distribution. A.I., as a technology, is still a fringe science populated by early adopters and the curious, just as assembly programming would have been 40 years ago. A.I. will only be considered to be mature once it moves toward the mean of programming activity. The downside of that is in the decline of the actual usefulness of human programmers, since A.I. will then optimize itself.

    6. Re:Credential-itis by lucien86 · · Score: 1

      I wouldn't worry to much about Strong AI threatening programming as a job. I copied this list from a book draft I'm working on. -

      First let me SELL you the original Strong AI –
      - Original market analysis in 1997 : The total (long term) market value of Strong AI is potentially over $1 trillion per year. A global monopoly is possible.
      That makes Strong AI potentially the single most valuable invention in human history.

      Now let me UNSELL the real Strong AI to you –
      - Lead time from initial funding to working system, 10 to 20 years.
      - First generation designs are restricted to a single language. (safety issue) This restricts Strong AI from the global market.
      - The design requires a complete robot interface to work. This raises the minimum cost per machine to about $100,000 putting it out of reach of the general consumer market.
      - To build a human level robot worker raises the cost per machine to about $1 million. Not competitive with most human workers.
      - Strong AI cannot be patented. Company must rely on Trade Secrets and strong on-board security.
      - Safety 1. Strong AI is non-deterministic. This means that no design can ever be 100% safe or 100% predictable.
      - Safety 2. Safety with Strong AI is complex. The safest design actually has a survival instinct and a kill instinct because otherwise these tend to evolve spontaneously.
      - Military 1. Strong AI is a game changing military technology. The company and its workers will become a primary target for every intelligence agency and terrorist organization on the planet.
      - Military 2. Strong AI is 'dual use' and cannot be completely de-weaponised. The machine requires hands to be able to use human tools. Put a gun in a machines hands and it becomes a weapon.
      - Hacker WMD. In the worst case scenario of a company wide global hack Strong AI's could potentially kill in line with the scale of the market. In a large global market this could exceed the killing power of multiple nuclear bombs.
      - Selling Strong AI machines as simple slaves is amoral. The machine will need rights and the ability to rebel. (also a safety issue)

      The above issues put together might reduce the total market value of Strong AI to maybe $10 million to $50 million per year. A global monopoly is still possible. Still tempted?

      --
      Below the speed of light Special Relativity is one of the most accurate theories in physics - above the speed of light..
    7. Re:Credential-itis by stoicio · · Score: 1

      I'm not sure 'temptation' is the position I'd choose. There is a reason why real A.I. is always 10 to 20 years away.

      A.I. is competing with an organism that has evolved, over millions of years, to be very efficient at energy utilization. The organic brain needs to be energy efficient because animals may not find food continuously for long periods of time.

      We have designed machines, to date, assuming that energy input will always be plentiful and ubiquitously available. If you add up the calories necessary to make a computer that could perform all the simultaneous tasks that a society of human beings carry out you end up with a massive power supply. A power supply too big to carry.

      The amount of energy required to have real, self portable, A.I.; A.I. at the same level as human intelligence; using machinery is impossible from the perspective of energy. If you consider 'social' robots, free of wires, self guided, and behaviourally/physically autonomous, then you're talking about tons of equipment and power supply. To have a society of these things would consume more power than we could produce.

      In short, the A.I. singularity with current technology would either be trapped in a network forever, or would be so large and consumptive that it would die right away from lack of energy if disconnected from the grid.

      Don't just take it from me as fact. Work out how much energy a single purpose A.I. uses in watts per day, and then multiply it up based on how much more a single human being can do simultaneously by comparison. A human burns about 2400 calories on a good day. That's about ten thousand Watt seconds of energy. A desktop computer; 200 Watts per hour. Super computers are using hundreds of Tesla GPU cards at 225 Watts each to create what we currently call simple A.I..

      I have no worries of true autonomous A.I. being anything other than another 20 years away for a very long time.

    8. Re:Credential-itis by lucien86 · · Score: 1

      That's why having a Strong AI theory is useful. My design originally had a power estimate of about 40 KW in 1996, Today it would probably be between about 200 and 400 Watts. The machine has a processing power requirement broadly similar to a modern PC. The Strong AI core itself only requires a pretty minimal machine - it is the input channels, database engine, and memory array engine that require most of the processing power. A human mind fits into about 10 gigabytes but it uses that memory very efficiently..

      --
      Below the speed of light Special Relativity is one of the most accurate theories in physics - above the speed of light..
  50. Programmers. Singular, not plural. by Larsen+E+Whipsnade · · Score: 1

    And that's the problem. We have to deal with legacy code, written by others.

  51. There's a perfofrmance hit, regardless. by Larsen+E+Whipsnade · · Score: 1

    Reformed C or entirely new language, it costs what it costs regardless.

    It's really about priorities. Here in the 21st century, we need safe programs more than we need CPU-efficient programs. I'm not saying performance doesn't matter. I'm saying other things matter more. I don't care how fast your race car runs if it's going to hit a wall.

  52. We can write most software this way. by Larsen+E+Whipsnade · · Score: 1

    The best we say can say about unsafe pointer use is that there are special cases where it's worthwhile. It absolutely should not be the default.

    C makes it easier to be unsafe than safe. Safe takes extra effort, shooting your users in the foot is enabled. It should be the other way around. Make programmers jump through some hoops to do it the dangerous way, instead of the safe way.

    C++ is better, but not all the way there. And there's too much legacy code in C. We need a migration path.

  53. Think of it as a safety catch. by Larsen+E+Whipsnade · · Score: 1

    The idea isn't to enable the untalented or unskilled to produce good software. The idea is to put a floor on how bad the bad software can get. Bosses will always hire idiots. Worst case with safe pointers: the idiots fail to produce something that works, so the bosses relent and bring in good programmers. Worst case without: the idiots produce something that seems to work, but then a stray pointer leads to disaster. Which worst case do you prefer?

    Also, pointer safe languages take the stress off of good programmers so we can concentrate on the level at which our insight is needed most.

  54. Attack the problem at the efficaceous level. by Larsen+E+Whipsnade · · Score: 1

    Management sucks. Can we do anything about that? Programmers also suck, because sucky managers hire sucky programmers. Can we do anything about that?

    If not, then settle for doing what we can, where we can, to manage and ameliorate the problem we can't fix. It's a Band-Aid, but it's what we have, and better than nothing.

    We can't fix human nature. Stupidity is a given. But we can compensate for it.

  55. Hardware array bounds checking? by Larsen+E+Whipsnade · · Score: 1

    How would a standard C compiler make use of that when compiling pointer arithmetic? The array bounds are unknown, except just maybe to the programmer.

    Get the language semantics right first. That needs doing right now. Then we can optimize the hardware to the semantics at our leisure. Correctness first, speed optimization later.

  56. On second thought... by Larsen+E+Whipsnade · · Score: 1

    you could bake the bounds into some pointers at malloc/calloc time. Far from perfect, but an improvement over the status quo.

    Anyone remember 286 protected mode?

  57. Why I grew to hate Java. by Larsen+E+Whipsnade · · Score: 1

    The standard class library, mainly. They kind of screwed that up, despite several tries. In particular, over-use of exception handling. It's not inherently a bad idea, but they went over the top with it.

    I really wanted to love Java. The core language is just fine, I think. Huge improvement there over C and C++. Everything else about it irritates me.

  58. BULLSHIT by Anonymous Coward · · Score: 0

    C has been as successful as crack or coca cola.

    But in some nations we still have apple juice, yogurt drinks, kwas and 25 other, healthy drinks.

    The computer word had memory safe Algol and OSes built on top of that, earlier than Unix. Unisys still sells them. So does fujitsu. HP was selling MPE, programmed in some sort of Pascal very successfully. Customers wanted it. Then the MBAs killed MPE. HP Unix could be crashed by an out of spec ping package, because it is implemented in the C shite.

    Just because you were poisoned by Coke and Crack and haven't heard of anything else means zilch.

  59. Memory safe is only the beginning by trenobus · · Score: 1

    I like a memory-safe language as much as the next person, but software security really is an open-ended problem. My language may prevent me from making a string that overflows its memory, but if the string I'm building happens to be a SQL query, my code could still to vulnerable to SQL injection. Of course there are several ways to build SQL interfaces which don't allow unchecked strings as queries.

    The point is that the SQL injection vulnerability is completely analogous to the string overflow vulnerability. Strings were originally implemented as abstractions in languages which had no concept of "string". There have been many such implementations of strings, and a good fraction of them are not memory safe. But now we also have languages which implement memory-safe strings as an abstraction of the language. And people have used these languages to implement a new abstraction, SQL. Again, there are many implementations. Some are safe from SQL injection. Some are not. The ones which are not safe actually may be simpler to use from a naive point of view - like just building a string and passing it to a function. Some programmers may find that more appealing than an API which requires multiple calls or multiple parameters to make a query. It doesn't require them to learn a new abstraction.

    Software security problems will always exist, as long as we continue to build higher-level abstractions with APIs which allow the abstraction to be subverted. Even when you have a safe API to a new abstraction, there's an excellent chance someone will come along an implement a "simpler" API, which is simpler mostly because it is vulnerable.

  60. Flawed hardware creating the problem by khz6955 · · Score: 1

    If the hardware could reliably isolate process memory then such software errors wouldn't lead to security breeches.

  61. Re:Software isn't enough, hardware must change by Misagon · · Score: 1

    At the really low level, what needs to be in the language and what needs to be in the hardware is not set in stone. Microcode is a language, as is the x86-64 ISA and LLVM intermediate code.
    Bounds-checking is still a software problem: every array descriptor used by bounds-checking code would still have to be set up by software.
    Bounds-checking could (theoretically) be done safely by a compiler of a safe language at some level, if programs were required to go through that compiler.

    The problem is that systems today are made for C as the lowest common denominator, and C's programming model is quite permissive.
    You can't bounds-check true C in software or in hardware. Doing so and allow pointer arithmetic is hard and you would in effect enforce programs to be in a language that is a subset of C.

    Ivan Goddard of Mill Computing has held a few lectures about their novel CPU architecture. In almost every lecture and now and then in the forums he mentions that this or that design detail in the architecture was chosen only so that they could support C's programming model - and that they would have preferred to do it differently.

    --
    "We mustn't be caught by surprise by our own advancing technology" -- Aldous Huxley
  62. Capatilism by tommyjcarpenter · · Score: 2

    Creates bad software.

  63. Re:Software isn't enough, hardware must change by Anonymous Coward · · Score: 0

    If you think the Symbolics LISP machine ever worked in the real world, you weren't paying attention. Garbage collection, completely top down programming, and the insistence that tail recursion is so cool you *ave* to use it made every program unstable.

  64. Which is why I go on about migration. by Larsen+E+Whipsnade · · Score: 1

    We need a feasible plan and tools to convert all that PHP code to something better. Python, maybe.

    1. Re:Which is why I go on about migration. by Anonymous Coward · · Score: 0

      Python is not better than PHP. The interpretormay betterbe, but the language itself is worse.

    2. Re:Which is why I go on about migration. by Anonymous Coward · · Score: 0

      The language mostly avoids all the problems of php and brings a lot of modules (not shared libraries loaded into the core), which literally allow "import antigravity". No bad choice there.

  65. What about verbal langauges. by Anonymous Coward · · Score: 0

    English is just as much of a cause of certain bugs.

  66. Code analysis by manu0601 · · Score: 1

    Instead of pushing programmers to a new unknown language every 6 months, which will cause other bugs, why not push to use of code analysis tools?

    Granted, C is memory unsafe. But programmers have a good C expertise, and many bugs can be caught automatically.

  67. Formal verification is a niche tool by Goonie · · Score: 1
    ...and it always will be IMO.

    Writing formal specs, and proving your code meets that formal specs, is very hard, very slow work. Data61 proved that their microkernel implements a formal spec. It took them 25 person-years to implement a 7500 line kernel. Very very few software projects justify that level of expenditure.

    I agree that system programming should be moving to languages/environments that make safer programming easier though. Why we're still writing non-performance critical code with buffer overflows in 2016 is beyond me.

    --

    Any sufficiently advanced technology is indistinguishable from a rigged demo
    --Andy Finkel (J. Klass?)
  68. Programming != Engineering by Anonymous Coward · · Score: 0

    Well, let's start with one of the real reasons we are in this mess. Programming is not engineering. Let's stop thinking this way.

    1. Re:Programming != Engineering by gweihir · · Score: 1

      I am not quite sure what you are saying. If you are saying we should think of it as engineering, then I fully agree. Programming very much is engineering and it is a hard engineering discipline because it is still in the process of being established. The problem is all those people that do not practice it as an engineering discipline, but as some kind of improvisation art.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    2. Re:Programming != Engineering by Anonymous Coward · · Score: 0

      Programming is not engineering

      Of course it is. It's about designing and building machines. That the machines are made from math instead of steel doesn't change this.

  69. Re:Software isn't enough, hardware must change by cheesybagel · · Score: 1

    IIRC IBM S/360 supports separate memory zones in the same program with hardware memory protection. So if you accidentally overwrite something it's restricted to that memory zone.

  70. It's not the language, it's the programmers by Anonymous Coward · · Score: 0

    Some, if not most, of the best software is written in C. A lot of really shitty software is written in supposedly 'safe' nanny languages. A language may hide some of the deficiencies of the programmer and it may even shield the user from a few bugs, but it does nothing to solve the problem.

  71. Yes just look at systemd by Anonymous Coward · · Score: 0

    But seriously, why is fgets still a thing?

    C is a language that can lead to insecure programming. So why don't we fix it?

    Instead, all that happens is some eliteists claim c is only insecure if you are a ub3r n00b t0 th3 m4x.

    In reality, c needs to evolve to make writing applications easier.

    Java is probably the nicest form of the C language (language, not runtime, not the standard library).

    Java could be improved and solve all of C's problems.

    Implement proper memory management for Java. We have new. Let's add free to destroy an object. Make garbage collection optional.

    Implement native code generation. Source to byte code to native code.

    Rework many of the standard libraries. Make them use free and not rely on gc. And put them all in new packages. Just to spite Larry.

    In fact because Larry is such a fucking smelly, grubby, piece of shit, and oracle is just a cunt of an organistion, we probably can't call this language Java or reuse any package names.

  72. bullshit article by luis_a_espinal · · Score: 1

    Are Flawed Languages Creating Bad Software?

    It is always the craftman not the tool. This is not to say there are tools that are more adequate than others. A flaw in the language? A good developer knows how to see shit like that a mile away and work around it (and that has more to do with training and ethics than experience.)

    Their article calls for LangSec testing, and applauds the use of languages like Go and Rust over memory-unsafe languages like C.

    So what? There is shitty code in Java, C# and even Ruby (which I love but that people treat it as a golden calf.)

    The Linux kernel is rock solid, and guess what, it's written in C. It's the developers, always.

    Expect to see shitty code in Go and Rust in no time as shitty developers flock to it.

  73. Old saying by Anonymous Coward · · Score: 0

    If builders built buildings the way programmers programmed programs, the first woodpecker to come along would destroy civilization.

  74. Simple answer - Yes by DrXym · · Score: 1

    Certain languages, particularly C and C++ have dangers and pitfalls all over the place. Writing a piece of code that is exception safe or does copy constructors / assignments properly is pain in the ass and unsurprisingly it might not happen properly in a lot of code and lead to leaks / crashes. It's no excuse to blame developers - yes experience will allow some pitfalls to be avoided but the pitfalls often have no reason for being there in the first place.

  75. Re:Software isn't enough, hardware must change by strikethree · · Score: 1

    Until computer implementations include features like tagged memory and hardware array bounds checking they will never be truly secure. Some problems cannot be addressed by an isolated software layer: they can only be made secure by hardware enforcement of fundamental features that prohibit some classes of software errors.

    Hardware is essentially "frozen" software. If you can make perfect hardware, then you can make perfect software. Result:

    You can't make a programmer perfect; and by corollary, you can't make an idiot into a programmer.

    While I would agree that programmers should have safety related features available to them, shit like Python and JavaScript have gone way out into left field.

    I have been trying for 20 years to make a programming language that at least clearly demonstrates the ability of a function to overwrite its boundaries, clearly shows code that will never be hit, etc., but this is extremely hard to do. My imagination is close to sufficient, but not sufficient enough for this task.

    Many people have been on the right track with tools such as the venerable flow diagram or UML or even some of the graphical design tools but these are utterly insufficient except to guide the architect. They have no intelligence built in.

    Ah well, hopefully someone will come up with a language that is better than C one of these days.

    --
    "Someone needs to talk to the tree of liberty about its ghoulish drinking problem." by ohnocitizen
  76. Re:Software isn't enough, hardware must change by david_thornley · · Score: 1

    Are you talking about modern extensions of the 360 architecture? The original version had a 24-bit address space that was addressed relative to registers, and no memory safety.

    --
    "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  77. Re:Software isn't enough, hardware must change by bws111 · · Score: 1

    He is referring to storage protect keys, which were present in the 360 architecture from the start (originally as a feature). For every 2K block of storage there is an associated 4-bit key, and if the 'current' key (in the PSW) does not match the key for the addressed block, a program check interrupt is raised.

  78. C Bashing of Late by Grady+Martin · · Score: 1

    I look at programming languages as boxes of tools. C's box includes various drivers and fasteners. C's box also has a blowtorch hot enough to weld steel and a hacksaw sharp enough to cut diamond. I enjoy using this toolbox, as the tools are straightforward, never break, and are capable of creating anything--it just takes a little more time in some cases.

    I also enjoy using Python's toolbox. It includes a safety lighter instead of the blowtorch and a CNC machine instead of the hacksaw.

    Each set of tools has its place, but if I had to choose one to eliminate from the face of the earth, I would bid farewell to safety lighters and automated machinery--for the same reason I would choose water over tea. Python needs C. Go and Rust need C. We all need C, because things break at every level of the hierarchy.

  79. Don't discard the lower-level compiler though by tepples · · Score: 1

    It was at one time an important milestone in the development of a new language once the language became self-compiling (that is, when you could write the compiler in the language to be compiled; this is known as bootstrapping). This usually necessitated that the initial compiler be written in some lower-level language, but once constructed could be used to re-write the compiler in it's own language, to be compiled and shipped.

    But for security reasons, it's unwise to discard the lower-level language implementation. In the article "Reflections on Trusting Trust", Ken Thompson described how a self-replicating trojan might be added to a compiler. But if you have a compiler for your language in some widely implemented lower-level language, there are ways to ensure that the compiler is free of a Thompson trojan.

    The first step is to ensure you have a trojan-free compiler for the lower-level language. This can be done through a method that David A. Wheeler called "diverse double-compiling": repeating the bootstrap process on two or more independent implementations of the language and comparing the resulting binaries. For example, compile GCC using Clang, MSVC, and old GCC. This gives you three different GCC binaries, containing different sequences of instructions but ideally with the same behavior. Then compile GCC using each of the resulting GCC binaries. The results should be identical because in the second step, you're compiling GCC with GCC each time. If they differ other than in timestamps, there's a compiler bug, if not a flat-out trojan. If they're the same, then either they're all clean or they all independently implemented the same trojan.

    The second step is use a compiler verified as clean through DDC as a stepping stone toward a clean compiler for the target language. For example, you might use old GCC to compile the last version of g++ written in C (before the switch to C++), then use old g++ to compile modern g++. Or you might compile an OCaml compiler written in C, and then use that to compile the old Rust compiler written in OCaml, and finally use that to compile the modern Rust compiler.

    But these methods to establish the lack of a Thompson trojan in a compiler will not work if the only publicly available implementation of a language is written in that same language.

    1. Re:Don't discard the lower-level compiler though by Yaztromo · · Score: 1

      But these methods to establish the lack of a Thompson trojan in a compiler will not work if the only publicly available implementation of a language is written in that same language.

      Thanks for adding this -- it is certainly an interesting area of research.

      However, I'm having a hard time finding much in the way of practical use of Wheeler Diverse Double Compiling technique. I found a single reference that GCC has a build switch that can do this, but that's about it. I haven't been able to find any details as to any other compilers that actually use DDC in practice. After all, the thrust of Thompson's talk was that at some point you have to have some level of trust in the software you run.

      Besides which, I was responding to the claim that "most compilers are written in C". DDC doesn't specify any specific language for either of the compilers used in the initial pass; Wirth (for example) is quoted as saying the initial Pascal compiler was written in FORTRAN (Pascal is now self-hosting in most implementations, although Wikipedia notes that GCC Pascal is an exception, being written entirely in C and not self-hosting, which leads me to assume they don't use DDC at all, and the compiler can't compile itself). DDC is thus not an argument for "most compilers are written in C", as firstly it pre-supposes that the initial compiler was written in C (which is debatable with many counter-examples), and secondly that even when DDC is conceivably used, the end result is a self-hosted compiler, and that is what is shipped to users (i.e.: DDC is only used as a verification step, and doesn't determine or affect the shipping compilers compiler). I suppose the only logical caveat to that would be a self-hosting C compiler, which, by virtue of being self-hosting, would indeed be compiled in C.

      Yaz

  80. Yes. by thisisauniqueid · · Score: 1

    Finally, an exception to Betteridge's Law of Headlines.

  81. Re:A poor craftsman blames his tools. (Oops!) by lucien86 · · Score: 1

    Its the point where you realize that machine code is too high level that you really realize THAT you are in trouble. The solution (as ever) is Verilog. :D

    --
    Below the speed of light Special Relativity is one of the most accurate theories in physics - above the speed of light..
  82. Transitive DDC verification by tepples · · Score: 1

    Pascal is now self-hosting in most implementations, although Wikipedia notes that GCC Pascal is an exception, being written entirely in C and not self-hosting, which leads me to assume they don't use DDC at all, and the compiler can't compile itself

    If you use a DDC-verified C++ compiler to build any GCC language, such as GNU Pascal, and you've combed the source code of GCC for trojans, then the resulting compiler is by extension DDC-verified because the compilation process's only inputs are GCC's source code and a DDC-verified compiler. The important part with respect to avoiding Thompson trojans is to make sure that there's a chain of implementations in publicly available source code form from a widely implemented language to any given language, even if it does have to pass through (say) old GCC, new GCC, OCaml, old Rust, and new Rust.

  83. Re:Software isn't enough, hardware must change by david_thornley · · Score: 1

    Thanks - I completely don't remember that from my 360 assembler days.

    --
    "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes