Slashdot Mirror


Criticizing the Rust Language, and Why C/C++ Will Never Die

An anonymous reader sends an article taking a harsh look at Rust, the language created by Mozilla Research, and arguing that despite all the flaws of C and C++, the two older languages are likely to remain in heavy use for a long time to come. Here are a few of the arguments: "[W]hat actually makes Rust safe, by the way? To put it simple, this is a language with a built-in code analyzer and it's a pretty tough one: it can catch all the bugs typical of C++ and dealing not only with memory management, but multithreading as well. Pass a reference to an assignable object through a pipe to another thread and then try to use this reference yourself - the program just will refuse to compile. And that's really cool. But C++ too hasn't stood still during the last 30 years, and plenty of both static and dynamic analyzers supporting it have been released during this time."

Further, "Like many of new languages, Rust is walking the path of simplification. I can generally understand why it doesn't have a decent inheritance and exceptions, but the fact itself that someone is making decisions for me regarding things like that makes me feel somewhat displeased. C++ doesn't restrict programmers regarding what they can or cannot use." And finally, "I can't but remind you for one more time that the source of troubles is usually in humans, not technology . If your C++ code is not good enough or Java code is painfully slow, it's not because the technology is bad - it's because you haven't learned how to use it right. That way, you won't be satisfied with Rust either, but just for some other reasons."

266 of 386 comments (clear)

  1. Pretty sure the heat death of the universe will by NotDrWho · · Score: 5, Funny

    No, I'm pretty sure the heat death of the universe will kill those languages

    --
    SJW's don't eliminate discrimination. They just expropriate it for themselves.
    1. Re:Pretty sure the heat death of the universe will by mark-t · · Score: 3, Insightful

      I predict that as heat-death approaches, time will slow down, and by the point of heat death, time will be at a complete standstill, much like approaching the event horizon of a black hole, so from its own frame of reference, the universe will actually seem to last forever.

    2. Re:Pretty sure the heat death of the universe will by LWATCDR · · Score: 1

      Once you have X amount of software written in a language the language will never die.
      Fortran, Cobol, c, c++ will probably never die.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    3. Re:Pretty sure the heat death of the universe will by IgnitusBoyone · · Score: 1

      Cobol is in attrition as far as most of the world is concerned. The starvation may take a while, but its occurring. Fortran is link compatible with C and to many actively maintained simulations are based on it. Fortran will be around for at least as long as C is around. It will take generations of programmers to abandon C++ before that becomes a reality a honestly what takes over will likely be a certified subset of C++ that is considered safer and easier to work with.

      --
      Momento Mori
    4. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 1

      The reality is that as long as there is an established code base that can be reused, libraries, etc it will be hard to displace older programming languages barring a major change in the hardware the code runs on.

    5. Re:Pretty sure the heat death of the universe will by antiperimetaparalogo · · Score: 1

      Once you have X amount of software written in a language the language will never die. Fortran, Cobol, c, c++ will probably never die.

      Good... Java needs some of its oldest rivals to mock!

      --
      Antisthenes: "Wisdom begins by examining the words/names." - excuse my English, i am (slightly...) better with my Greek!
    6. Re:Pretty sure the heat death of the universe will by LWATCDR · · Score: 1

      "Cobol is in attrition as far as most of the world is concerned."
      Old working code has a huge advantage over a rewrite... It works.
      You may be shocked how much effort people will make to keep old software running.
      http://www.comwaretech.com/PDP...
      http://www.dbit.com/

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    7. Re:Pretty sure the heat death of the universe will by goose-incarnated · · Score: 2

      Cobol is in attrition as far as most of the world is concerned. The starvation may take a while, but its occurring. Fortran is link compatible with C

      Are you sure? FooBar() and foobar() are different functions in C but the same function in Fortran, so calling foobar() from C in a fortran-compiled libfb.so is probably not going to have the effect you intended if both FooBar() and foobar() are present in libfb.so, if it is even possible at all (name-mangling might be happening).

      (My fortran may be a little ancient - do newer fortran compilers make a distinction between case?)

      and to many actively maintained simulations are based on it. Fortran will be around for at least as long as C is around. It will take generations of programmers to abandon C++ before that becomes a reality a honestly what takes over will likely be a certified subset of C++ that is considered safer and easier to work with.

      Nothing is going to take over from C; it's way too foundational :-(

      Whether you are writing C++, Fortran, Java, Python, Perl, Go, Rust, PHP, CLISP, guile, C#, ... hell even bash[1]... every single language out there is able to make use of a *.so library, but not all of them can generate one! When it comes to code reuse, C wins hands down. If you want your code/logic/algorithm to be reusable you write it in C.

      C++ code can only be called by other C++ code. Same with Java, Python, etc. C code, OTOH, can be called by every single thing living on your system so while your system may only slightly notice if the programs written in other languages go away, your system won't even boot if C code isn't around in the form of system libraries.

      Way too foundational to remove, which is a pity as it should have been superceded years ago with something better.

      [1] I wrote a small utility that loads and executes a specified function in a specified library with specified arguments. This lets my bash scripts execute anything in the C std. library and whatever other *.so files I have on my system. So from bash I can run sinf/cosf functions, make a few system calls, etc. It's very limited, can only return primitive data types to the caller and needs extensive specification on the command line, but it lets me do the occasional insane thing.

      --
      I'm a minority race. Save your vitriol for white people.
    8. Re:Pretty sure the heat death of the universe will by bobbied · · Score: 1, Interesting

      Cobol is in attrition as far as most of the world is concerned. The starvation may take a while, but its occurring. Fortran is link compatible with C and to many actively maintained simulations are based on it. Fortran will be around for at least as long as C is around. It will take generations of programmers to abandon C++ before that becomes a reality a honestly what takes over will likely be a certified subset of C++ that is considered safer and easier to work with.

      No way... Give me ANSI C over C++ ANY day. C++ was a really bad thing to do to C and IMHO was a mistake (although a mistake I would likely have made at the time). Literally ANYTHING you can do in C++, you can do in C and skip the hokey compile time Object Oriented stuff that really was only halfway implemented anyway and really just shoe horned into an already error prone language. Don't get me wrong, I make a living writing C++ code and previously did the same in C, it's just that trying to force OO into C code was not a good idea. They should have gone with something totally new (say Java) instead of adapting C to do OO.

      I say this to explain that I think C is/should actually be the language of choice when doing the low level stuff. As such C will live on in kernels, protocol stacks and device drivers. There really is no other viable choice at this point. I see no pressing reason for another low level language, at least without a wholesale change in the underlying hardware architecture, where we move from pure "digital logic" so something else. C is here to stay but for C++ I'm not as sure. I suppose it will be around for a long time yet, but I don't see that it out lives just plan C. C++ is much more likely to be replaced and as such, I'm guessing it will be, C though will outlive everything.

      --
      "File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
    9. Re:Pretty sure the heat death of the universe will by serviscope_minor · · Score: 4, Informative

      C++ code can only be called by other C++ code.

      My JNI plugin written in C++ disagrees with you. That's a .so compiled from C, called by Java. If you write functions in C++ as extern "C", then they are link compatible with C and therefore callable by anything.

      --
      SJW n. One who posts facts.
    10. Re:Pretty sure the heat death of the universe will by mirix · · Score: 2

      I'm pretty sure heat death was programmed in C.

      --
      Sent from my PDP-11
    11. Re:Pretty sure the heat death of the universe will by serviscope_minor · · Score: 4, Insightful

      What the fuck are you talking about? It doesn't compile C++ code as C, it compiles C++ functions with C linkage conventions. IOW it disables name mangling.

      That is all.

      Come to think of it, I think I've argued with you about C++ before. From what I recall you are both astonishingly ignorant and astonishingly angry. A quite entertaining combination if I may say so myself!

      --
      SJW n. One who posts facts.
    12. Re:Pretty sure the heat death of the universe will by mark-t · · Score: 1

      So wait... the universe will end in 2038?

    13. Re:Pretty sure the heat death of the universe will by viperidaenz · · Score: 1

      No, it will just reset to a previous point in time.

    14. Re:Pretty sure the heat death of the universe will by Immerman · · Score: 1

      Then how do we know that it hasn't already happened?

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    15. Re:Pretty sure the heat death of the universe will by buchner.johannes · · Score: 3, Informative

      I predict that as heat-death approaches, time will slow down, and by the point of heat death, time will be at a complete standstill, much like approaching the event horizon of a black hole, so from its own frame of reference, the universe will actually seem to last forever.

      Sounds like you don't understand time dilation. When you approach a black hole, time does not go at a different rate for you. It does however go at a different speed compared to an observer at a large distance (that's why time is *relative*). For them, all objects falling towards a black hole actually seem to pile up near the event horizon (but gravitational redshift and time dilation make the radiation gradually unobservable). For the person falling in, nothing changes, they just fall through.

      To summarize, time never slows down, it may only slow down in one place compared to another place. You did not specify two places so your statement does not make any sense.

      --
      NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
    16. Re:Pretty sure the heat death of the universe will by Immerman · · Score: 1

      And? Literally anything you can do in ANY language can be done in assembler. Or even in raw machine code. All the language does is to make some logical constructs easier to implement. In the case of C++, or in it's original incarnation "C with Classes", it added many of the major benefits of OOP to C, without sacrificing performance or compatibility. After all there were already object oriented languages around - Stroutrup created C++ after being impressed with Simula as a language, but disappointed in the performance. Remember, we're talking 1980 here - the 4.7MHz 8088 had only just hit the market. 64kB of RAM was generous, and Java would have been so crushingly slow and memory intensive as to be completely useless.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    17. Re:Pretty sure the heat death of the universe will by penguinoid · · Score: 1

      No, I'm pretty sure the heat death of the universe will kill those languages

      I'm naming my next programming language Entropy.

      --
      Don't waste your vote! Vote for whoever you want, unless you live in a swing state it won't matter anyways
    18. Re:Pretty sure the heat death of the universe will by Blaskowicz · · Score: 1

      I'd be very concerned that my feet get time dilated at a faster rate than my head, if I'm going feet first in. If plain old dislocation isn't enough I mean.

    19. Re:Pretty sure the heat death of the universe will by AndroSyn · · Score: 3, Insightful

      Just because a piece of software is old, doesn't mean it's suddenly doesn't do its intended function.

      I'm not sure I'd be shocked by the effort that people make to keep old software running,. You mention PDP emulators, but how many people here use DOSBox on a regular basis to play old games.

      Emulators are just one way do keep old software running of. The other way if the source is around is to keep updating the software for new platforms but avoiding too much feeping creaturism if you can. That's pretty much where I'm at with doing ircd work, keep the code updated for modern systems(with their own OS specific quirks) so it continues function.

      It seems like people just want new and shiny software just for the sake of having new and shiny. New and shiny code however doesn't have X number of years of being used as production and all of the WTF bugs have long been squashed.

      Meh.

    20. Re:Pretty sure the heat death of the universe will by radtea · · Score: 2

      Are you sure? FooBar() and foobar() are different functions in C but the same function in Fortran, so calling foobar() from C in a fortran-compiled libfb.so is probably not going to have the effect you intended if both FooBar() and foobar() are present in libfb.so, if it is even possible at all (name-mangling might be happening).

      I was writing Fortran/C multi-language applications twenty years ago, so yeah, despite a few issues this is easily possible. There was some weirdness, as I recall, because Fortran implicitly pushed the size of arrays onto the stack, so you had to do some fiddling to accommodate them. There were a few other minor issues, but what the GP said is essentially correct: Fortran is link-compatible with C. C++ mangles names, so unless functions are declared with C linkage (extern "C") all bets are off.

      Pretty much any language can be interfaced with any other using tools like swig (dunno if anyone still uses that--it's been almost 10 years since I wrote any multi-language code, thankfully).

      --
      Blasphemy is a human right. Blasphemophobia kills.
    21. Re:Pretty sure the heat death of the universe will by Narcocide · · Score: 1

      All of this has happened before, and all of it will happen again.

    22. Re:Pretty sure the heat death of the universe will by binarylarry · · Score: 1

      pff everyone knows the universe was written in perl.

      --
      Mod me down, my New Earth Global Warmingist friends!
    23. Re:Pretty sure the heat death of the universe will by LostMyBeaver · · Score: 1

      Yup.. I personally adore hand optimizing string functions when developing large performance insensitive applications too.

      The true problem with C programmers is their crap coding styles. Even "clean" C code looks like 900 lines to do what C++ does in 20.

      C++ has definitely outlived its "useful for new projects phase". C++ sucks because of its ABI issues and it's disgusting standard library.

      Let's start a Microsoft bash fest... those jerks decided to slowly move to managed code which allows all languages to call all languages. Even better, they proved you can write an OS kernel in it.

    24. Re:Pretty sure the heat death of the universe will by rioki · · Score: 1

      I am not sure. I think C will even survive that...

    25. Re:Pretty sure the heat death of the universe will by davester666 · · Score: 1

      It'll be a dry heat, so, yeah, it'll seem like time just drags on and on.

      --
      Sleep your way to a whiter smile...date a dentist!
    26. Re:Pretty sure the heat death of the universe will by MrDoh! · · Score: 1

      Moments before it all stops, HL3 running on Hurd.

      --
      Waiting for an amusing sig.
    27. Re:Pretty sure the heat death of the universe will by Chrisq · · Score: 1

      No, I'm pretty sure the heat death of the universe will kill those languages

      By then we will have learned how to send a C++ specification through a spinning black hole

    28. Re:Pretty sure the heat death of the universe will by TheRaven64 · · Score: 1

      Just because a piece of software is old, doesn't mean it's suddenly doesn't do its intended function.

      It usually does, because the intended function changes over time. This is particularly true for business software (COBOL's niche), where regulatory requirements change over time and as companies grow to cover more jurisdictions, where accounting best practices change, where the company structure changes, and so on. Eventually you get to the point where the software was originally designed to do something so totally different to what it's doing now that it may make more sense to rewrite it than to keep adding hacks.

      --
      I am TheRaven on Soylent News
    29. Re:Pretty sure the heat death of the universe will by TheRaven64 · · Score: 1

      While this works as far as it goes, it restricts your library boundaries to POD types with no templates and no overloading. This doesn't completely defeat the point of using C++, but it does mean, for example, that you have to fall back to C-style memory management (no std::shared_ptr / std::unique_ptr, which modern C++ libraries should be using for pretty much anything that crosses an API boundary).

      --
      I am TheRaven on Soylent News
    30. Re:Pretty sure the heat death of the universe will by Zappy · · Score: 1

      So say we all

    31. Re:Pretty sure the heat death of the universe will by jeremyp · · Score: 1
      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    32. Re:Pretty sure the heat death of the universe will by gbjbaanb · · Score: 1

      the problem there is that if you link your C++ binary with, say, a python application, it will not be able to use things like std::shared_ptr anyway.

      In these cases, the boundary should be defined to some limited standard, in much the same way a webserver REST API is defined (ie as a firm boundary between 2 heterogenous systems)

      So while a standardised ABI would be awesome, it wouldn't be able to support everything for every language. At least it'd allow us to compile C++ binaries without 'extern C', and link C++ binaries regardless of the compiler used to generate them. Just those 2 would be sufficient improvements to warrant it IMHO. Stroustrup disagrees unfortunately.

    33. Re:Pretty sure the heat death of the universe will by gbjbaanb · · Score: 1

      yep, I love StringBuilder classes too.

      Managed languages are dying - since Microsoft decided to AOT compile them and migrate the entire .NET framework to native code (yes, it still looks the same, but all those functions you call in it are native now, or soon will be for the WinRT API that comes with Windows 10)

      Just read the hype from Microsoft about how much faster and generally wonderful their latest native .NET is, ... you'd almost think they were lying when they told us how wonderful the old managed version was!

      Mind you, the ABI they have now in WinRT is based on COM!

    34. Re:Pretty sure the heat death of the universe will by serviscope_minor · · Score: 1

      While this works as far as it goes, it restricts your library boundaries to POD types with no templates and no overloading. This doesn't completely defeat the point of using C++, but it does mean, for example, that you have to fall back to C-style memory management (no std::shared_ptr / std::unique_ptr, which modern C++ libraries should be using for pretty much anything that crosses an API boundary).

      Not quite: you can represent complex C++ types which are internal to the library as opaque void* types to the C API. In C11 you can get limited overloading with the _Generic macro :), but yes, fundementally, C doesn't support that. You can re-insert overloading when you go from another higher level language (e.g. Python) back down to the C API.

      As for memory: yes. If you're going C++ to C++ you should absoloutely use smart pointers. Beyond that it's not clear (API design and foreign language interfacing is kinda expert only): something has to manage the lifetime of objects.

      Going to a foreign API (C in this case) implies two languages, both of which have different ideas how lifetime is managed. It's not clear what the right soloution is there, really.

      --
      SJW n. One who posts facts.
    35. Re:Pretty sure the heat death of the universe will by serviscope_minor · · Score: 1

      Just those 2 would be sufficient improvements to warrant it IMHO. Stroustrup disagrees unfortunately.

      The C++ committee have correctly decided to not do this, because it would be a futile effort, no matter the theoretical advantages. On Linux, C++ compilers all use the Itanuim ABI. On Windows, they all use the VS ABI. Those two are fundementally very different. The Itanium ABI has much more efficient exceptions, the VS ABI has much more flexible exceptions. Neither group is ever going to switch no matter what the C++ committee says.

      The C++ committee doesn't like doing stuff where the standard isn't going to be ever supported, because it makes the standard pointless.

      But backing up, that actually means that all the major platforms do in fact have platform standard ABIs. There's the Windows one and the Itanium one, which are supported by the majority of platforms. Embedded platforms don't necessarily support it, but they're non hosted platforms anyway, and there's no way the committee would enforce an ABI for an unhosted platform, because it makes no sense to do so.

      --
      SJW n. One who posts facts.
    36. Re:Pretty sure the heat death of the universe will by LWATCDR · · Score: 1

      " Eventually you get to the point where the software was originally designed to do something so totally different to what it's doing now that it may make more sense to rewrite it than to keep adding hacks."

      Adding new features to a system does not mean adding hacks. Every system grows in features over time. It takes a lot to make rewriting from scratch to be the best solution.
      For example how old is Linux?

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    37. Re:Pretty sure the heat death of the universe will by bobbied · · Score: 1

      The true problem with C programmers is their crap coding styles. Even "clean" C code looks like 900 lines to do what C++ does in 20.

      When will you newbies figure out that it's not how many lines of code it takes to do something, but how well you can understand what's happening by reading the code. In a well designed implementation, I'll bet that if you look at the 900 lines of C, you will find that there are about 20 lines of code that look almost EXACTLY the same as the C++ program. PLUS, it will run faster and you will be able to figure out *exactly* what it does. In C++, with all the OO garbage, sometimes it is not so clear how the compiler decided to implement that expression with mixed types in it.

      --
      "File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
    38. Re:Pretty sure the heat death of the universe will by bobbied · · Score: 1

      I pretty much agree, and as I said, I would have made the same "mistake" that I think C++ was. OO was in it's infancy, literally everybody was on the C bandwagon because of the limitations of COBOL and FORTRAN and Microsoft hadn't yet taken over the world. However, I think it was a mistake to adapt C into C++ and it still is. We should have invented a language and standard libraries that enforced type safety and made memory management less of an issue for OO work. Having this backward compatibility with ANSI C really was (and remains a mess) and all this OO stuff just doesn't fit in a language that supports access though pointers which simply cannot maintain type safety. They should have been different languages..

      --
      "File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
    39. Re:Pretty sure the heat death of the universe will by david_thornley · · Score: 1

      No, you're not going to have to worry about that at all. By the time it makes any difference, you'll have been spaghettified by tidal forces, and you won't be concerned with what's left of your body (a long thin mist?) anymore.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    40. Re:Pretty sure the heat death of the universe will by david_thornley · · Score: 1

      I don't see why Java is any better as an O-O extension to C than C++. It cleans up some C syntax (although not switch fallthrough) and provides garbage collection, which is useful but unrelated. It takes a Smalltalk-like approach to objects, making everything except primitives descend from Object, and I'm not at all convinced that that's better than the C++ practice of making inheritance trees as shallow as possible. Aside from that, it functions much like a limited C++ with different names for things. Why do you think it's a better extension?

      Are you just more fond of the Smalltalk model than the Simula model of O-O? C with Classes is specifically a marriage of Simula O-O to C, while Smalltalk extended the O-O idea in its own way. C++ and Smalltalk are siblings in their O-O models.

      C++ is much more than C with Classes, also, and should be judged on that basis. Its template system and standard library make it better than C for some things, even in pretty basic code.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    41. Re:Pretty sure the heat death of the universe will by Immerman · · Score: 1

      You can bypass the type safety on pretty much any language that doesn't do runtime type checking - which imposes a massive performance overhead by C standards. General-purpose memory management similarly comes in two flavors: manual, or some sort of high-overhead garbage collector. The hardware of the time simply didn't have the available resources to be thrown away on such things - if you wanted them you had Simula and other such "toy" languages that offered nice features at the expense of being so slow you couldn't do any serious work on them.

      I do agree that C++ would have benefited from removing some aspects of backward compatibility, or at least had standard compiler warnings available for "deprecated" C functionality. But had they broke backwards compatibility C++ would likely have never taken off - it rose to prominence in large part specifically because it was interoperable with the massive existing C codebase and libraries.

      Besides, it's not like modern languages don't have huge holes of their own. I mean Java? Ugh, the performance penalties of having *every* damn thing be a pointer. And I cant even specify that my function definitely won't modify the parameters being passed to it! And how many people go to the trouble (and performance expense) of passing copies of large objects that absolutely must not be modified? "final Thing x" is only equivalent to C's "Thing * const x" - doesn't guarantee a thing as far as the calling context is concerned.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    42. Re:Pretty sure the heat death of the universe will by gbjbaanb · · Score: 1

      What has all that got to do with how one compiler (or script engine) can link or call methods in a binary produced by a different compiler?

      If you just mandated a standard name mangling you'd be 80% of the way there - the remaining bits are types, and typically you're not going to get far unless you define a subset of all possible types, probably using C types with struct and class layouts defined.

      Nobody is suggesting we compile a binary for one platform and be able to run it on another - no x86 PE is going to be usable on a x86 ELF for example.

      Anyway: some reading for you

    43. Re:Pretty sure the heat death of the universe will by bingoUV · · Score: 1

      And I cant even specify that my function definitely won't modify the parameters being passed to it

      Yes, that would be great. But C, C++, Fortran, Perl also don't have it. Lisp and Haskell only get around it by being functional.

      Which popular language have this feature?

      --
      Bingo Dictionary - Pragmatist, n. A myopic idealist.
    44. Re:Pretty sure the heat death of the universe will by Immerman · · Score: 1

      Sure it can. In C and C++ you can *specify* that using pass by value, or by pointer to constant object. Granted it's still *possible* to cast away constness, but only reckless idiots do such a thing without being really, really sure it's safe to do so. And so long as you don't jump through hoops to eliminate const-ness you're protected from accidentally changing something that was supposed to be unmodifiable.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    45. Re:Pretty sure the heat death of the universe will by lsatenstein · · Score: 1

      Just because a piece of software is old, doesn't mean it's suddenly doesn't do its intended function.

      I'm not sure I'd be shocked by the effort that people make to keep old software running,. You mention PDP emulators, but how many people here use DOSBox on a regular basis to play old games.

      Emulators are just one way do keep old software running of. The other way if the source is around is to keep updating the software for new platforms but avoiding too much feeping creaturism if you can. That's pretty much where I'm at with doing ircd work, keep the code updated for modern systems(with their own OS specific quirks) so it continues function.

      It seems like people just want new and shiny software just for the sake of having new and shiny. New and shiny code however doesn't have X number of years of being used as production and all of the WTF bugs have long been squashed.

      Meh.

      I guess we will soon have to do that same thing to the desktop Linux, when Microsoft comes out with Windows 10.999

      I for one see the Linux desktop as becoming a click-centric user interface. Gone is the terminal or console. and that click-centric interface with touch screens will obsolete the terminal. Sadly, Gnome's development is purely a payer development approach, and development does not respond to what end-users require.

      I am hopefull that a new paradigm will arise where we will put together our own interface via a copy and past facility. Don't like a feature within ABC? Swap it out with one you do like.

      --
      Leslie Satenstein Montreal Quebec Canada
    46. Re:Pretty sure the heat death of the universe will by cwsumner · · Score: 1

      What you say about how well-maintained the old software is, is true. Good programming can extend the life of programs a lot.

      But the ideas about "throwing away the old stuff" have been around at least since Assembler language, and it is often an excuse for lazyness. When anyone encounters something really new to them, it causes what the psychologists call "Learning Frustration". People that can't endure frustration will clutch at any way to avoid learning things, and they often have the idea that if they write it new it will be less frustrating.

      This can result in the loss of the only documentation of what really needs to be done, i.e., the old source code. The "specs" are never correct and seldom even updated to the last version of the software. The managers seldom know exactly what is being done. The specs you are given new, are wrong. The only way to detect the errors, is to know what is being done in the old program.

      Bottom line: You have to learn the old code just to be able to successfully write new code. And by then it is usually less time to update the old code. (If the term "update" includes perhaps converting to new languages.) Or at least, then you can make a rational decision about whether to use the old code.

      Sometimes, the hard way is actually the easy way! 8-)

  2. An Old Story by evenmoreconfused · · Score: 3, Insightful

    "... but the fact itself that someone is making decisions for me regarding things like that makes me feel somewhat displeased. C++ doesn't restrict programmers regarding what they can or cannot use."

    That's exactly what I said about C vs. 360/Assembler 25 or more years ago. And I still prefer to code in Assembler.

    --
    No. Well...maybe. Actually, yes. It really just depends.
    1. Re:An Old Story by evenmoreconfused · · Score: 4, Funny

      Sorry, I realize it's 35 years ago. You can blame it on senility.

      --
      No. Well...maybe. Actually, yes. It really just depends.
    2. Re:An Old Story by Dunbal · · Score: 4, Insightful

      And I still prefer to code in Assembler.

      There are all sorts of tools, many of them specialized and great for certain applications. But sometimes you just can't beat a sledgehammer. ASM, C, and to some extent C++ have a bad rep because of their lack of training wheels. But in the right hands they are the best and fastest solution to a problem. Plenty of people code, and plenty more people think they can code. Someone who knows what they are doing will not get into trouble in ASM, much less in C or C++. But there are lots of people who claim they know what they are doing when actually they know squat. They get "unintended results" when actually the language is doing exactly what they asked it to do - the problem exists in their understanding of how computers work. Yeah, maybe THOSE people should avoid these languages.

      --
      Seven puppies were harmed during the making of this post.
    3. Re:An Old Story by RailGunner · · Score: 2

      If I wasn't permanently blacklisted from getting mod points, I'd mod you up.

      Don't blame the tool, blame the user. A chainsaw is dangerous, but if I'm clearing brush or cutting tree limbs blown down by a storm, it's the best tool for that job. If I cut off my foot with it, is it the chainsaw's fault?

    4. Re:An Old Story by Actually,+I+do+RTFA · · Score: 1

      C++ doesn't restrict programmers regarding what they can or cannot use.

      C++ doesn't, but every reasonably large project has coding standards that do. I've often wanted to have a language that wouldn't compile unless it met my standards...

      --
      Your ad here. Ask me how!
    5. Re:An Old Story by mr_mischief · · Score: 3, Insightful

      The best reason for avoiding assembly is that it's almost never the fastest way to get the programming done, and with a good C compiler it may not be the fastest way for the program to run, either. Assembly is great for bootstrapping a compiler or OS and inside tight loops. It can be handy if your hardware has an advanced feature not yet exposed through a library for a higher-level language. Not everything needs it, though.

      Even C or C++ is often not the fastest way to get a project done. Sometimes there's a pretty big runtime penalty for using something that enables faster development, though.

      There are lots of cases out there of Lua, Python, or some other language being used to wrap around a small core of C or C++ with maybe the most time-critical parts in assembly. Sometimes a higher-level language is the right tool for the situation, but sometimes not.

    6. Re:An Old Story by RailGunner · · Score: 1, Flamebait

      My table saw has a removable shield for when I'm working with something other than a typical pine board.

      Band saws and jigsaws typically do not contain shields, as they're used for curved cuts.

      There is an inherent danger to most tools, and why training on how to properly use that tool is important.

      Programming Languages are tools. If you don't understand how to use the tool, the tool can be destructive.

      Now I know why you didn't log in, you didn't want your stupidity broadcast to the world.

    7. Re:An Old Story by vux984 · · Score: 2

      But in the right hands they are the best and fastest solution to a problem.

      Sure. Provided the "right hands" acknowledges that they are not usually the the right solution to a problem chosen at random.

      Plenty of people code, and plenty more people think they can code. Someone who knows what they are doing will not get into trouble in ASM, much less in C or C++. But there are lots of people who claim they know what they are doing when actually they know squat.

      Sure those completely worthless people do exist and most developers do overestimate their own abilities.

      Q: Do you know how many really good ASM/ C / C++ devs are out there that you wouldn't dream of saying that they "don't know squat" that still produce and release code with subtle to obvious bugs in it?

      A: All of them.

      Yeah, maybe THOSE people should avoid these languages.

      Nobody is perfect. And nobody gets better at something by not doing it. You learn by doing.

      I agree some developers simply shouldn't be developers, and that others are way out of their proper depth. But no developers live up to your standards. Unintended things affect all of us; edge cases we didn't consider, api/library/hardware specs we didn't fully or correctly understand but thought we did, requirements we didn't fully or correctly understand but thought we did... that affects all of us.

    8. Re:An Old Story by phantomfive · · Score: 1

      Why should skill and table saws have a shield at all?

      Plenty of carpenters pin back the shield on their skill saw.
      I sure wouldn't. I'd cut off my leg.

      --
      "First they came for the slanderers and i said nothing."
    9. Re:An Old Story by phantomfive · · Score: 2

      Even C or C++ is often not the fastest way to get a project done........There are lots of cases out there of Lua, Python, or some other language being used

      In my experience, the availability of libraries is more important than language choice in getting the job done quickly.
      That is, if you had all the libraries you need, assembly would be faster than Perl/Python/Scheme without the libraries you need. Of course, there are not many libraries written in assembly.

      --
      "First they came for the slanderers and i said nothing."
    10. Re:An Old Story by saigon_from_europe · · Score: 2

      I've often wanted to have a language that wouldn't compile unless it met my [coding] standards...

      Hush! That's how we got Python!

      --
      No sig today.
    11. Re:An Old Story by goose-incarnated · · Score: 2, Insightful

      C++ doesn't restrict programmers regarding what they can or cannot use.

      C++ doesn't, but every reasonably large project has coding standards that do. I've often wanted to have a language that wouldn't compile unless it met my standards...

      Coding standards won't save you. How often have you come across something like this in other's code?

      QString qs;
      ...
      char *filename = qs.toStdString().c_str();

      (Might not even be QString getting abused here - might be something vendor provided).

      The problem with C++ is not the extra complexity thrown in by the standards committee to save a few keystrokes, it's the opacity of the source code. It requires the user of a library to know implementation details of that library, but the source code using that library will hide every single implementation detail that could fuck you up.

      The stl container libraries (for example vector) is used identically to hold complex classes (deep pointers) and to hold PoDs (say, int types). The source code, and all the code around the lines using the vector will look exactly the same, but alas - too many newbies get caught out when they try storing objects with deep pointers and no copy constructors. How can you tell the difference? You can't tell simply by looking at the lines using the vector. You have to look at the lines of code that define the class - very leaky abstraction indeed. So paper over it, tell students to use only references (or pointers) in containers and make sure that using an stl container is only done when you know how the elements you intend to store are implemented.

      C++ is filled with invisible gotchas, booby traps for the unwary and multiple poor choices for OO implementation (I blame the backwards compatibility with C for this). Before they add stuff to C++ they should have removed stuff from it; for example the default copy constructor provided by the compiler should make deep copies of objects and not bitwise copies. If that were to be done then no copy constructor would be needed. Another example, why not specify the order of file-scope object construction within multiple compilation units? How about this for a request: if you're going to insist on providing overloaded functions as an option please please please provide the ability to overload using return value - that makes the issue of which cast to use go away.

      A few more C++ requests: discard that outdated default promotion rules from C, make the minimum integer magnitude 'int' and do away with 'char'. The compiler is not catching errors in the line va_arg (ap, char) nor can overloading work correctly with both char and int. With decent overloading and a sane container design you don't need stdarg anyway - pass a container (caller can always use static initialisers if they want to).

      My greatest disappointment with C++ has to be the QT library. They went ahead and actually changed the language, but kept the most insane parts of it. Let's face it - if your dev environment reads in $FOO source files and spits out C++ source files to a C++ compiler, you may as well make your $FOO language something better than "C++ with extra #defines here and there" . What a missed opportunity by trolltech.

      --
      I'm a minority race. Save your vitriol for white people.
    12. Re:An Old Story by meta-monkey · · Score: 1

      How can you have a default deep copy? What about circular references? Plus the potential for massive duplication and logical fragmentation of dependent objects. You're talking about "hidden gotchas," but a default deep copy is no less gotcha-prone than a default bitwise copy.

      Copying (and serializability) should be determined on a class by class basis. Your class can either provide different copy methods, or you should be able to mark it...whatever...Serializable via attributes.

      I hate how much I like C#. They do exactly this. There is no default Object.Copy() for just this reason.

      --
      We don't have a state-run media we have a media-run state.
    13. Re:An Old Story by Darinbob · · Score: 3, Interesting

      Normally training wheels come off once you learn to ride that bike. But in many languages the training wheels are permanent.
      I do wish that more people who call themselves programmers or engineers actually understood how computers work. Then we wouldn't need faster computers every 5 years just to keep running the same programs at the same speed.

    14. Re:An Old Story by Rockoon · · Score: 1

      How can you have a default deep copy? What about circular references?

      Ah, the problem that never was but seems to come up again and again. The real issue is that the language doesnt provide a deep copy semantic, but because of this the common symptom is that people (like you) that try to implement deep copying (because the language lacks it) use a naive algorithm that doesnt handle circular references.

      A deep copy that handles circular references is slower, but the addition cost is constant time because it only needs at most an O(1) lookup and O(1) insert at every node.

      Now the reason that people assume that the "problem" is real arent actually well seated in the algorithm department. If you are puzzled over "lookup" and "insert" in the previous paragraph, that means you.

      --
      "His name was James Damore."
    15. Re:An Old Story by Darinbob · · Score: 1

      The fastest way to get the programming done is not necessarily the best way to get the program done. Programming fast is only important if you've got a tight deadline and you also have room to be sloppy. Even then time should probably be scheduled to go back and fix it up later.

    16. Re:An Old Story by Ukab+the+Great · · Score: 2

      It was actually 31 years ago. And your octal's kinda rusty.

    17. Re:An Old Story by Anonymous+Brave+Guy · · Score: 2

      ASM, C, and to some extent C++ have a bad rep because of their lack of training wheels. But in the right hands they are the best and fastest solution to a problem. Plenty of people code, and plenty more people think they can code. Someone who knows what they are doing will not get into trouble in ASM, much less in C or C++.

      I contend that the entire history of computing disagrees with you and your hypothetical "person who knows what they are doing" does not exist. If you maintain otherwise, please name a large and widely used program written in any of the above languages that has never encountered the kinds of bug that more sophisticated type systems like Rust's prove can't exist.

      Seriously, this article is hosted on a site about a static analyser, whose purpose for existence is to try to identify errors in C and C++ code caused by exactly the kinds of failures you maintain that someone who knows what they are doing won't make. Such tools would be unnecessary if the language design did not admit the possibility of those types of errors in the first place, as is the case with many much safer languages being developed today. This whole piece is basically an attack ad, brought to you by the horse-and-cart drivers who are being made redundant with the invention of the internal combustion engine.

      And even if someone, somewhere in the world is smart enough to use a relatively primitive language like C or C++ and not make any mistakes of this kind, that person would surely be orders of magnitude more productive using a modern, expressive, safe language and modern, comprehensive, flexible libraries so they could focus on solving whatever real problem they were dealing with instead of getting bogged down with writing low-level mechanics and defensive programming manually.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    18. Re:An Old Story by Dutch+Gun · · Score: 2

      C++ isn't about productivity. It's really about performance. If your application isn't performance-critical, you probably don't have a good reason to be using C++. And actually, nowadays it's a lot easier to write much safer C++ than previously, especially with recent changes to the language. Overall, the language is a pretty good tradeoff between performance, productivity, and safety, with emphasis on the performance, of course. I'd imagine that's why game developers use C++ almost exclusively, at least for larger AAA games.

      On the other hand, game development tools are often written in languages such as C# (plus a mix of various other languages), because productivity is typically more important than performance for those types of applications (after all, you can just buy faster machines for your developers).

      So... why not write games / game engines in Rust, D, or some other arguably "better" language?

      Simple answer: inertia. Because there's an entire industry's worth of game developers who know C++ extensively (like myself). Our libraries and game engines are all in C++, and are battle-hardened and well-optimized. Who wants to rewrite all of that? Sample code is in C++. Libraries are C or C++. Etc, etc. C++ is often derided for it's flaws, but it's a language that actually gets *used*, and like it or not, being reasonably popular as a language is also a merit. It means that every major platform for which you might want to port a game has a modern C++ compiler and C libraries to link against, and mature debugging development and debugging tools.

      It's kind of a crappy chicken-and-egg problem for new languages to go up against, but that's the reality.

      --
      Irony: Agile development has too much intertia to be abandoned now.
    19. Re:An Old Story by Urkki · · Score: 1

      If a chainsaw doesn't have all the appropriate modern safety features, and you hurt yourself with it in a way which would have been prevented by these features, then it certainly is the fault of the saw, or rather the person choosing to use it. There certainly are some parallels here to programmers and their choice of programming languages. Perceived efficiency with familiar old "trusty" tools and habits trumps long term gains of more modern tools, or even just using modern practices and extras with the old tool.

    20. Re:An Old Story by Urkki · · Score: 1

      I've often wanted to have a language that wouldn't compile unless it met my [coding] standards...

      Hush! That's how we got Python!

      Nah, Python, like any dynamic, duck-typed language, is antithesis of "doesn't compile if not correct". Correctness of Python code rests solely on developers (design of app, reviewing code, having tests, etc), Python itself does not lend a hand in spotting bugs.

    21. Re:An Old Story by Anonymous+Brave+Guy · · Score: 1

      You're absolutely right about inertia in programming ecosystems. There are plenty of fields today that tend to use C++ by default other than games development, simply because there are few if any other mainstream languages that offer the performance, low-level access and native code run-time of C++ without all the downsides.

      That doesn't mean we shouldn't try to overcome that inertia, though. C++ has all kinds of legacy baggage from its C heritage that does no-one any favours in 2015, and it lacks numerous modern programming tools that are widely available in other languages. It's underpowered and error-prone.

      These things do also matter in the real world. I used to love playing games on my PC, but somewhere in the early 2000s literally every AAA title I spent my hard-earned money on for a couple of years would just keep crashing out. It wasn't the PCs or the graphics drivers or the operating system. It was just crappy programming and management then rushing products out the door. And it spoiled my enjoyment so much that I simply stopped playing those big name titles and never went back.

      Of course there will probably always be people who cut corners for commercial reasons, but I don't imagine any of those programmers intentionally dereferenced a null pointer causing the OS to kill their process. It's long past time that even performance-intensive and low-level software was written in languages where that sort of error simply can't happen, and there are easily enough significant applications in the world where these considerations are relevant to achieve critical mass in a new ecosystem. Hopefully Rust will either become a good example of that itself or demonstrate what is possible and lay the groundwork for something else to take over instead.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    22. Re:An Old Story by Urkki · · Score: 1

      My greatest disappointment with C++ has to be the QT library. They went ahead and actually changed the language, but kept the most insane parts of it. Let's face it - if your dev environment reads in $FOO source files and spits out C++ source files to a C++ compiler, you may as well make your $FOO language something better than "C++ with extra #defines here and there" . What a missed opportunity by trolltech.

      Qt does not change C++ language. Qt application code (C++ side) typically compiles with multiple C++ compilers, so not only is it C++, it is often made very compatible/portable C++.

      Qt build process does not read in $FOO source files, it reads in C++ source files, and generates extra source files in addition to the original. The original source file stays there, and can do anything C++ can do. This is a rather critical point, all modern features of C++ are fully usable in Qt apps code, and also support from them tends to be added to Qt (like connecting Qt signals to C++ lambdas). Another very important aspect of being pure C++ is, you can use any C++ tools with Qt C++ code. Debuggers. Static analysis. Any IDE "intellisense" (though Qt Creator does have a few customized features specific to Qt code).

      I am not sure what you actually mean when you imply that Qt should have dropped "most insane parts" of C++, but it sounds like you suggest that Qt should not be a UI framework, it should be a new language of its own (which would then be compiled to intermediate C++ code, which would then be compiled by C++ compiler to machine code, unless someone wrote an actual compiler backend for it)? Creating a new language is an order of magnitude bigger undertaking in all fronts, than just writing a framework for existing language. Language design is hard, and getting people to use new languages is hard. Also, Qt was originally "just a library", so if it changed to "not C++ any more" in some version, it wouldn't really be Qt any more anyway, it would need to be called something else (and see the new version not getting adopted, while old GPL code base would be forked).

    23. Re:An Old Story by gweihir · · Score: 1

      Very much this. The problem is that there are far more bad codes out there than good coders. Combine that with the tendency of incompetent people to overestimate their skill-level (the Dunning-Kruger Effect), and you end up with a lot of people that, when faced with an expert tool like C, wrongly blame the tool for their failure to master it.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    24. Re:An Old Story by gweihir · · Score: 1

      Indeed. I have had excellent results for Python as glue and i/o processor and C classes for the actual heavy-duty work. Of course, that one is not for beginners at all.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    25. Re:An Old Story by gweihir · · Score: 1

      The problem is that the issues tend to pile up over time, and at some point, the only sane thing would be to throw the whole mess away and start over. Usually at that time, the thing is out of warranty (if it ever had one), and the bad but fast coder has been paid and the consequences of sloppiness and incompetence do not reach the one that messed up anymore.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    26. Re:An Old Story by gweihir · · Score: 1

      It is not. It is almost always "save a penny lose a million". The problem is that the million (or usually quite a bit more) is lost later and somebody else has to pay. This is both exceptionally bad management and exceptionally bad engineering.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    27. Re:An Old Story by gweihir · · Score: 1

      The problem is that many coders are not engineers and do not understand what it takes to be one. Excellent understanding of the main tool you work with is mandatory and proper engineering education makes sure students get that. But these days you show CS students a loop over an array that suddenly runs much slower when the array reaches a certain size and you are lucky if one person in the class has an idea that it may be something with the caches.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    28. Re:An Old Story by gweihir · · Score: 1

      This does not even begin to be a balanced argument on your side. "never encountered the kinds of bug that more sophisticated type systems like Rust's prove can't exist" is not a valid expectation. First, the type system of Rust will have bugs by itself and it will let some things through which it should not. These will then be be exceptionally hard to find. And second, all the restrictions Rust puts in place will have people work around them and cause their own brand of problems, which are completely absent from C. In the end it does not matter whether an attacker gets in because of a buffer overflow, or because some rights-determination method just has a logical bug.

      There are however large, security-critical projects done in C that have an excellent track record. The Postfix mailer is one, and OpenSSH is another one. There are more. Hence people that can write secure, reliable and fast software in C clearly exist.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    29. Re:An Old Story by Darinbob · · Score: 1

      I had a boss who would call consultants who program that way as "cowboys". As in, they ride into town, shoot their guns a lot, ride off again into the sunset, and the town folks are left scratching their head wandering what just happened.

    30. Re:An Old Story by gweihir · · Score: 1

      Aptly named. Software engineering theory calls this style of code development the "wild horde"-model.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    31. Re:An Old Story by TheRaven64 · · Score: 1

      C++11 has, for me, made the language tolerable. The old problem of C++ is still there: everyone agrees that you should only use a subset of the language, but no two developers agree on what that subset should be. Now, at least, there are things in the standard library that let you write APIs that have sensible memory management. shared_ptr and weak_ptr let you manage objects that can be aliased (with a small run-time overhead), unique_ptr lets you handle objects that can't be. Refactoring existing C++ APIs to use them takes a bit of time, but they're well worth it. With the addition of move constructors / r-value references to the language they can be implemented in such a way that they can trivially be stored in arbitrary collections, making them actually useful.

      It's also been nice to see C++11 and C++14 supported by compilers and standard libraries quickly. C++14 was supported by Clang and libc++ by the time the standard was ratified by ISO. I think GCC and libstdc++ were only a couple of days later. Microsoft is still the slowest, but the latest versions of their compiler support most of the useful language features.

      --
      I am TheRaven on Soylent News
    32. Re:An Old Story by jeremyp · · Score: 1

      A deep copy that handles circular references is slower, but the addition cost is constant time because it only needs at most an O(1) lookup and O(1) insert at every node.

      Actually, if it requires O(1) for every node then it is O(n) where n is the number of nodes in the object graph, so not constant time.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    33. Re:An Old Story by a_claudiu · · Score: 1

      You should think of them not as training wheels but as safety belts. It does not matter how good you are at driving safety belt should be mandatory even for a F1 driver driving a van.

      You are not upgrading computers to run the same version of the program at the same speed.You are upgrading because you are using a new version of the program which is doing vastly more on an operating system which is able to do vastly more and yes, indeed, some programmers are using a new framework witch makes abstraction layers over abstraction layers to do everything "universal", "reusable" and "future proof".

      I agree that many programmers should now more about under the hood mechanisms but this is valid for everybody, including drivers, plumbers and electricians.

    34. Re:An Old Story by Anonymous+Brave+Guy · · Score: 1

      I'm not sure whether this is a deliberate troll, but I'll play along for now just in case you are actually serious.

      Comparing problems in languages that allow them with the results in languages where the type system prevents them is entirely fair. These kinds of type systems exist precisely to reliably prevent certain classes of programmer error or otherwise undesirable behaviour in the code from ever compiling.

      Yes, there could in theory be a bug in the implementation of such a system, but surely you're not suggesting that the odds of a compiler bug missing such a case due to an error in the implementation of the type system are anywhere close to the odds of a programmer making a similar mistake without the automated tool to help prevent it?

      As for "large, security-critical projects done in C", I agree that Postfix has a decent security record, but sadly it's not exactly a representative example. Leaving aside its relatively small size (it's about 100KLOC of C, with much of it written by a single contributor over an extended period), its priority has always been security and it goes to unusual lengths to guard against typical C problems.

      For example, the Postfix code includes around 1,000 lines to implement its own custom-written variable-length string tools, which its entire codebase then has to use consistently to remain safe. While the project's respect for security is commendable, in numerous other languages with a built-in string type that effort simply wouldn't have been necessary. So in this case "knowing what you're doing" seems to involve completely discarding large parts of how C is usually written in favour of a home-grown safer alternative that emulates what better languages do as standard. Comparable projects that don't go to such extreme lengths and/or have larger codebases and more functionality, such as Sendmail and Exim, do not enjoy the same kind of track record on security, despite also being widely deployed in security-sensitive environments.

      Your OpenSSH example is not so good, because until recently it depended on OpenSSL, which of course has an awful track record for security-related software.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    35. Re:An Old Story by david_thornley · · Score: 1

      Do you know how many really good software devs are out there that you wouldn't dream of saying that they "don't know squat" that still produce and release code with subtle to obvious bugs in it?

      Fixed that for you, or substitute any computer language of your choice for "software". Top developers tend to write significant software, and almost all significant software has bugs. Everybody writes bugs, some subtle, some less so.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    36. Re:An Old Story by david_thornley · · Score: 1

      The safety belts in my car do not interfere with my driving in the slightest. They don't impede anything I should be doing as the driver. They even enhance my ability to drive in extreme conditions by holding me more or less in place.

      Restrictions "for my own safety" in programming languages can hinder my programming. There are things that are best expressed with multiple inheritance, for example (and some languages handle it well). Operator overloading allows the developer to express some concepts clearly. In C++, complex numbers are just a library, not a built-in, and Boost has other numerical types.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    37. Re:An Old Story by david_thornley · · Score: 1

      The real issue is that the language doesnt provide a deep copy semantic

      In C++, deep copies are done in the copy constructors and assignment operators, so the semantics are there. Is there a language that provides specific deep copy functionality? I'm not coming up with one. If so, how do you tell it what stuff should be deep copied and what shouldn't?

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    38. Re:An Old Story by a_claudiu · · Score: 1

      Multiple inheritance is a broad topic. It's needed, but how much and how easy you can avoid it's a matter of balance. Interfaces do it well in Java and C#. You do have some duplicate code but you avoid ambigous calls to methods.

      Operator overloading is a can of worms. Perfect good tutorial are showing complex numbers (and one of the few places you need). Worst gotchas are in c++ overloading operators plus impicit casting. Eg.

      list array;
      list += 2;

      Will add 2 to the list or add an empty list with 2 guaranted spaces to the array? Last time I checked (loong time ago) it was the last. Clean code with a lot of gotchas.

    39. Re:An Old Story by gweihir · · Score: 1

      I am entirely serious about languages not being able to "fix" faulty programmers. And it comes from experience and seeing what stupid mistaken ways people come up with to do things. The people causing buffer-overflow vulnerabilities in C just make other mistakes in other languages, but their code is not one bit more secure there. Things like not checking incoming values but then depending on them having a certain form, error behavior as just to "try it anyways", linking trusted and untrusted code with no extra checking at the interfaces, etc. My point is that people that do not make these mistakes also do not program C code with buffer-overflow vulnerabilities. But in the plus-side, they have a lot more flexibility to do things.

      As to Postfix, maybe these 1000 lines were not necessary in another language, but in the end they will have not influenced the overall project effort to any significant degree. And they will have been exactly what Postfix needs, not some generic compromise. Hence that is not a compelling argument at all. That extra effort may well have been recovered somewhere else. That Exim and in particular Sendmail (or for example Bind) suck at security is not due them being coded in C, it is because of the people working on them. That these are often deployed in security-critical environments does not improve their code quality one bit. It just means the administrator making that decision is also incompetent.

      As to OpenSSH, you are mistaken. It is an excellent example. OpenSSH did never depend on the problematic part of OpenSSL. It always was only dependent on libCrypto and that has no problems in OpenSSL. (In fact I just recently used the version before the current cleanup in a secruity-critical project.) Otherwise OpenSSH would have had security problems as a result. It did not and it is perhaps the most attacked service on Linux right after HTTP. libSSL from OpenSSL is a different story though.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    40. Re:An Old Story by Anonymous+Brave+Guy · · Score: 1

      I think there are several different issues here and perhaps some of our comments are conflating them unfairly.

      Certainly we agree that people who just aren't very good at programming will make mistakes in any language.

      But I also accept that even people who are quite good at programming are still only human and will inevitably make more subtle mistakes from time to time. The software industry as a whole has an awful track record on quality and performance, and there are whole sub-industries dedicated to tools like debuggers and profilers and static analyzers and refactoring aids because programmers make so many mistakes or poor judgements when left to their own devices. Using better tools can help to catch mistakes and make more informed decisions earlier.

      The other major benefit to using those tools is that even if you do have someone outstanding who will code so defensively that there is little that slips through -- as perhaps is the case with the Postfix example -- that always requires a significant amount of effort and compromise -- again as we see with the "safe subset" style of coding used for Postfix. Automating part of the work would have left more time to concentrate on more important and difficult areas like making sure the underlying algorithms are sound in the first place.

      Finally, on OpenSSH/OpenSSL, I know the former only depended on the crypto tools rather than libssl, but it seems you are more trusting than me that despite the terrible record of part of the OpenSSL project the risks are confined to just that specific part of it. Presumably then OpenSSH developers themselves consider this a legitimate concern, given the recent moves to separate the projects entirely.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    41. Re:An Old Story by Darinbob · · Score: 1

      No, generally I upgrade because the old versions aren't available. I'm NOT using the new features, but the whole thing is slower than it was, but on a faster computer it seems the same. It's like there's a speed budget, that apps have to run at a certain responsiveness level, and features are added until it starts to affect that responsiveness.

      Ie, Adobe Reader. Used to be small, fast, easy to use. Today it's huge, bloated, and with a stupid UI. But it does exactly the same thing it always did - for me. I want it to read documents only, never write to them, never to allow me to add my signature, I don't want to deal with encrypted documents (the only reason I'm forced to use newer versions), etc. It has security updates because they've been stupid and started adding too much to it instead of being a small simple read-only program. Mozilla's PDF viewer works just as well, or the OSX Preview, or other alternatives.

    42. Re:An Old Story by Darinbob · · Score: 1

      Not so sure about multiple inheritance. Sure, it's convenient. Or it seems convenient until there's something messy with it and workarounds are needed to make it work as expected. There have been 30 years of struggling with this concept and it's still a pain (though Python has a nice solution I think). Consider on the other hand that Smalltalk does not have multiple inheritance and yet it's the classic examplar of an extremely high level OO language, it doesn't even have interfaces or need them.

    43. Re:An Old Story by Actually,+I+do+RTFA · · Score: 1

      If so, how do you tell it what stuff should be deep copied and what shouldn't?

      Well, the metaprogramming improvements from, for example, C# could handle that. It defaults to a shallow copy, buy each class could have an optional "deep copy" attribute that change s the behavior.

      --
      Your ad here. Ask me how!
    44. Re:An Old Story by gweihir · · Score: 1

      I think there are several different issues here and perhaps some of our comments are conflating them unfairly.

      Certainly we agree that people who just aren't very good at programming will make mistakes in any language.

      But I also accept that even people who are quite good at programming are still only human and will inevitably make more subtle mistakes from time to time.

      I agree on all of that. Still, subtle mistakes cannot be prevented by tools. Tools only catch rather obvious mistakes or drown in false positives. But that is not actually the point I want to make. The point is that saddling a language with restrictions to expressiveness will hamper experts in getting the job done, but will not really prevent bad coders from making horrible mistakes. And language cannot really do anything about subtle mistakes. That would require strong AI.

      So while Rust can prevent some mistakes, but makes work for experts harder, it cannot solve the underlying problem. It can delay solving that underlying problem though. I guess in a way I am preferring an "end in tears" to "tears without end" (German proverb, no sure it translates well...). Rust and the whole idea that tools will solve the problem is basically "tears without end" as more tool use means even worse coders will get chosen as they are cheaper. And it will delay the inevitable realization that it is really coder competence that matters. As soon as only good coders write critical software, we can build tools that help _them_. These will then not stand in their way as things like Rust will inevitably do.

      This is however clearly a matter of opinion and I respect that yours is different.

      The software industry as a whole has an awful track record on quality and performance, and there are whole sub-industries dedicated to tools like debuggers and profilers and static analyzers and refactoring aids because programmers make so many mistakes or poor judgements when left to their own devices. Using better tools can help to catch mistakes and make more informed decisions earlier.

      While I agree on the atrociously bad track record, the tools do not seem to help. Or rather those programmers that really need these tools are so bad that their code is still very bad after they fixed everything the tools told them to. Hence my stance that this is not a tool question, but a question of coder competence. I do know that a lot of management cannot see that a cheap coder often ends up being very expensive (for variable amounts of "cheap") and hence people get to be coders on projects they have no business being on difficulty-wise.

      The other major benefit to using those tools is that even if you do have someone outstanding who will code so defensively that there is little that slips through -- as perhaps is the case with the Postfix example -- that always requires a significant amount of effort and compromise -- again as we see with the "safe subset" style of coding used for Postfix. Automating part of the work would have left more time to concentrate on more important and difficult areas like making sure the underlying algorithms are sound in the first place.

      That is my other point: I do not think it can be done at this time. And I think the language is the wrong place to try. But even using things like Fortify, if the code analyst before the console is not very good, it does more harm than good.

      Finally, on OpenSSH/OpenSSL, I know the former only depended on the crypto tools rather than libssl, but it seems you are more trusting than me that despite the terrible record of part of the OpenSSL project the risks are confined to just that specific part of it. Presumably then OpenSSH developers themselves consider this a legitimate concern, given the recent moves to separate the projects entirely.

      I am not very trusting. But I had a long look at the vulnerability-history of OpenSSL and found libCrypto to be fine for the

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    45. Re:An Old Story by Dutch+Gun · · Score: 1

      A lot of people besides you also call C++'s backward compatibility "baggage", but it's unwavering backwards compatibility both with itself and with C (mostly) are one of the cornerstones of it's success and longevity, at least in my opinion. Maintaining strict compatibility, even though sometimes ugly, is one of the smartest thing the C++ committee has done.

      When a language breaks compatibility, it tends to split the developer community (e.g. Python 2 vs Python 3), since people or organizations then have to decide whether a costly upgrade or rewrite is worthwhile. With C++, we can rest assured that even older C and C++ projects will continue to compile with modern compilers just fine, and we can move ahead with improved, modernized code at our leisure. This assurance of backwards compatibility gives confidence when in investing many millions of dollars in a code project.

      Sure, backward compatibility definitely comes with downsides, such as the difficulty in creating effective tooling for C++ source code or slow compile/link speeds, but I have to laugh when people suggest breaking compatibility or switching languages as a serious alternative. When you're working with projects that have hundreds of thousands or even millions of lines of code, you don't just rewrite that stuff at the drop of a hat.

      --
      Irony: Agile development has too much intertia to be abandoned now.
    46. Re:An Old Story by david_thornley · · Score: 1

      You frequently don't want equally deep copies in everything. What if a class instance has one pointer to something immutable, and one to something mutable? Wouldn't you want to do a deep copy only on the mutable thing?

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    47. Re:An Old Story by david_thornley · · Score: 1

      Eiffel and Common Lisp have multiple inheritance, and it seems to work OK in there.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    48. Re:An Old Story by david_thornley · · Score: 1

      Operator overloading is a perfect example. As you say, it can be seriously misused. It also allows some very elegant code. It's a safety belt that doesn't let me reach all the gears.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    49. Re:An Old Story by Darinbob · · Score: 1

      Well sure, they have it. But there are snags to watch out for. Ie, the classic problem is what to do if your inheritance tree is not a strict tree so that the same ancestor class can be reached through more than one path through the inheritance hierarchy.

      Ie, A inherits from B and C, and both B and C inherit from Object. Thus Object is a inherited from twice. So then if there's a method in Object, modified by both B and C, which inheritance path do you take? More complex, if you've got a "super" type of call then what traversal order is done? For example, if your language has constructors then what order are the constructors called and is the Object constructor called twice or only once?

      Different OO languages give different answers to these questions. Worse still, there are very good and rational arguments to make for each answer so that you can't just dismiss them out of hand, saying that the C++ method is superior to CLOS for example. People do academic papers on this stuff because it's not simple.

    50. Re:An Old Story by Anonymous+Brave+Guy · · Score: 1

      I agree with you that the C compatibility was a very important factor in C++'s original adoption and success. I also agree with you, at least up to a point, about the value of long-term stability and standards. I don't think C++ should deviate dramatically from its heritage at this point.

      Nevertheless, in 2015, things like having a horrible grammar, overcomplicated semantics with numerous edge cases, and such unsafe low-level access are all serious disadvantages for C++ relative to newer languages.

      This isn't a criticism of C++ itself or an insult to the people who created one of the most successful programming languages in history. It is simply progress. The constraints of today are not the constraints of the time when C++ was created, and we can do better now.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    51. Re:An Old Story by cwsumner · · Score: 1

      Plenty of carpenters pin back the shield on their skill saw.
      I sure wouldn't. I'd cut off my leg.

      Yes, you really do want the protections. They need a way to disable them, but don't. Unless there is really no other way.

      Seriously. Two students fell off of a mountain overlook near here, this spring, and were killed because there was no guard rail at the edge. It can happen with your software, too. (And yes, some software can kill.)

      Good languages have automatic safety checks, but also have a way to bypass them if really necessary.

    52. Re:An Old Story by cwsumner · · Score: 1

      The problem is that the issues tend to pile up over time, and at some point, the only sane thing would be to throw the whole mess away and start over. ...

      The trouble with stating over, is that there is huge amounts of knowledge that is only recorded in the old source code. When an old program is thrown away and a bright new program is created, much functionality is lost. This type of new project has about an even chance of being rejected by the users. And they go back to the old program for years afterward, traumatised too much to start again.

      And yes, I make my living "raking through trash piles for diamonds" !
      It can be done. And it is often faster than the alternatives. But it is not always fun.

      Like writing books: "It is not fun to write, but it is fun to have written."

    53. Re:An Old Story by cwsumner · · Score: 1

      It is not. It is almost always "save a penny lose a million". The problem is that the million (or usually quite a bit more) is lost later and somebody else has to pay. This is both exceptionally bad management and exceptionally bad engineering.

      I believe that the term for that is "Bureaucracy". A disease that afflicts large organizations of many types, and is often fatal eventually.

    54. Re:An Old Story by Actually,+I+do+RTFA · · Score: 1

      Absent special circumstances, probably relating to reducing read times or page considerations, you wouldn't want to do a deep copy on the immutable object. Some languages (C# for sure, maybe others) have a pretty good attribute system you can write metacode against. Hopefully that will come to C++ soon.

      But in C#, you can tag the whole class Default_To_Deep_Copy, and then a single property Shallow_Copy (syntax invented.) I don't know if there is already a framework to do that, but if not there's certainly the ability to write metacode that does.

      --
      Your ad here. Ask me how!
    55. Re:An Old Story by Actually,+I+do+RTFA · · Score: 1

      Cool, a CS student!

      In the real world, there are edge case reasons where it makes sense, often for performance reasons. When your leaky abstractions fail you, you have to deal.

      As I said, an immutable object may need to be duplicated because it is far more efficient to read contiguous memory or to prevent trashing.

      --
      Your ad here. Ask me how!
    56. Re:An Old Story by mr_mischief · · Score: 1

      Assembly can call C libraries on most systems. Then again, so can Perl, Python, and Scheme.

    57. Re:An Old Story by mr_mischief · · Score: 1

      What little part did you grab onto without reading the whole post? That's right, the very first sentence.

      Read the whole thing. It's about balancing speed of development with other factors, including performance of the code.

      Nobody's talking about blazing fast, careless typing into an IDE. The biggest cost in software development tends to be the software developer. Making the software developer more productive saves money. Most of us don't have unlimited budgets.

      People who code in Python, Perl, Scheme, JavaScript, or whatever rather than assembly aren't all "sloppy" developers. They're producing code that does a lot more work per source line than Assembly does. If they produce the same number of lines, then they're more productive.

    58. Re:An Old Story by phantomfive · · Score: 1

      That's true.

      --
      "First they came for the slanderers and i said nothing."
  3. Programming languages must cater to humans by bluefoxlucid · · Score: 5, Insightful

    A programming language is better if it does one thing: Solves a particular type of general problem more efficiently and clearly than the language of comparison. The larger this set and scope of general problems, the better the language; the fewer corner cases hinder the language, the better the language.

    You will find the integration of mathematical languages, physics languages, or graphics languages into a general programming language a pile of clutter and complication. They won't integrate with much of the language, or they'll complicate it, or they'll constrict it. This is why you have libraries in a language to do some general tasks (Box2d, PhysX APIs, etc.), low-level specialized assemblies (OpenGL CUDA, shader assembly), and specialized high-level languages (R, Matlab): these tasks are best integrated by interfacing with a black box that takes in a data set, runs it through a set of coded procedures, and spits out a result.

    What makes a programming language "better" than state-of-the-art is its ability to supply general programming practices and functionality in an efficient way for humans. Classes that can be easily swiveled or overloaded or extended or polymorphed, but only in a way that a human being can reliably understand--that is, that a human being who has studied the language won't still struggle with understanding the workings of the language due to its conflict with the method of human thought. Code bodies which are simultaneously readable, maintainable, and efficiently executable. The ability to represent a wide variety of specialized tasks as API classes and functions, even if less effective than a specialized language, should someone seek to integrate physics or mathematics or cryptography or other such things with their program. All of these things, reflected in a way a human can grasp and use with fewer human-introduced defects, and also in a way that does not constrict the human from approaching the subset of programming tasks carried out in nearly 100% of code (imagine if 1 in 100 functions needed a specialized language, not a simple library API or raw programming code; even the Linux kernel is far less than 1% low-level assembly).

    It is not valid to say that people are bad at programming in C++ because they are bad programmers; but it is valid to say that bad programmers will not become good programmers if given a good language. If we assume, for example, that Perl is terrible and Python is some form of holy perfection, then we can claim that Perl will cause a good, studied, skilled Perl programmer to make many more defects than a good, studied, skilled Python programmer will make in Python; indeed, our metric for whether Perl or Python is superior to one another would be both the speed at which a new inductee to the language can learn to code with similar defects--how much programming exposure over a variety of challenging tasks does a person need in order to use the language for tasks of similar complexity without creating defects? Swift, Rust, C#, and so forth will face the same challenges: what is the defect rate produced by the programmer, relative to the amount of effort and resulting skill of the programmer in the given language, and how does it compare to all other languages?

    Bad languages will make good programmers produce more bad code. Good languages will not make bad programmers produce good code; they will enable good programmers to produce less bad code.

    1. Re: Programming languages must cater to humans by Anonymous Coward · · Score: 3, Informative

      > C++ too hasn't stood still during the last 30 years, and plenty of both static and dynamic analyzers supporting it have been released during this time.

      But without language semantics (e.g. for saying whether variables are threadsafe) these analyzers simply can't do anything other than guess at the programmers intentions. Even the best ones miss basic memory safety issues, while also producing far too many false positives. And this is all to be expected when the language can't expresss those semantics.

    2. Re:Programming languages must cater to humans by Anonymous Coward · · Score: 4, Interesting

      Programming language source code is a data structure. If the language is a data structure that can't be efficiently subjected to various (automated) optimizations, checks, and refactorings; then it's an inferior language (data structure) in that sense. It won't happen overnight (and it's not going to be Rust that does it), but this will eventually end up the same way that administration is ending up; where manually doing a large amount of work that could be automated will put you out of business. The idea that C++ is a great barrier to keep out bad programmers is really dumb, because it's another way of saying that development and maintenance costs do not matter. When every potential pointer mistake is a crowbar into robbing a bank account, the cowboys are going to need to be removed. Ultimately, software that allows for reproducability (no magicians in dev, administration, ops, or testing) is going to win. It won't happen without better compilers (ie: automated testing and code review). See the scale of Google and Amazon. They generally work in the highest tools they can get away with for the task at hand; and it's why they can scale.

    3. Re: Programming languages must cater to humans by Anonymous Coward · · Score: 1

      C++ has const, volatile, static, thread_local, and a whole host of atomic flags in std::atomic that I barely understand to enable you to provide exactly the level of protection you need on a variable. From read-only/immutability to fine grained ordering, you can specify it all. It's mostly a factor of people not caring enough to learn what they need to do.

    4. Re:Programming languages must cater to humans by phantomfive · · Score: 3, Funny

      The idea that C++ is a great barrier to keep out bad programmers is really dumb

      Especially if you've seen much C++ code.......

      --
      "First they came for the slanderers and i said nothing."
    5. Re:Programming languages must cater to humans by meta-monkey · · Score: 1

      I pretty much love you.

      --
      We don't have a state-run media we have a media-run state.
    6. Re: Programming languages must cater to humans by Anonymous+Brave+Guy · · Score: 1

      From read-only/immutability to fine grained ordering, you can specify it all.

      That might just about be true with modern C++ standards that actually specify a memory model now. The thing is, even if that is the case, it is true only in the same sense that you can specify whatever behaviour you like in assembly language: while technically correct, it is laborious and error-prone to do so, and there are very much better tools for the job in 2015.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    7. Re:Programming languages must cater to humans by gweihir · · Score: 1

      And there is the huge problem with things like Rust (or Java): As management types think they do allow worse (cheaper) programmers to produce good-enough code, once these languages are used, actual skill of the programmers hired drops. Worse programmers of course make a host of other mistakes that have nothing to do with the language itself and routinely produce slow, brittle and hard to maintain code.

      While this is not a technical argument, and some people here will certainly not understand it, it is an effect that is strong in the industry.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    8. Re:Programming languages must cater to humans by bluefoxlucid · · Score: 1

      Yes, that is a thing; it's not a thing that makes Java or Rust bad (other factors make Java shit), but it is a thing that happens. When Java came out, everyone wrapped everything in try{}catch{continue anyway!}

    9. Re:Programming languages must cater to humans by david_thornley · · Score: 1

      Good insights, but pointers are not the problem. Almost all languages have pointers of some sort, and potential aliasing issues. What is dangerous is pointer arithmetic, and unless pointer arithmetic is actually needed (there are low-level uses) it can be completely avoided in C++ by using commonly used standard library features.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    10. Re:Programming languages must cater to humans by gweihir · · Score: 1

      You are right that it is not a problem with Rust. It is however a real problem with the way Rust is pushed.

      As to that "try{}catch{continue anyway!}", there are still quite a few people that like doing things like that, unfortunately. When doing code review (mostly for security, so you can imagine what application areas this code is from), I regularly have some "WTF?" moments for things like these.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    11. Re:Programming languages must cater to humans by bluefoxlucid · · Score: 1

      I haven't had an employer do a code review yet.

  4. Named after the product of corrosion? by TWX · · Score: 1

    Why did they name the programming language after the byproduct of the corrosion of iron?

    --
    Do not look into laser with remaining eye.
    1. Re:Named after the product of corrosion? by chadenright · · Score: 1

      Designed obsolescence.

    2. Re:Named after the product of corrosion? by Required+Snark · · Score: 1

      Rust Never Sleeps.

      --
      Why is Snark Required?
    3. Re:Named after the product of corrosion? by wshs · · Score: 4, Funny

      Nothing screams efficiency, well maintained, clean, and smooth running software like calling it "Rust"

  5. Someone is making decisions for me regarding thing by DreamMaster · · Score: 1

    Amen to that. It's like the old argument of the GOTO keyword. Sure it can easily be abused. But for certain limited cases, it's a godsend for making clean code. As the OP says, if someone's a bad programmer, they're going to write bad code no matter what language is used. Straight-jacketing people as to what they can use may help newbies, but you end up constraining what experienced programmers can do.

  6. A bit ranty. by serviscope_minor · · Score: 4, Interesting

    It seems pretty ranty.

    C is never going to die. C++ is never going to die. That's for unrelated reasons. There's vast bodies of solid, efficient, debugged code written in those two languages so it will take a long time to replace it all. C++ also isn't staying still so while there's the fight against the C legacy there are usually faster, cleaner, less verbose, safer and more obvious ways of doing things.

    That said, rust seems pretty cool. The underlying machine model semantics aren't a world away from C/C++ (one of the few cases where that's an appropriate use) so I expect the compilers will catch up pretty soon especially as they will all sue the same back ends.

    Rust does seem in many ways to be a good thing: a similar machine model to C/C++ with all the associated efficiency but combined with a type system which makes whole classes of nasty bug impossible.

    My guess is that will make it feel restrictive, especially at first. Well, at first, I didn't really get all the new-fangled C++ shit with classes derivation and templates and whatnot and didn't really see what was wrong with hacking around with void* and casta the whole time. Then I realised I wasn't as smart as I thought.

    So, to me, Rust is interesting. It has roughly the expressibility and speed of C++ (in theory), the same low resource usage but is memory safe.

    --
    SJW n. One who posts facts.
    1. Re:A bit ranty. by sconeu · · Score: 1

      Rust may be interesting, but is useless for multithreading because as we all know, Rust never sleeps.

      Hey hey, my my....
      C++ will never die....

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    2. Re:A bit ranty. by Darinbob · · Score: 1

      C isn't used only because of legacy. There's a lot of brand new code in C, especially for small machines. The only real competition is C++, and people are nervous about that for many reasons. C++ is bulkier if you're not careful because there's a lot of stuff hidden behind the scenes, it has more run time library requirements which is painful if you're writing your own, some compilers have had absolutely byzantine error messages, and so forth. It's unfair though, since C++ on it's own does not cause bloat, you also need C++ programmers for that. With self disclipline you can get C++ code almost as small as C code.

    3. Re:A bit ranty. by Jeremi · · Score: 1

      So, to me, Rust is interesting. It has roughly the expressibility and speed of C++ (in theory), the same low resource usage but is memory safe.

      I wonder if it would be at all practical to take Rust's innovations regarding memory-safety and apply them to C++? (Obviously some finessing would be necessary to do that without breaking backwards compatibility, and existing C++ code might not be able to benefit, but then new C++ code could be written with stronger safety guarantees, while still retaining the compatibility and familiarity advantages of C++)

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    4. Re:A bit ranty. by gweihir · · Score: 2

      There is also new C code for large machines. Just wrote some. Speed, memory-efficiency and fine-grained control over the execution is mandatory in some application scenarios.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    5. Re:A bit ranty. by serviscope_minor · · Score: 1

      You don't get any more control with C than you do with C++, since C is almost a strict subset of C++. Well, actually you do, since C has VLAs and restrict, but pretty much all the major C++ compilers support those as extensions.

      With those rather minor extensions, the to turn a C program into C++, one needs a few extra casts and a bit of care over sizeof('a').

      --
      SJW n. One who posts facts.
    6. Re:A bit ranty. by gweihir · · Score: 1

      And why would I use C++ for code that does not have or need a compiler-supported object-hierarchy? That would be incompetent.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    7. Re:A bit ranty. by david_thornley · · Score: 1

      Perhaps for some of the templated library features? For example, C++'s std::sort is likely more efficient than C's qsort().

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    8. Re:A bit ranty. by david_thornley · · Score: 1

      I'm not familiar with Rust's safety features. How much better are they than disciplined use of smart pointers? (We're talking disciplined use in either case, since it's always going to be possible to do dumb things with memory in C++.)

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    9. Re:A bit ranty. by gweihir · · Score: 2

      No. These cause more problems than they solve, because the template system in C++ is utterly borked. (Look at what Eiffel offers to understand what I am talking about...) As to qsort(), in a sane implementation, there will not be any difference. The extra call that C does does not matter once the code is in 1st level CPU cache. And if you need maximum performance, you have to move away from the library anyways.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    10. Re:A bit ranty. by david_thornley · · Score: 1

      The template system is arcane, and I don't really think the original designers expected to be creating a Turing-complete language at compile time. C++ templates are very usable once written.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  7. ideology and technology by antiperimetaparalogo · · Score: 1

    it's not because the technology is bad - it's because you haven't learned how to use it right

    Well, technically this is an ideology... and it's not because this ideology is bad - it t's because they haven't learned when to use it right!

    It will be better for me not to angry more fellow Slashdoter with my Greek lessons, but technology and ideology are both Greek words...

    --
    Antisthenes: "Wisdom begins by examining the words/names." - excuse my English, i am (slightly...) better with my Greek!
  8. The source of troubles is usually in humans by Beck_Neard · · Score: 4, Insightful

    > the source of troubles is usually in humans, not technology

    Exactly, and that's why C/C++ is bad. Humans are terrible at programming. This isn't an insult to anyone and it's not me trying to say "no one is as good a coder as I am." It's a statement of fact, and everyone - including you and me - is terrible at programming. The human brain did not evolve to program computers. Programming computers is just something we kind of stumbled upon by accident and we have been continuing to stumble and fumble and generally make fools of ourselves. This is why we desperately NEED languages to hold our hands. Ironically, in the early days of programming, when people seemed to have a more mature attitude towards the art, this was a commonly-accepted fact. That's why Fortran and Lisp were developed even though it was hard and time-consuming and expensive to write compilers for those languages in those days (only a handful of people around the world knew how to write a compiler) and the code produced by those languages was typically awful and strained already-poor hardware to its limits. And when C was developed, it was a HIGH-LEVEL language. It was the python or the scala of its day. It was designed as a labor-saving device, a way to write operating systems without fucking around with assembly. "Writing an operating system in a high-level language? You're fucking nuts!" And just like a proper high-level language, it held the programmer's hands and put major restrictions on what he was allowed to do, at least relative to assembly.

    The modern programmer is a victim of luxury. His computers are powerful and he has a choice of thousands of languages, many of them really good. And like the rich bohemian who decides to live in filth for no reason, he thinks there's something impressive or 'cool' or 'edgy' about programming in a complex unstructured language. There isn't.

    --
    A fool and his hard drive are soon parted.
    1. Re:The source of troubles is usually in humans by Anonymous Coward · · Score: 1

      thinks there's something impressive or 'cool' or 'edgy' about programming in a complex unstructured language.

      You're whining a screwdriver is superior to a hammer because the first is better with screws, and fuck everyone who works with nails. Some applications need to be close to the metal, even if you don't like it or find it ugly. We can't all code apps in the latest fad language.

    2. Re:The source of troubles is usually in humans by Beck_Neard · · Score: 1

      In 1972 you would have been railing against C and insisting you need assembly to write an OS.

      Tools get better over time. Yes, you need a language designed for systems-level coding to write some applications, but that doesn't equate to freedom to do anything you want and lack of restrictions. In fact it should mean quite the opposite.

      --
      A fool and his hard drive are soon parted.
    3. Re:The source of troubles is usually in humans by meloneg · · Score: 1

      I can't say I ever expected to see someone refer to "Ada[,] Pascal, C and Fortran" as "the latest fad language". Those were all old-hat when I got into this game 30 years ago.

    4. Re:The source of troubles is usually in humans by Yunzil · · Score: 1

      It's a statement of fact, and everyone - including you and me - is terrible at programming.

      Well, since this isn't actually a statement of fact, the rest of your argument doesn't follow.

    5. Re:The source of troubles is usually in humans by JohnFen · · Score: 3, Informative

      And when C was developed, it was a HIGH-LEVEL language.

      Umm, no, it wasn't. It was (and is) considered a mid-level language, one step above assembler. High level languages of the day were things like COBOL and Fortran.

    6. Re:The source of troubles is usually in humans by phantomfive · · Score: 1

      And just like a proper high-level language, it held the programmer's hands and put major restrictions on what he was allowed to do, at least relative to assembly.

      That really, really was not the purpose of C. It's better to think of C as kind of a fancy macro library.....common functionality collected into a single place for the convenience of the programmer. The designers of C were not trying to limit programmers to prevent them from making mistakes, they trusted programmers to be able to handle great power (and be responsible).

      --
      "First they came for the slanderers and i said nothing."
    7. Re:The source of troubles is usually in humans by drewm19801927 · · Score: 2

      If you decide to get into Rust, please post about it from an Ada developer perspective! Almost nothing has been posted comparing the two; I think the intersection of high assurance software gurus and new language nerds is pretty small... a niche within a niche.

    8. Re:The source of troubles is usually in humans by Anonymous Coward · · Score: 1

      While what you say, we're arguing over matters of degree here rather than over whether a language should not hold a developer's hands at all versus giving them complete freedom (I think the answer to whether a language should do either of these things is unequivocally "no").

      Like it or not, all abstractions are leaky, which is why ultimately any useful language will allow a programmer ways to go a level or two of abstraction lower than what the language was intended to use - either directly in the language itself, or via some kind of interoperability with lower level language such as DLLs, unmanaged code in C# etc.

      The tradeoff here is between ease of use and control. In my normal day-to-day work writing business apps on a WIndows platform, it's pretty much C# all the way because I just don't need the level of control a lower-level programming language gives you.

      When I do back-end work writing up physics engines for simulation systems on defence contract, well then I'd prefer to work in C or C++. Often that code is performance-critical, and I just don't want to have to worry about the GC getting in the way. I know how to manage my memory, I know the RAII idiom and smart pointers, I don't need the language to give me training wheels here.. and those training wheels have a cost I don't want to deal with!

      Programming languages are just tools, and like any tool you pick the right one for the right job.

    9. Re:The source of troubles is usually in humans by Beck_Neard · · Score: 1

      No, I'm saying the reason is because they don't know how good they have it, and they are mostly coddled and shielded from the effects of their own bad programming.

      You have a very shallow level of understanding.

      --
      A fool and his hard drive are soon parted.
    10. Re:The source of troubles is usually in humans by Beck_Neard · · Score: 1

      You're again deciding to completely not listen. It's not worth arguing with you anymore.

      --
      A fool and his hard drive are soon parted.
    11. Re:The source of troubles is usually in humans by Beck_Neard · · Score: 1

      > It was (and is) considered a mid-level language

      By who?

      --
      A fool and his hard drive are soon parted.
    12. Re:The source of troubles is usually in humans by brantondaveperson · · Score: 1

      Anything you can do in assembly language, you can do in C.

      Except roll-right (or left) without resorting to x = (x > 7), which requires you to know the size of x in advance, and is hard to read. And roll-through-carry is super-annoying in C.

    13. Re:The source of troubles is usually in humans by brantondaveperson · · Score: 1

      Argh didn't write that properly. I (obviously) meant:

      x = (x << 1) | (x >> 7);

    14. Re:The source of troubles is usually in humans by shoor · · Score: 1

      Anything you can do in assembly language, you can do in C.

      Ahh, how many people are going to come up with counter-examples?
      Mine? Self-modifying code.

      --
      In theory, theory and practice are the same; in practice they're different. (Yogi Berra & A. Einstein)
    15. Re:The source of troubles is usually in humans by Darinbob · · Score: 1

      Sometimes you want to point the gun straight down and pull the trigger. Some languages are like nannies in absolutely prohibiting that action, even if you've written lines of code just before that point to verify that your foot is out of the way and proper kevlar footgear is being worn. Sure, if you're writing high level application code, then maybe you don't want to make typecasting easy.

      But at the systems level you absolutely need to do things that any good compiler will be squeamish about; I absolutely want to cast my byte pointer to a word pointer, I want to make sure it doesn't optimize away my other pointer which is pointing to a hardware register, I'm treating the signed integer as unsigned on purpose, and so forth.

    16. Re:The source of troubles is usually in humans by Darinbob · · Score: 1

      Whoops I replied to the wrong message instead of this one (stupid UI). But sometimes I need to shoot towards my foot. And there is stuff I need to do that C can do and many other languages just don't want to let you do. Now Ada can let you do a lot of that systems level stuff, but for some reason it didn't get that popular. I'm using C now and I need to use it, though I could do with C++ as a back up plan, but Ada would require a massive retraining effort but would also work.

      Sometimes the compiler thinks I'm wrong when I am not wrong.

      C does compile down to very small code with small memory usage, if you write your code that way. Sometimes that's more important than other factors in a language. It's also great because many compilers allow inline assembler, it's a waste of space to have to do a function call just to access assembler.

    17. Re:The source of troubles is usually in humans by Darinbob · · Score: 1

      And yet today, C is still one of the top languages that operating systems are written in. Even some operating systems written mostly in C++ have a few C files tossed in. The reason I think is that C is just high enough level to be convenient but low level enough to let you do the stuff that's needed with the machine. So there's not much pressure for higher level languages to evolve for writing operating systems in.

      So C won't be made obsolete by higher level languages. But it may be dethroned by other similarly low level languages with added improvements, like D or Rust or...

      And for systems level coding, you do need freedom to do what you want much of the time. This is because you're breaking the rules a lot, you're doing the unexpected. Ie, you flush the cach, switch context, etc. You don't have a language run time system to implement stuff for you, because you yourself are creating the run time system. You do your own error handling and stack unwinding. Sure, it's good to have compiler warnings telling you that two pointers may not be compatible with each other, but a systems programming language should have a way to get around that without reverting to assembler.

    18. Re:The source of troubles is usually in humans by QQBoss · · Score: 1

      And when C was developed, it was a HIGH-LEVEL language. It was the python or the scala of its day. It was designed as a labor-saving device, a way to write operating systems without fucking around with assembly. "Writing an operating system in a high-level language? You're fucking nuts!" And just like a proper high-level language, it held the programmer's hands and put major restrictions on what he was allowed to do, at least relative to assembly.

      I miss Dennis, but I think he would tell you that while you are on the right path, you are wrong in the end. To be a real high level language would have meant surrendering direct-to-the-metal access, and he never considered that as even a possibility. His intention was to create an all-level language for the PDP/11 to improve on B (which was missing byte addressability), and even portability wasn't considered until after he achieved that goal; hand-holding was more to avoid breaking the compiler than to avoid breaking user code. He believed that if you wanted to access array[-16], you should be allowed to do that, even if it cost you your own foot (intentionally or unintentionally). His desire was to make a language that could easily map constructs to the existing hardware's assembly/machine code, which is pretty much the inverse of what high-level languages are today (or were, even then).

      C was what Dennis wanted it to be. RIP, dmr.

    19. Re:The source of troubles is usually in humans by QQBoss · · Score: 1

      By Dennis Ritchie. Does anyone else matter?

    20. Re:The source of troubles is usually in humans by Beck_Neard · · Score: 1

      That's not even the start of it. There's a huge number of assembly instructions that cannot be implemented in C.

      But 'assembly language' is so ill-defined (there are thousands of assembly languages) that it's just meaningless to say "Anything you can do in assembly language, you can do in C" anyway.

      --
      A fool and his hard drive are soon parted.
    21. Re:The source of troubles is usually in humans by patabongo · · Score: 1

      Humans are terrible at programming. This isn't an insult to anyone and it's not me trying to say "no one is as good a coder as I am." It's a statement of fact, and everyone - including you and me - is terrible at programming.

      I've seen this line of argument in a number of /. threads recents (maybe even from the same commenter). Story about self-driving cars: "humans are terrible at driving". Story comparing programming languages: "humans are terrible at programming".

      But terrible compared to what? It's a totally meaningless statement on its own. Humans may well be terrible at programming compared to inhabitants of the planet Vulcan, but at this moment human beings are better at programming than every single entity we know of that exists. I would love it if the next version of Windows was written from scratch by some being whose programming abilities puts humans in the shade, but outside of fiction that simply doesn't exist.

    22. Re:The source of troubles is usually in humans by JohnFen · · Score: 1

      By who?

      As others have said, by the people who wrote the language. And by the entire software industry as well. I was honestly surprised that anyone characterized C as a high level language. It's not just wrong (by the usual definitions of what low, mid, or high-level means) but is not the common understanding in the industry.

      C++ is a high-level language, though.

    23. Re:The source of troubles is usually in humans by david_thornley · · Score: 1

      FORTRAN simply had to produce efficient code, since it was touted as a better way to write scientific code, and nobody would have used it if it had a significant performance disadvantage. Remember that those old computers were incredibly slow and limited and expensive in the 1950s, and scientists were trying to get serious work done. If they could write a program in FORTRAN instead of whatever assembly language was in use, and have comparable performance, they were going to want to use FORTRAN.

      Remember that programmer time was relatively incredibly cheap compared to computer time these days. Offering faster development time was far less important than offering faster computer runs.

      Lisp was designed conceptually, and early implementations were very inefficient. The design differences between Lisp and the other languages of the day was that the other languages were sold as better ways to use a computer, while Lisp was a way to express ideas. Nowadays, most languages have come to express ideas much better, and some implementations of Lisp have become extremely efficient.

      C was in a niche similar to FORTRAN, in that it had to be efficient and not restrict the user. In the case of FORTRAN, it was necessary to convince scientists that it would run as efficiently as assembly language for scientific programs, and C had to convince OS developers that it would run as efficiently as assembly code in writing operating systems. Even now, operating systems should be fast, since every program, performance-critical or not, has to run on them. If C had bad performance, or restricted OS developers from doing all the weird stuff they need to do, it would have been a failure.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    24. Re:The source of troubles is usually in humans by Cro+Magnon · · Score: 1

      Compared to what? C might be high-level compared to Assembler, but it was low-level compared to Basic, Fortran, and COBOL.

      --
      Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
    25. Re:The source of troubles is usually in humans by Beck_Neard · · Score: 1

      Being 'the best that there currently is' does not equate to 'being amazing at it.'

      --
      A fool and his hard drive are soon parted.
    26. Re:The source of troubles is usually in humans by Beck_Neard · · Score: 1

      People who have never written a C compiler generally tend to think it's "one step above assembler."

      --
      A fool and his hard drive are soon parted.
    27. Re:The source of troubles is usually in humans by patabongo · · Score: 1

      'Amazing' and 'terrible' are equally meaningless in this case. Our abilities are at the top of the range of possibilities we are aware of. We simply have no way to objectively judge them.

    28. Re:The source of troubles is usually in humans by Beck_Neard · · Score: 1

      No they are most definitely not meaningless. Humans are just as good at programming as pigeons are good at flying into space, and this comparison holds true even if there were no spacecraft to compare pigeons to.

      --
      A fool and his hard drive are soon parted.
    29. Re:The source of troubles is usually in humans by patabongo · · Score: 1

      Humans are just as good at programming as pigeons are good at flying into space

      It seems clear that when you talk about 'programming' you mean programming a computer to achieve some currently unattainable goal, otherwise this comment makes no sense. If you genuinely believe that computer programmers are as rare as orbiting pigeons you're simply looking in the wrong places.

      It might be helpful if in future you actually articulate the goal you have in mind, for example "Humans are terrible at programming computers to achieve independent consciousness." I don't think that statement is going to be much use in an argument about which programming language is better, but see where it takes you.

  9. You dont' need another language to do this. by Glasswire · · Score: 2

    "To put it simple, this is a language with a built-in code analyzer and it's a pretty tough one: it can catch all the bugs typical of C++ and dealing not only with memory management, but multithreading as well. Pass a reference to an assignable object through a pipe to another thread and then try to use this reference yourself - the program just will refuse to compile. "
    Why do we need another language to accomplish those things? Better IDEs, compilers and analyzer tools should be able to all that for existing languages. If you have a better paradigm for expressing algorithms that you think merits a new language, make that case, but complaints in the quote don't need that.

    1. Re:You dont' need another language to do this. by Megol · · Score: 2

      We need it because that isn't what Rust is about - it is about making safe programming the default and making some common errors in other languages (like dangling pointers) impossible. And doing that while still being useful for systems programming and supporting high performance.

    2. Re:You dont' need another language to do this. by meloneg · · Score: 1

      I've seen this argument before. Hmm. where was that. Oh yeah! Java. And Pascal before it. and Ada before that.

    3. Re:You dont' need another language to do this. by phantomfive · · Score: 2

      Why do we need another language to accomplish those things? Better IDEs, compilers and analyzer tools should be able to all that for existing languages.

      Because there is some analysis that can't be done statically (provably!), and other analysis that is intractable, no matter how good your IDE or tools. The language works around this by simplifying the problem by disallowing certain things.
      Another example of a language that solved the halting problem is Coq......it's impossible to write a program in that language that doesn't terminate.

      --
      "First they came for the slanderers and i said nothing."
    4. Re:You dont' need another language to do this. by shutdown+-p+now · · Score: 1

      The problem with all these is that they have not only set safety as a goal, but set it as a goal more important than performance. Rust is different in that it tries the no-compromise approach: your code should be as fast as C++ in the same scenario, while also being provably safe at compile time.

    5. Re:You dont' need another language to do this. by Coryoth · · Score: 1

      I believe Ada has pretty decent performance; The classic "Language Shootout" game has it scoring faster than Rust for the most part.

    6. Re:You dont' need another language to do this. by bingoUV · · Score: 1

      Another example of a language that solved the halting problem is Coq

      The "problem" in halting problem is that the "language" should be Touring complete. Otherwise either there is no halting "problem", or it can be said that the problem has been solved in 1930s and 1940s. So Coq "solves" it, by not being Touring complete i.e. there was no problem in the first place for 50 years when Coq was invented.

      SQL has existed for a longer time, and is a much better known non-Touring complete, halting problem "solved" language.

      --
      Bingo Dictionary - Pragmatist, n. A myopic idealist.
    7. Re:You dont' need another language to do this. by phantomfive · · Score: 1

      You are correct, and yet you missed the point.

      --
      "First they came for the slanderers and i said nothing."
    8. Re:You dont' need another language to do this. by vilanye · · Score: 1

      Turing not Touring

  10. language improvements by phantomfive · · Score: 1

    If your C++ code is not good enough or Java code is painfully slow, it's not because the technology is bad - it's because you haven't learned how to use it right.

    While he is right, you can use C++ perfectly safely, or even assembly would be fine with a team of skilled programmers. And I'd rather work in assembly with a team of skilled programmers than in any language with incompetent programmers: we will produce better code and deliver faster.

    That said, writing solid assembly takes intense attention to detail, and a higher-level language language does make things easier. A language that prevents you from making mistakes definitely has a place in the world.

    --
    "First they came for the slanderers and i said nothing."
    1. Re:language improvements by FranTaylor · · Score: 1

      you can use C++ perfectly safely

      in case you have not been keeping up, automated code analysis tools are finding terrible bugs in EVERYBODY's code from Microsoft to Google to Apple and just about every free software project.

      so the empirical evidence is that NOBODY out there knows how to use C++ "safely"

    2. Re:language improvements by FranTaylor · · Score: 1

      gnu grep 2.21, released Nov 23 2014, 10 active unfixed bugs on their bug report

      hello can you write a bug-free grep? can anyone? go ahead I double dare you. come on it's a simple program, just support the posix options. it's been done probably a dozen times at this point, surely someone with your skillz can knock it off with no bugs at all.

    3. Re:language improvements by phantomfive · · Score: 1

      lol sounds like some serious security vulnerabilities you've found there. I'll be sure not to run grep as root.

      --
      "First they came for the slanderers and i said nothing."
    4. Re:language improvements by david_thornley · · Score: 1

      Are there languages where nobody finds terrible bugs in programs? (I know that some code, like avionics, is delivered as nearly bug-free as humanly possible, but I'd bet it wasn't written bug-free.) The empirical evidence, as far as I can tell, is that nobody out there knows how to use programming languages safely.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  11. Come again? by Java+Pimp · · Score: 2, Funny

    it can catch all the bugs typical of C++ and dealing not only with memory management, but multithreading as well

    So they've solved the halting problem?

    They may have made some improvements and are capable of catching many bugs automatically but to say "all" is quite a stretch. I have yet to see a source code analyzer catch all mistakes and have a low false positive rate and a low false negative rate.

    Or perhaps I'm reading too much into it and they are simply capable of detecting bugs of all the typical C++ bug categories.

    --
    Ascalante: Your bride is over 3,000 years old.
    Kull: She told me she was 19!
    1. Re:Come again? by Actually,+I+do+RTFA · · Score: 1

      So they've solved the halting problem?

      Two big issues with what you said:

      Most bugs aren't detectable by solving the halting problem. It literally just covers infinite loops. The bugs they're talking about are far more subtle.

      Second, given sufficient constraints on the program being generated, the halting problem is solvable.

      --
      Your ad here. Ask me how!
    2. Re:Come again? by david_thornley · · Score: 1

      There are bugs that are basically equivalent to the halting problem. Aliasing bugs (where a routine is using two different names for the same memory) can only be proven impossible (in a general-purpose programming language) by solving the halting problem.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    3. Re:Come again? by Actually,+I+do+RTFA · · Score: 1

      It most certainly is reducible to the halting problem. And given sufficient constraints it is possible to solve halting problem. I doubt eliminating IPC to eliminate mutual-exclusion deadlocks is one of those constraints. But I have no doubt that there is some bundle of features that are allowable, and having IPC at all requires accepting other constraints. Heck, branching requires accepting other constraints.

      --
      Your ad here. Ask me how!
    4. Re:Come again? by Actually,+I+do+RTFA · · Score: 1

      I totally agree that there are bugs that are equivalent to the halting problem. I don't follow how aliasing is one of them. It seems as if any of the various paradigms that transfer ownership, such as auto and weak pointers solve that issue with 100% accuracy at the cost of freedom.

      --
      Your ad here. Ask me how!
    5. Re:Come again? by david_thornley · · Score: 1

      If you can pass two pointers into a function that are the same, you've got an aliasing problem. If you never have more than one instance of a pointer, that's impossible, but that doesn't work in general. If you've got std::shared_ptrs, you've got a potential problem. If you have std::unique_ptrs, and pass raw pointers from them (indicating lack of ownership), it can happen.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  12. What's easier to change? by eggz128 · · Score: 2

    Human fallibility or the language/compiler?

  13. I don't even... by naasking · · Score: 3, Interesting

    Further, "Like many of new languages, Rust is walking the path of simplification. I can generally understand why it doesn't have a decent inheritance and exceptions [...]

    Spoken like someone who has no clue about the breadth and depth of the various programming paradigms available. The fact that he still considers inheritance as somehow essential just reveals his ignorance on the progress on comp sci over the past 20+ years.

    Exceptions are more debatable, since we don't yet have a better error handling abstraction that scales from local to global error handling (checked exceptions are the best we have so far).

    [...] but the fact itself that someone is making decisions for me regarding things like that makes me feel somewhat displeased. C++ doesn't restrict programmers regarding what they can or cannot use."

    I don't even... So by this argument, C++ restricts me from using generators and first-class delimited continuations, so it's not good enough either.

    This argument is both a contradiction because C++ also makes such decisions thus disqualifying it despite the author's claims, AND it's tautological because every language makes opinionated decisions about acceptable idioms. Really, no language could possibly satisfy the author's requirements.

    Given its goals, I think Rust made a pretty good set of opinionated choices though. Certainly better than C++ overall.

    1. Re:I don't even... by Anonymous Coward · · Score: 1

      >I don't even... So by this argument, C++ restricts me from using generators and first-class delimited continuations, so it's not good enough either.

      A python generator is a c++ input iterator. You can make it look prettier using something like spirit or macros. It works the same.

      As my understanding of continuations is fairly weak, I can only default to what I've read on LTU. C++ has goto, closures, lambdas, and the ability to use macros to hide anything you think is too ugly. It doesn't seem very hard to use these to create a comma deliminated continuation of commands to execute. Now, why you'd want to do this is anyone's guess.

      Also https://github.com/tilk/libshift0 looks like someone did?

      True, it's not "first class" but in c++ things don't need to be first class to be used in the same way as the built in types. That's kinda one of the best parts of the language.

    2. Re:I don't even... by david_thornley · · Score: 1

      Wouldn't a C++ class that was treated as an input iterator be a generator? IIRC, a generator is a thing that spits out a series of values, and that's perfectly doable idiomatically in C++.

      You got most languages on that continuations thing, though. The only language I'm more than halfway familiar with that supports continuations at all is Scheme.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    3. Re:I don't even... by beofli · · Score: 1

      This might help: the splitting Inheritance into its core aspects, and how those core aspects are implemented in Go and Rust: https://lwn.net/Articles/54856...

  14. Rust has a clear purpose by phantomfive · · Score: 2

    Rust has a clear purpose, and that is to embody and enforce the coding guidelines chosen by some members of the Mozilla team, to reduce bugs. And IMO it does that very well. If you don't like those coding guidelines, then you won't like Rust. If you do like them, then Rust will be a great language for you.

    Whether those coding guidelines will become popular outside of Mozilla remains to be seen, but there is nothing wrong with them.

    --
    "First they came for the slanderers and i said nothing."
    1. Re:Rust has a clear purpose by phantomfive · · Score: 1

      BTW, to say it in a different way, using C++ safely requires vigilance and care. Imagine you are Mozilla, and you are accepting patches from programmers all around the world. It is hard to read through all the patches carefully enough to ensure there are no bugs, harder than writing it in the first place. Wouldn't you feel good knowing that there were entire classes of bugs you didn't have to check for, because the language took care of them for you?

      --
      "First they came for the slanderers and i said nothing."
  15. Re:Java code is painfully slow by Anonymous Coward · · Score: 1

    It's actually some of both. Java is a kindergarten language, and is all too often written by people who aren't very good. The good ones will have moved on to more advanced stuff.
    Yes, you get a performance hit from the layer that the JVM introduces (which isn't as significant since dyna-rec), but it's still more commonly the fault of programmers who don't get it.

  16. Rust is putting the cart before the horse by gman003 · · Score: 3, Interesting

    Rust is not yet production-usable. It has enough known bugs in the tracker that I can't even contemplate using it for a personal project, let alone for real.

    And yet they're already pushing the marketing, proclaiming it as a guaranteed C-killer. I'm sorry, but they've said that about every compiled language since C, and it hasn't been true for one of them. And you're pushing it this hard, when you're still this early along in development?

    Nobody uses C or C++ because they love the language. They use it because it has all the tools they need to debug, and all the libraries they need to run, and all the performance they need for the task. Rust maybe has the last one, but only has the second by being C-compatible (defeating the purpose of using a new language, particularly when you have to write this much wrapper code around it) and has none of infrastructure needed for large modern projects.

    Dear Rust devs: stop writing articles about how great Rust will be, and start writing stuff to make your language actually usable. Maybe then people with their heads outside their asses will listen to you.

    1. Re:Rust is putting the cart before the horse by bytesex · · Score: 2

      "Nobody uses C or C++ because they love the language."

      I take issue with that. I absolutely love C. I also abhor any movement to 'prettify' algol-like languages (python, java), which I consider useless.

      --
      Religion is what happens when nature strikes and groupthink goes wrong.
    2. Re:Rust is putting the cart before the horse by meta-monkey · · Score: 1

      There's absolutely a beauty to C. I wrote my Master's thesis (a chip multiprocessor simulator) in C, 12 years ago, and I miss it. It's never been the right language for any project I've done since, but that doesn't mean I don't miss its simple honesty. You could write a line of C and have a pretty damn good idea what the assembler output would look like.

      --
      We don't have a state-run media we have a media-run state.
    3. Re:Rust is putting the cart before the horse by FranTaylor · · Score: 2

      You could write a line of C and have a pretty damn good idea what the assembler output would look like.

      Or maybe not, if your compiler does re-ordering or any sort of optimization. In fact the C standard states explicitly that the compiler is free to generate any code it wants to as long as it correctly executes your program. So that means that your stack variables will vanish, your unused code will vanish, your loop variables and exit conditions will be re-written and in general, depending on what works best for the platform you're compiling on, the code won't look anything like what you expected. Besides all that, the generated assembler will be fragile as all heck because it is depending on processor-specific functionality for high speed and you will probably not be able to go in and tweak it without breaking it terribly. So really what good does it do to know what assembler will be generated?

    4. Re:Rust is putting the cart before the horse by meta-monkey · · Score: 1

      Well, for me I meant. I specialized in computer architecture and knew to expect loop unrolling, instructions after a branch to still complete (in some architectures), etc. Also all depending on the value of the compiler optimization flag.

      I guess I'm just saying I knew I could look at the assembly output, and that it would make sense to me. But once everything switched to virtual machines and intermediary languages...fuck it. You can only infer what comes between the VM and the metal.

      --
      We don't have a state-run media we have a media-run state.
    5. Re:Rust is putting the cart before the horse by FranTaylor · · Score: 1

      But once everything switched to virtual machines and intermediary languages...f

      You do realize that C has ALWAYS been just like this? BSD was running in the 1990s on systems like Stardent and Gould PowerNode that were not even close to the VAX/68000 security blanket so many programmers cling to. On these systems the C compiler had to perform frightful tricks to hide their strange architecture.

      And maybe you've never worked on embedded systems? Have you ever seen the remarkable acrobatics that a C compiler has to do, to generate code for strange architectures like AVR and 8051? Again the compiled code just has to work and hopefully be fast, so again the resulting assembler is a total mash.

    6. Re:Rust is putting the cart before the horse by shutdown+-p+now · · Score: 1

      I have two words for you: man cdecl. A language that needs such a hack cannot be beautiful.

    7. Re:Rust is putting the cart before the horse by meta-monkey · · Score: 1

      I have worked in embedded systems. I developed a complete multitasking OS for the Motorola HC12 microcontroller.

      Hmmmm...come to think of it, I wrote it entirely in assembly because I hated the output of the C compiler I had at the time.

      Sigh. I guess it all is just rose colored glasses.

      --
      We don't have a state-run media we have a media-run state.
    8. Re:Rust is putting the cart before the horse by JohnFen · · Score: 2

      Nobody uses C or C++ because they love the language.

      I do. I routinely use about a dozen different languages, but C++ remains my favorite by a longshot, followed closely by C.

    9. Re:Rust is putting the cart before the horse by shutdown+-p+now · · Score: 1

      It's all well and good, but declarator syntax goes back to the very first version of C (granted, if I remember correctly, it didn't have many of the more complicated constructs back then, so the grammar was simpler; but still).

      What really bugs me is that a lot of C syntax was borrowed from Algol-68 (e.g. "void", "struct", "union", "short" and "long" etc), which actually had a perfectly fine, easy to parse (both by humans and by machines) syntax for complex declarators, complete with arrays and pointers and function types - very much along the lines of what you can see in C# or Java today, but even more uniform, always reading left-to-right - e.g. PROC([] REF INT) REF []INT is a pointer to a function taking an array of pointers to integers, and returning a pointer to an array of integers. Now try writing that down in C. Why oh why did they have to reinvent that particular wheel?

    10. Re:Rust is putting the cart before the horse by shutdown+-p+now · · Score: 1

      You don't have to get into function pointers to see why C syntax is messed up - you just need to have any deeply nested constructed type, e.g. array of pointers to arrays.

  17. Re:Java code is painfully slow by Anonymous Coward · · Score: 1

    How dare you! All my classes require AbstractFactoryFactoryBuilders.

  18. I despise the blame the human idea by gurps_npc · · Score: 3, Interesting
    This quote indicates the reviewer does not know what he is talking about: "If your C++ code is not good enough or Java code is painfully slow, it's not because the technology is bad - it's because you haven't learned how to use it right."

    You don't give a 3'5" person an unmodified school bus and then say 'it's their fault for not having long enough legs'.

    You design FOR the actual people that will use your product, not the mythical perfect user.

    If people consistently make a set of mistakes, then a better designed product will prevent or at least warn/push them away from that mistake. Anytime there is a 'typical newbie error', that means that your product is bad - or at the very least should come with better free training. Minimal training required is one of the key functions of any product.

    If I give you a frozen dinner, that if properly prepared, is the most delicious thing in the world - wouldn't a version where 'properly prepared' means "Open package and wait 30 seconds for it to warm" be a lot more valuable than "Open package, season to taste, poor into sauce pan, heat until it you smell the cinnamon begin to burn, transfer to microwave, cook 5 minutes at 1000 watts, return to freezer and let sit for 2 minutes, before slicing and serving on individual plates"?

    "Open package and wait 30 second" is clearly the far superior product.

    Similarly, a variant of C++ that stops common errors is better than one that lets you do things that no one ever wants.

    --
    excitingthingstodo.blogspot.com
    1. Re:I despise the blame the human idea by ciaran2014 · · Score: 1

      I agree with your last sentence, but I think the key issue is whether the improvements of Rust are enough to justify the problems of using a language that almost no one is familiar with.

      I'm no fan of PHP, but if you want to build a contributor community for a web thingy, you'll have more of a chance by using PHP than some other language which fans will explain is superior.

      If GCC could be improved to provide to C and C++ the checking that Rust comes with, then that would be close to a win-win.

      --
      Help build the anti-software-patent wiki
    2. Re:I despise the blame the human idea by Bing+Tsher+E · · Score: 1

      That more complicated recipe you sounds like it might be something pretty good to eat.

      The second, simpler, recipe sounds like ramen noodles or a Hostess Twinkie.

    3. Re:I despise the blame the human idea by FranTaylor · · Score: 1

      the problems of using a language that almost no one is familiar with.

      maybe you can name for us a language that has never had this problem

    4. Re:I despise the blame the human idea by gurps_npc · · Score: 1
      You are correct that usually complicated recipes are necessary for good stuff.

      But you have incorrectly inferred causality. Things are not good because they are complex, nor are they complex because they are good. Nor are they bad because they are simple (or simple because they are bad.

      What you are detecting is the lack of recipees that are both complex and bad. Because such a recipee has no redeeming qualities at all.

      --
      excitingthingstodo.blogspot.com
    5. Re:I despise the blame the human idea by ciaran2014 · · Score: 1

      Why? That has nothing to do with my point.

      By definition every language starts out with this problem, but some (like C) provided such huge advantages that people were willing to learn it so they could use it. Is Rust as revolutionary today as C was?

      --
      Help build the anti-software-patent wiki
  19. Bondage and discipline Language by anwyn · · Score: 1
    "Like many of new languages, Rust is walking the path of simplification. I can generally understand why it doesn't have a decent inheritance and exceptions, but the fact itself that someone is making decisions for me regarding things like that makes me feel somewhat displeased. C++ doesn't restrict programmers regarding what they can or cannot use."

    This is the definition of a bondage and discipline language. The idea is that the central committee designing the language knows better than the programmer. The central committee will prevent the programmer from making certain "mistakes" by leaving the concepts out of the language.

    If only the central committee had control of natural language as well, they could prevent the programmer from committing thought crime by thinking forbidden thoughts.

    As it is, the programmer will flee the bondage and discipline language as soon as he figures out what is going on.

  20. garbage under, garbage above by epine · · Score: 1

    It's a statement of fact, and everyone - including you and me - is terrible at programming.

    Simply not true, unless you believe that non-terrible code requires God himself to reach down and personally touch type.

    I heard a bit of CBC episode recently, where a breathing consultant by the name of James Chambers argues that humans are terrible at breathing, and that with proper training (this takes about a year), we're almost competent (and then flowers bloom everywhere in an orchestral swell).

    Breathe In, Breathe Out

    One thing I will say is that a programmer is only as good as the API he or she programs against. In the spirit of Bill Maher, I hereby announce a New Rule: Garbage under, garbage above.

    Most of the programmers with legendary reputations for writing correct systems have worked at (or fairly close to) the bare metal (or some POSIX-ratified virtual bare metal with extra starch).

    Humans actually suck at just about everything. Programming is not especially special (modulo rampant innumeracy). All the greats in any discipline recognize and work within their personal limitations.

    It's not constructive to become so bitter that you give up, or delegate the hard work to a tool that can only take you so far (perhaps less far than you wish to go).

    Just the other day I listened to this Econtalk episode from six months back: Joshua Angrist on Econometrics and Causation

    For the entire episode, Russ Roberts is trying to play the same pessimism card, effectively implying that humans suck at everything.

    Joshua Angrist is having none of it. He directly refutes the posture of excessive pessimism time and again. It's a joy to hear Russ taking one on the chin for a change.

    Now we just need an enterprising academic to self-subscribe to a personal mission to save us all from ourselves to come along and wrap up the whole of econometrics into a protective cocoon inside of which many of the basic errors simply can not be made.

    Brave new world? Or cult of pessimism?

    In my corner of the world, hard-baked optimists don't write unthinking rants anchored on assertions prefaced with "statement of fact". Wits on dial tone predicts no good thing.

    1. Re:garbage under, garbage above by Bing+Tsher+E · · Score: 1

      In my corner of the world, hard-baked optimists don't write unthinking rants anchored on assertions prefaced with "statement of fact". Wits on dial tone predicts no good thing.

      Can you post that again, more clearly, and this time using more metaphors?

    2. Re:garbage under, garbage above by Beck_Neard · · Score: 2

      > Humans actually suck at just about everything.

      We are great at the things we actually evolved to do. Language, visual perception, navigating social situations, etc. These are the reasons we went from 500 cc of brain volume to 1500 cc. These are extremely hard problems that require the equivalent of petaflops of computation.

      Yet it takes minutes of conscious effort for us to multiply two puny 10-digit numbers! We are extremely and demonstrably bad at doing arithmetic. The reason? Our working memory capacity is extremely limited and we have trouble consciously holding a lot of different pieces of information or outcomes in our heads simultaneously.

      That's one of the reasons we are terrible at programming. We simply are unable to think of all the different ways our code can go belly-up. There's nothing subjective at all about what I'm saying. That you think it's equivalent to a 'proper breathing' quack shows you aren't even making a tiny bit of effort to understand my point.

      --
      A fool and his hard drive are soon parted.
    3. Re:garbage under, garbage above by ChrisMaple · · Score: 1

      Please tell me the living thing that is better at programming than human beings.

      --
      Contribute to civilization: ari.aynrand.org/donate
    4. Re:garbage under, garbage above by Beck_Neard · · Score: 2

      Whenever a programming task can be precisely defined, a machine can do it better. The process of converting C to assembly is hard for humans but machines can do it easily. The evolution of programming has mostly been a repetition of the same theme: Identification of a problem, clumsy efforts by humans to solve that problem manually, development of a process that automates that problem, and then sitting back and letting the computer handle that particular problem while we move on to more challenging ones. You could say this about not just converting high-level code to assembly (early programs that did this were called 'autocodes' and were in the domain of AI research), but about parallelism and type checking and memory analysis.

      --
      A fool and his hard drive are soon parted.
    5. Re:garbage under, garbage above by bingoUV · · Score: 1

      You didn't answer the question "Please tell me the living thing that is better at programming than human beings."

      You made up another question and answered it - doing a "programming task" that "can be precisely defined".

      So groups of humans remain the best known programming machines - where programming is defined as repeatably solving real world problems with computers. Which is what a vast majority of programmers do.

      --
      Bingo Dictionary - Pragmatist, n. A myopic idealist.
  21. Re:Someone is making decisions for me regarding th by DreamMaster · · Score: 4, Insightful

    Some cases I've used them for that I didn't feel dirty about are:
    * checking for failure conditions from calls to sub-methods, and jumping to a common cleanup and exit code block. Difficult to replicate cleanly without massive if blocks, or abusing exceptions.
    * Cleanly breaking out of multiple nested loops
    * I've used them for an implementation of coroutines, which simulates threading for systems which don't have threads. In this case the GOTOs were nested inside macros and stub classes for holding context, but the whole scheme wouldn't have worked without them.

  22. Get the bullshit bingo bot out of here! by bytesex · · Score: 3, Insightful

    People who say 'C/C++' are likely to know neither language.

    --
    Religion is what happens when nature strikes and groupthink goes wrong.
    1. Re:Get the bullshit bingo bot out of here! by Anonymous Coward · · Score: 2, Insightful

      People who criticize the term "C/C++" are really Python programmers.

    2. Re:Get the bullshit bingo bot out of here! by shutdown+-p+now · · Score: 1

      Sometimes it does make sense to lump C and C++ together. For example, when discussing memory safety or performance, which is going to be the focus in any comparison of either one of those with Rust.

    3. Re:Get the bullshit bingo bot out of here! by david_thornley · · Score: 1

      Except that C and C++ are way different in memory safety. C++ gives you tools to manage memory far more safely than C. It doesn't require that you use them, and it can't without violating the initial intent of the language, but reasonably disciplined use of smart pointers will totally eliminate a large number of memory problems.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    4. Re:Get the bullshit bingo bot out of here! by shutdown+-p+now · · Score: 1

      From the perspective of something like Rust, that difference is pretty small. In C++, it's still "harder" to use a smart pointer than it is to use a raw pointer, and basic language constructs like e.g. "new" or string literals are raw pointers - and you need to be aware of, and explicitly use, the standard library mechanisms instead to wrap them into safe types. In Rust, safety is the pervasive default, and the escape hatch from it is made very, very explicit on every use.

    5. Re:Get the bullshit bingo bot out of here! by shutdown+-p+now · · Score: 1

      I haven't touched them for ages - where I work the only excuse for not using std::make_unique is if your constructor is private, in which case you new into a unique_ptr instead.

      This is actually a pretty good example. For one thing, make_unique is brand new (C++14). For another, as you note, it can't be used with private constructors, so you still have to remember how to use plain new with unique_ptr, and in particular that you cannot write it like this:

      foo(std::unique_ptr<bar>(new bar), std::unique_ptr<baz>(new baz))

      (because of the unspecified order between constructors of bar/baz and constructors of unique_ptr, making it possible to leak memory if new bar/baz throw)

    6. Re:Get the bullshit bingo bot out of here! by david_thornley · · Score: 1

      In C++, it is easy to use smart pointers for ownership, and it's easy to check whether they're used properly in a code review. Can you do the same in C? In C++, safety is accomplished through a style guide, and the escape hatch is obvious.

      If you want your programmers to be unable to write bad code, fire them. If you trust them to write reasonably good code, and stick to a style, C++ smart pointers work fine. If you're not using code reviews to enforce style, start.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    7. Re:Get the bullshit bingo bot out of here! by shutdown+-p+now · · Score: 1

      It's easy, except for all the corner cases (as is usual in C++). See my other comment in this thread.

      Yes, with proper discipline, you can absolutely do this in C++, I'm not disputing that. But Rust takes it one step further by enforcing said discipline on you. Escape hatches are still there; but unlike C++ where they (raw pointers & arithmetic, arrays etc) are the default, and you have to consciously force yourself to use smart pointers instead, and know how to use them right, in Rust the defaults are safe, and the "fuck off, I know what I'm doing" mode must be explicitly requested. Needless to say, this generally leads to better code, regardless of how good your programmers are (all humans make mistakes).

  23. Re:Someone is making decisions for me regarding th by Anonymous Coward · · Score: 3, Insightful

    When has a goto ever been incorrect? Your question doesn't make much sense.

    Obviously you can use structured programming constructs to emulate a goto, and vice-versa. And in either case end up with _correct_ code. But when you're using a single-iteration loop or deeply nesting conditional blocks just to get the same effect as using goto, the goto should be preferred for the benefit of simplicity and readability.

    In C code goto's are very useful for jumping to error handling code that rewinds the state of the local function. They're also useful when trying to follow a single-point-of-return discipline, whether in C or any other language. They're useful for writing explicit state machines--I use a switch more often, but sometimes using gotos is cleaner, and in GCC computed gotos are helluva fast. Finally, gotos are exceptionally useful when generating code. In fact, Lua re-added goto support in 5.2 because the authors realized how unnecessarily painful it was to machine-generate Lua code without goto support.

    You should be focusing on writing clear and simple code, using whatever constructs your language provides. Feeling "dirty" about using gotos doesn't make any sense. When was the last time you carefully paid attention to arithmetic overflow in your code (C or otherwise)? Ignoring that stuff should make you feel dirty. Not use of goto.

  24. Old programming languages never die by Tony+Isaac · · Score: 1

    C++ isn't the only one. COBOL is still around, and even has object-oriented extensions these days. Fortran, RPGII...I can't think of a single outdated but widely-used language that has every gone away.

  25. If I hear this again, I may puke. by gestalt_n_pepper · · Score: 4, Insightful

    If your C++ code is not good enough or Java code is painfully slow, it's not because the technology is bad - it's because you haven't learned how to use it right. That way, you won't be satisfied with Rust either, but just for some other reasons."

    Gods, I wish we could force EVERY programmer to take some basic neurophysiology and at least one human factors course.

    If the language is hard to use and makes it easy to make mistakes, the language design is wrong. NOT the humans. The humans, by definition *can't* be wrong. A language is like any other machine. In this case, it's purpose is to provide a highly granular interface to the system FOR HUMANS.

    Machines, any machine, exist for exactly, and only one reason, to serve humans efficiently (i.e to reduce human physical and cognitive labor to a minimum while allowing them to accomplish their goals).

    If a language accomplishes that, the language is well designed. If it doesn't do that due to obfuscated syntax, a lack of safety checks, over-engineering (It does so much) and under-design (What it does is almost impossible to understand and use), then the language is badly designed, and the language designers, incompetent, because they neglected to consider the human part of the system in their design.

    --
    Please do not read this sig. Thank you.
  26. Pretty weak by Tailhook · · Score: 1, Troll

    I'll limit myself to the 286 word (!) summary and not RTFA — because Damn! — that's bad enough.

    [W]hat actually makes Rust safe, by the way? To put it simple, this is a language with a built-in code analyzer

    What makes Rust safe is language design that permits that code to be analyzed. Costly C++ code analyzers that hardly anyone actually uses can't match Rust's built-in, for-free, automatic analyzing compiler because the C++ language itself precludes this.

    The rest of the first paragraph amounts to `Rust isn't necessary because C++ is improving.' Anyone that's been watching C++ develop for the last 30 years knows there are both technical and political limitations to how much C++ can ever improve and some people can't wait another 30 years to get halfway there.

    Then we get into this drivel;

    I can generally understand why it doesn't have a decent inheritance and exceptions, but the fact itself that someone is making decisions for me regarding things like that makes me feel somewhat displeased.

    Decent? C++ has `decent' inheritance? I'd be surprised if the author actually understood C++ inheritance. I know most C++ programmers don't. Rust spaces that '80s OO crap and gives you a clean, simple system of traits. You're not limited in any way by that design unless you're employed to write FAQ answers and blog posts about the subtleties of mis-designed C++ OO.

    As for C++ exceptions; here is Mozilla's policy on C++ exceptions: "do not use try/catch or throw any exceptions." Here is Google's policy on C++ exception's: "We do not use C++ exceptions." C++ exceptions are broke. Full Stop. These people understand this. The author doesn't.

    If the lack of C++ inheritance and C++ exceptions are the best you can come up with to disparage Rust then sign me up for Rust.

    --
    Maw! Fire up the karma burner!
    1. Re:Pretty weak by steelfood · · Score: 1

      Yup. Those arguments seem pretty weak to me. Both inheritance and exceptions are a total crapshoot in C++ (among other so-called features). Any change to those parts of C++ can only be a positive, including completely removing them from the language spec.

      Just from TFS, it sounds like somebody who's only dabbled with C++ or maybe even Java and not C++ at all. Like somebody else posted above, whoever says C/C++ most likely knows neither language well, if at all.

      I haven't looked at Rust at all, but if it's strictly C with classes and better memory management, it's worth looking into. It doesn't even need templates (which is often another big no-no in production engineering shops along with exceptions). All that's missing from C is good class syntax and maybe a better way to do function pointers, and it's about as good a language for both high and low level programming as you're gonna get. Though if anything, the biggest (fundamental) problem with C is the assignment operator. They should've gone with the Ada := instead of =. If Rust (or whatever other C-derived language) fixes those three things, the rest of the C family of languages would be made completely obsolete.

      --
      "If a nation expects to be ignorant and free in a state of civilization, it expects what never was and never will be."
    2. Re: Pretty weak by nten · · Score: 1

      I remembered one more. The binary file io and probably all binary io and serialization is about half the speed of java unless you write your own read into a buffer method and wrap it in an unsafe region.

      --
      refactor the law, its bloated, confusing and unmaintainable.
    3. Re:Pretty weak by david_thornley · · Score: 1

      As for C++ exceptions; here is Mozilla's policy on C++ exceptions: "do not use try/catch or throw any exceptions." Here is Google's policy on C++ exception's: "We do not use C++ exceptions." C++ exceptions are broke. Full Stop. These people understand this. The author doesn't.

      And how much did you have to dig to find these policies? Were they right out in the open? Does that imply that they may be looking for code from outside, and that they may have a very strong interest in limiting C++ to those things that can be fairly easily checked independently? C++ exceptions work well, but they can be misused, and can be difficult to debug if not used well.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    4. Re:Pretty weak by Tailhook · · Score: 1
      --
      Maw! Fire up the karma burner!
    5. Re:Pretty weak by david_thornley · · Score: 2

      Yup. In other words, both Mozilla and Google have style guides that are good for filtering outside submissions. There's any number of style guides that endorse C++ exceptions, but they aren't typically as public-facing.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    6. Re:Pretty weak by Tailhook · · Score: 1

      You're exhibiting some reading comprehension problems.

      Google has not stated that outside contributors must not use exceptions. They declare:

      "We do not use C++ exceptions"

      The "We" in that is inclusive. Google themselves "do not use C++ exceptions." They also elaborate on exactly why they themselves do not use exceptions.

      There is no reason to interpret the Mozilla policy as applying only to outside submissions either. Unless, of course, this is not to your liking and you invent fictional reasons.

      There's any number of style guides that endorse C++ exceptions, but they aren't typically as public-facing.

      Cite some. How you know this about non-publicly facing policies is an interesting question.... but I'll give you the benefit of the doubt if you do, remembering that others around here might call you on it if your claims aren't correct.

      And Microsoft doesn't count. They've integrated their deviant compiler with their proprietary OS according to their own questionable design and vertical implementation.

      --
      Maw! Fire up the karma burner!
  27. better reasons by nten · · Score: 3, Informative

    Given the support for the functional paradigm that rust has, I am dissapointed that parallelizing folds and maps is so verbose and thought requiring. Not sure why a fold can't just use all the cores like in haskell.

    Sting slices vs strings. Verbose again but it works.

    No tail call optimization, makes some FP stuff impossible.

    No metaprogramming.

    Regex library is slow. But I don't use regex and it is on the long list to improve.

    Compile times. It rebuilds everything in a library or exe even if you only changed one line. Also it is just slow. Even hello world takes surprisingly long. This is really annoying because I have a habit of recompiling quite regularly as I code.

    Cargo, the package manager and build system is inflexible in that it does not let you pass command line parameters to rustc. This means that if you want to cross compile or use simd or any of the other cool stuff you get by building on the llvm back end, you have to roll your own build system with make or cmake or whatnot.

    That said, I am still excited about it.

    --
    refactor the law, its bloated, confusing and unmaintainable.
    1. Re:better reasons by Tailhook · · Score: 1

      The only one on your list that actually worries me is the compile times.

      It's explicitly not a goal to produce the most concise language possible. It's not a competitor of Haskell/Ocaml/F#/etc., and it doesn't need to be to succeed. Cargo is a build system for a beta language.... fixable. Slow regex isn't inherent to the language.

      But if Rust suffers Scala like compile times then yeah, that's bad. Compile time matters.

      --
      Maw! Fire up the karma burner!
    2. Re: better reasons by nten · · Score: 1

      They know they need to work on the compile times and if you consider the time it would take the static analysis tool then it is understandable. The dependency detection part of the compile time issue is with cargo. I haven't gotten another make system to work yet but it might solve that problem too. They intentionally decided to hide the compiler flags in cargo so I intentionally decided not to use it. There are people using both autotools and cmake.

      The other stuff is just minor as you said.

      --
      refactor the law, its bloated, confusing and unmaintainable.
    3. Re: better reasons by FranTaylor · · Score: 1

      The lack of tail call optimization is a deal breaker for any sort of advanced programming.

      Many fast algorithms have been written to assume tail optimization, these are all out of consideration..

    4. Re:better reasons by complete+loony · · Score: 1
      Internally rust uses the LLVM compiler toolchain so there are a number of features in LLVM that they could use.

      No tail call optimization

      If it looks like a tail call, there's a pass that will turn it into a tail call. I think there's even a pass that can turn recursive code into a state machine.

      Regex library is slow.

      I hope they do something like redgrep. Using the LLVM backend to compile the regex state machine into actual machine code.

      --
      09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
    5. Re: better reasons by aaaaaaargh! · · Score: 1

      What on earth do you mean by "I don't think TCO has ever mattered much"? TCO is the bread and butter of every Scheme dialect and of all strictly functional programming languages on earth. A vast range of data structures and algorithms for FP rely on it.

  28. Re:clever things by FranTaylor · · Score: 1

    you're not going to achieve anything clever with an invalid pointer

  29. News Flash by viperidaenz · · Score: 1

    Shitty programmers write shitty code, regardless of language.

    1. Re:News Flash by FranTaylor · · Score: 1

      click the software update button on your computer and it's clear that EVERYBODY writes shitty code

  30. Re:Quantum Computing. by ChrisMaple · · Score: 1

    C is "obtusely large"? C is fairly small, and is only moderate sized when the standard libraries are used (and not all programs need all the standard libraries.) To consider C "obtusely large" you have to be considering all commonly used libraries including such things as jpeg and regular expressions. It's just not a reasonable estimate.

    --
    Contribute to civilization: ari.aynrand.org/donate
  31. Re:Someone is making decisions for me regarding th by brantondaveperson · · Score: 1

    Some cases I've used them for that I didn't feel dirty about are:
    * checking for failure conditions from calls to sub-methods, and jumping to a common cleanup and exit code block. Difficult to replicate cleanly without massive if blocks, or abusing exceptions.

    Or using C++...

    * Cleanly breaking out of multiple nested loops

    Tough one. I have to be honest, I've never used a goto in my code since I stopped writing BASIC, but I've sometimes missed this ability. Still, a language-level keyword like "breakall;" would be better than goto. Except insofar as it doesn't exist, and "goto" does...

    * I've used them for an implementation of coroutines, which simulates threading for systems which don't have threads. In this case the GOTOs were nested inside macros and stub classes for holding context, but the whole scheme wouldn't have worked without them.

    Sounds clever. I hate macros even more than goto, so I expect seeing the code would send me into anaphylactic shock.

  32. Re:Someone is making decisions for me regarding th by perpenso · · Score: 1

    When has a GOTO ever been correct?

    In assembly language. :-)

  33. Re:Someone is making decisions for me regarding th by perpenso · · Score: 2

    * Cleanly breaking out of multiple nested loops

    Tough one. I have to be honest, I've never used a goto in my code since I stopped writing BASIC, but I've sometimes missed this ability. Still, a language-level keyword like "breakall;" would be better than goto. Except insofar as it doesn't exist, and "goto" does...

    The problem is break one and break all are not the only cases. Perhaps you only want to break some but not all levels of nesting.

  34. Re:Quantum Computing. by FranTaylor · · Score: 1

    it's not the implementations that are too large, it's the specification that's too large.

    How many ways are there to dereference a pointer? you can use either *foo or foo[0] but why? Nothing is gained from having two ways to do it, it just makes the language more obscure.

    The c preprocessor by its nature is a hulking uncontrolled nightmare that can and will deposit horrible bugs everywhere in your program, you can choose any one of a literally infinite array of options to solve your problem.

    And then there is the typedef operator, which can also be abused in fascinating ways to achieve truly unfindable bugs, without really contributing much of anything to the language. Or maybe you can just use the preprocessor instead. For extra points, use both the preprocessor and typedefs to drive your fellow coders absolutely insane.

  35. Re:Someone is making decisions for me regarding th by brantondaveperson · · Score: 1

    To be honest, if your loop structure is that deep then you'd be better off refactoring the code into a function that performs the inner loop or loops. This is quite likely to make the code easier to read anyway. I've never written code with a triple-nested loop and found myself needing to break out of the inner loop, straight into to the outer loop. Perhaps I haven't lived :)

    I guess it's a personal thing. I personally don't like goto, because it can go anywhere. Other people like it for exactly the same reason. So it goes.

  36. Re:Someone is making decisions for me regarding th by iluvcapra · · Score: 1

    Since this is Rust/Swift day on /., I'd bring up that swift doesn't have `goto` but it does have named break statements.

    processDocs: for doc in allDocs {
      for line in doc.allLines {
          let sum = parseLine(line)
          if sym == .EndOfDoc {
            break
          } else if sym == .StopProcessingAllDocs {
            break processDocs // breaks the outer loop
          } else {
            handleSym(sym)
          }
      }
    }

    --
    Don't blame me, I voted for Baltar.
  37. Re: Someone is making decisions for me regarding t by ZeroWaiteState · · Score: 1

    Nah dude. Real men use tail recursion and binding expressions.

  38. Legacy compiler by tepples · · Score: 1

    C++ has const, volatile, static, thread_local, and a whole host of atomic flags in std::atomic [...] It's mostly a factor of people not caring enough to learn what they need to do.

    That and needing to compile for targets that have only a pre-C++11 legacy compiler.

  39. Re: Java code is painfully slow by Anonymous Coward · · Score: 1

    I disagree. I have long experience from C and C++ plus few other languages. And I moved to Java because I like it. You can easily write crap with it. But the difference is that it is easy to refactor.

  40. Re:Java code is painfully slow by gweihir · · Score: 1

    Quite often it is because the "developer" that wrote it has no clue how Java gets compiled and executed. One problem is that the Java compiling and execution mechanism is far too complicated. Another is that it is relatively simple to get something to work (badly) in Java, so average developer skill is not very good. C++ has far less problems in those regards and C has even less. The point is that while Java appears to be simple, it is hugely complex behind the scenes and as soon as you do something a bit more complicated, that complexity does not stay hidden anymore.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  41. Simplification? by ThePhilips · · Score: 1

    Rust is walking the path of simplification.

    Really?

    Author apparently hasn't seen the crazy monstrosity the Rust's preprocessor is.

    Otherwise, IMO, Rust and this type of languages - "the perfect cage" - to me are dead end.

    (A) I want an utilitarian language. I want language which provides me with strict and weak typing, static and dynamic binding, compiled/jitted/interpreted execution with eval() function. At the same time. Probably all that in different scopes - but the scopes should be able to inter-operate. Think Objective-C++ - but with something better than Objective C on the weak side of things, with bits of Perl-ness built-in.

    I want a language which gives me choice. Not another language with dozen theoretical papers why I can't do something and I'm better off for it.

    (B) For security, I would rather want an language which can be easily validated and proofed. Rust tries to create a perfect cage - for developers - while the main security vulnerability is the user input. Compilers still can't guess whether I have properly validated the input or not. The Rust went in a different direction: annihilating C/C++ bugs. The problem is that all other bugs programmers make - still remain.

    --
    All hope abandon ye who enter here.
  42. Re:Someone is making decisions for me regarding th by gweihir · · Score: 1

    GOTO is fine when doing a state-machine in a certain style. Also, things like "continue" and "break" are limited forms of GOTO that are generally accepted and breaking out of nested loops becomes very tedious if you have to do it one at a time.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  43. A critic about D??? by FithisUX · · Score: 1

    I would be also interested to see the author's opinion on D and how it compares with C++.

  44. Finally ! by Laxator2 · · Score: 1

    An comment which not only makes sense, but it also touches on the most important point. That in the right hands, a language like C++ is a very powerful tool.

    Let me just add that in the scientific computing community the much-maligned FORTRAN is very much alive. Remember the saying "You can write FORTRAN in any language" ?

    You can't do much structured programming in this language, but then you don't have to. Read in a file, run a bunch of nested loops, write the output. And it is very, very fast, a necessary asset when you run all the time into the limitations of the hardware. In the right hands, FORTRAN is a very powerful tool indeed.

  45. Java *IS* slow by BlueBlade · · Score: 1

    I agree with most of the submitter's points, except for the "if Java is slow for your then you aren't using it right". Sure, if all you're doing is a tightly optimized PI calculation simulator, Java can match (or even, in some cases, beat) C/C++ performance. In a real-world user application though, it falls apart. I have never, ever used client-side Java application that wasn't a huge RAM and CPU hog. All you need to do is look at any big client-side Java application to realize that. Practically anything that has a user GUI is a disaster. Case in point : Eclipse, Open/LibreOffice. If it runs on Java, it's on that list.

    Java works really well for some server workloads with well-defined inputs, processing, then output. Anyone using Java to develop client GUI apps is using the wrong tool for the job. I'm looking at you, Cisco (ASDM, SDM, Network Assistant, etc).

    I used to be a huge java on the desktop proponent, but the end results have since changed my mind. Show me a few large desktop applications that aren't slow and painful to use and maybe I'll change my mind. Until then, please stop using Java on the client side.

    --
    Religion is the best example of mass psychosis
  46. Re:Quantum Computing. by JohnFen · · Score: 1

    How many ways are there to dereference a pointer? you can use either *foo or foo[0] but why? Nothing is gained from having two ways to do it, it just makes the language more obscure.

    Something is gained, though: self-documentation. The way you dereference a point (should) reflect what the pointer is being used for.

  47. Re:Someone is making decisions for me regarding th by matfud · · Score: 1

    Even java has labeled breaks

  48. Re:Someone is making decisions for me regarding th by perpenso · · Score: 1

    To be honest, if your loop structure is that deep then you'd be better off refactoring the code into a function that performs the inner loop or loops. This is quite likely to make the code easier to read anyway. I've never written code with a triple-nested loop and found myself needing to break out of the inner loop, straight into to the outer loop. Perhaps I haven't lived :)

    I guess it's a personal thing. I personally don't like goto, because it can go anywhere. Other people like it for exactly the same reason. So it goes.

    Personally I think its a length thing. If the loops are very short, if all the nesting is simultaneously visible on screen, no scrolling necessary, then it might be OK. It all depends on the complexity of the code too, the logic would also need to be something readily understandable, the partial bailout something natural, not just some optimization trick.

    Have I done so, in C/C++ not sure, in assembly probably. :-)

  49. Re:Someone is making decisions for me regarding th by vilanye · · Score: 1

    Really?

    You do realize that break is a goto and is being used is the same way as a goto and you don't have to clean up on success?