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."

386 comments

  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 Anonymous Coward · · Score: 0

      Probably ought to get some experimental verification for these wild hypotheses then.

    2. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 0

      Eh, as long as someone uses it, the language will exist. If whatever subject can be replaced with made-up sports teams and the arguments still make sense, then perhaps whatever you're arguing about doesn't have that much significance. Peace out people, I'll catch the next discussion.

    3. 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.

    4. 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.
    5. 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
    6. 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.

    7. 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!
    8. 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.
    9. 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.
    10. 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
    11. 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.
    12. 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
    13. 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.
    14. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 0

      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?)

      You need to abandon your ancient understanding of Fortran. Fortran is case-insensitive except when you tell the processor that it isn't! Section 15 of the Fortran 2008 standard is entitled "Interoperability with C", and explains in detail how to use either FooBar or foobar as a binding label

    15. Re:Pretty sure the heat death of the universe will by mark-t · · Score: 1

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

    16. 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.

    17. 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.
    18. 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.
    19. 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.
    20. 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
    21. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 0

      Certified by whom?

    22. 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.

    23. 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.

    24. 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.
    25. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 0

      C++ code can only be called by other C++ code. Same with Java, Python, etc.

      Weird, considering I spend a lot of time at my job having Fortran, C++ and Python libraries talk to each other, as some science research evolves such that numeric codes written by different people have to now work together on multi-domain problems. Yet it keeps chugging forward just fine, even if the Fortran solver is calling Python and C++ functions the define models, etc.

    26. 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.

    27. 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!
    28. 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.

    29. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 0

      Right yeah so fall back to linking conventions from 20 years ago. No multiple return params for you! Problem solved, why would anyone dream of something better.

    30. 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...

    31. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 0

      It is the only major drawback of c++ tho. At least the only one the ever makes extra work for me.
      We produce several SDKs at my work and we have to produce C APIs so they can be linked by other programs since we can't guarantee which compiler the end user will choose. It's a pain in the arse to maintain, it'd be much better if we could just give the c++ headers (or a cut down version of them with just the API we want exported) and the user could use whatever compiler they want and it all just work.
      I'm in favour of just work.
       

    32. 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!
    33. 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.
    34. 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

    35. 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
    36. 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
    37. Re:Pretty sure the heat death of the universe will by Zappy · · Score: 1

      So say we all

    38. 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
    39. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 0

      No but on the other hand his suggestion isn't a million miles away from one of Roger Penrose's (and one can never accuse Penrose of not understanding time dilation). The idea hinges on the fact that when everything has become radiation, (4d) distance effectively becomes meaningless -- radiation propagates along null geodesics, meaning that the 4d distance as measured along its travel path is zero. Penrose's conjecture, which he has never to my knowledge demonstrated is viable, is that what we dub "future null infinity" -- effectively the set of all points that found when one extends to infinity along all null geodesics aimed at the future -- can be directly mapped onto "past null infinity" which is the same but in the past.

      Unfortunately I've seen no proof that this works in a dynamic spacetime. It makes some kind of sense in a normal (Minkowski) spacetime, and it makes sense in the black hole spacetimes, but I'm less convinced it makes any sense in something like cosmology (Robertson-Walker) for the simple reason that the past infinity of null geodesics in Robertson-Walker is a dirty great singularity. I believe he waved his hands and said that at some point in the early universe there was only radiation (possible but very much unproven, and unprovable) and that future null infinity could map onto that time.

      Of course, it didn't stop him and Gurzadayan publishing a range of unconvincing papers claiming they'd seen the impacts of this effect on the CMB...

    40. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 0

      What the fuck are you talking about? It doesn't compile C++ code as C,

      You cannot compile C++ as C, you moron. Even with extern C. in order to make your c++ compiler produce a loadable lib.so file you need to actually *write* C. the only way to do that with a c++ compiler is to use that tiny subset of c++ that the c compiler will allow. so, no you cannot use c++ language to make lib.so

      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!

      Only on slashdot would a comment that is
      a) not-wrong-and-yet-not-quite-correct-either
      AND
      b) abusive
      AND
      c) ad-hominem
      goes to +5 insightful. It wouldn't be so bad if the correction you posted was actually correct. Try compiling your library without forcing the compiler to use c.
      Yeah, I thought so...

      No overloaded functions,
      no classes,
      no MI,
      no polymorphism,
      no fucking standard c++ library (so your c++ library better not use any of the fucking containers libraries)
      No std::string,
      no constructors,
      no destructors,
      no exceptions,
      no iostreams,

      That's some weird fucking c++ library you have there buddy, missing all those things.

      Were you dropped on your head as a kid or did this obstinate stupidity come with years of practice?

      Seriously mods? Someone shows this little tech knowledge and you mod them up? WTF?

    41. 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.

    42. 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!

    43. 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.
    44. 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.
    45. 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.
    46. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 0

      One place must be outside of the universe in his example.

    47. 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
    48. 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
    49. 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
    50. 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
    51. 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.
    52. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 0

      Scientific Community Fail

    53. 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

    54. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 0

      What the fuck are you talking about?...

      you are the shouting one, he seems confident. also, i really don't get people like you, who always start a conversation with a fuck. if you have something to say, just say it and it will capture eyes, if you don't have anything to say, just shut up, because all your yammering will be considered just noise.

    55. 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.
    56. 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.
    57. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 0

      Well, Linux is an operating system, not a programming language, so it's at a little deeper level. Writing an operating system is a pretty major undertaking. Most COBOL software is written for a specific purpose and is a lot less complex. And the changes required over time to keep up with new stuff are mostly driven by business logic, and typically involve tweaking the behavior of established processes. Not to trivialize it, but it's a lot easier to alter a business process than it is to write drivers for new devices or take advantage of new processor capabilities.

      But having worked for 30 years in what is now considered by many to be a legacy programming environment (FoxPro), I've seen a lot of this play out over several cycles. And I've found that a lot of it depends on the extensibility and organization of the original design. If that supports growth, and the mods are done with an eye towards possible future enhancements, you can keep an application going for a long, long time. It's all about best practices. For example, commenting code is critical - a good rule of thumb is to assume that you or your successor will at some point have to revisit every line of code you write, and comment every non-trivial statement. Etc.

    58. 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
    59. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 0

      Java is nowhere near the Smalltalk system of objects.

      They live in different dimensions.

      Java completely missed the point of OO.

      OO is all about message passing and nothing to do with nouns, which Java is obsessed with. That is the big thing with OO, message passing. C++, Perl, Python, PHP and a ton of other languages completely misapplied it.

      Even Alan Kay is pissed off that people misunderstood(except for Smalltalk and its descendents like Ruby) and misused the term object oriented.

    60. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 0

      Literally ANYTHING you can do in any turing complete language, you can do in any other turing complete language.

      The only differences is how difficult it is to do and how performant it is.

    61. Re:Pretty sure the heat death of the universe will by Anonymous Coward · · Score: 0

      Ruby is purely OO and is written in C.

      There are lots of OO libraries for C around.

    62. 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. Java code is painfully slow by Anonymous Coward · · Score: 0, Troll

    Java code is painfully slow, it's not because the technology is bad

    Yes it is.

    1. 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.

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

      How dare you! All my classes require AbstractFactoryFactoryBuilders.

    3. 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.

    4. 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.
    5. Re: Java code is painfully slow by Anonymous Coward · · Score: 0

      Mine required AbstractFactoryFactoryBuilderFactory.

    6. Re:Java code is painfully slow by Anonymous Coward · · Score: 0

      You have three things called Java.

      The JVM which is extremely fast with its JIT compiler, but fairly bloated.Memory allocation is faster than any malloc implementation and deallocation is normally faster than free, even before they finally put short lived objects on the stack where they belong. The only major grip besides the memory usage is that it completely ignores integer overflows making it impossible for the programmer to detect reliably. That is an entire class of security exploits that they pretend it doesn't exist.

      The language, which is a pile of shit. Especially is laughable type system which is neither strong nor weak but some unholy mixture. It is also so bad that every Java framework in existence mainly exists to hack around that horrible type system. NullPointerException should never be a thing in a language that is statically and allegedly strongly typed. Also idiocy like this makes it a laughingstock:

      ArrayList myString = new ArrayList(); //Why in the name of all that is holy is the constructor and initializer mixed together???

      ...

      String tmp = (String)myString.get(0); //WTF????

      Even more laughable is that there is no first or last methods, but that brings us to:

      The API, which is a mix of shit and honey.

      Java the language and API was developed for the mediocre programmer and created by some amazingly great programmers, and mediocre programmers are about the only people that use it willingly.

      At least it isn't PHP. Designed by clueless dumb-shits to be used by clueless dumb-shits.

    7. Re: Java code is painfully slow by Anonymous Coward · · Score: 0

      That is because it holds your hand. It was designed for mediocre programmers and it is great that you admit that and work with all that bloated safety equipment.

  3. 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 Anonymous Coward · · Score: 0

      Yeah. Why should skill and table saws have a shield at all? Fucking users should get what they get. Fucking car airbags should inflate only if the driver is not at fault, cux fuck em.

    6. 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.

    7. 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.

    8. 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.

    9. 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."
    10. 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."
    11. 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.
    12. 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.
    13. Re:An Old Story by Anonymous Coward · · Score: 0

      There are plenty of old carpenters and foolish carpenters but foolish old carpenters are rare.

    14. 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.
    15. 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.

    16. 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."
    17. 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.

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

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

    19. Re:An Old Story by Anonymous Coward · · Score: 0

      The fastest way to get the programming done is not necessarily the best way to get the program done.

      I've found for non-trivial programming there is rarely a "best way" to get the program done, but instead a increasing set of diminishing returns you can get for various options. Everyone has to draw a line somewhere between time and optimizing for different goals, even without tight deadlines.

    20. 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.
    21. Re:An Old Story by Anonymous Coward · · Score: 0

      That gets said, but isn't really true. There plenty of old and foolish carpenters, some even get more foolish as they get older, more confident, and complacent. "I don't need a splitter on the table saw, I'm not some kid who can't tell when a board is going to pinch." "You pinched the blade just last week, the whole shop care hear the noise and cursing you know..."

      It is not like it is specific to working with wood either.

    22. 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.
    23. 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.

    24. 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.

    25. 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.
    26. 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).

    27. Re:An Old Story by Anonymous Coward · · Score: 0

      I agree with everything you've said except "best and fastest solution to a problem".

      There is absolutely no way you can argue that C++ compiles in the best and fastest way it could. The language designers don't even seem to have covered grammars in their studies, not when they started and at no point in the last 20 odd years.

    28. Re:An Old Story by Anonymous Coward · · Score: 0

      You don't work in the IT industry I hear. Academia?

      Not even the fastest way is fast enough. Quality of the result is largerly insignificant.

    29. 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.
    30. 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.
    31. 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.
    32. 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.
    33. Re:An Old Story by Anonymous Coward · · Score: 0

      I mostly slop C when I code. But program in some other languages on occasion. One thing I see is you get the same sorts of errors pop up in python, Java, and other OO languages. Which results in, program didn't know what to do and so throws and exception. If it's not caught program dies with a error. Depending on how far down the rabbit hole ones gone that error either means something obvious, or not. Back in the hoary old days, C/C++ programs tended die and take out the OS with them. Something like Java, etc doesn't tend to do that, queue the angels singing.

      But you know what, neither do C/C++ programs on modern OS's and hardware. (I guess you can muck up your stack frame doing something retarded) But seriously some of the supposed advantages of 'modern' languages have been erased by time. But still people caterwaul and moan that C/C++ are 'unsafe' as if people were still programming in C++ on Win3.1 running on a 286's

    34. 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.
    35. 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.
    36. 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.

    37. 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.
    38. 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
    39. 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
    40. 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.

    41. 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.
    42. 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
    43. 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
    44. 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
    45. Re:An Old Story by Anonymous Coward · · Score: 0

      This...

      We live in a world of safety nets, even in places where no one will die if mistakes are made (like coding a stupid app for a few internet junkies).

    46. 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.

    47. 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.
    48. 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.
    49. 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.

    50. 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.

    51. 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!
    52. 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.
    53. 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.
    54. 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
    55. 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
    56. 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
    57. 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.

    58. 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.
    59. 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.

    60. 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."

    61. 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.

    62. 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!
    63. Re:An Old Story by Anonymous Coward · · Score: 0

      Which is the entire point.

      A skilled craftsman knows not to use shitty tools.

      If you are using C(or C++) for high-end. high-performance math calculations instead of Fortran, you are not skilled. You are an idiot.

      If you are using C(or PHP or C++) for a web app, you are not skilled. You are an idiot.

      If you are using C to write high-performance concurrent code instead of Erlang, you are not skilled. You are an idiot.

      If you are using C for anything but system level code, you are not skilled. You are an idiot.

      If you are using Python to write a web server, you are not skilled. You are an idiot.

    64. Re:An Old Story by Anonymous Coward · · Score: 0

      Name a widely used piece of software that is not total shit when released.

    65. Re:An Old Story by Anonymous Coward · · Score: 0

      The fact that Windows 7/8/10 requires so much more hardware than a modern Linux desktop distro shows that "does vastly more" doesn't have to mean "needs vastly more hardware".

      Ditto for Windows Server vs any modern Linux-based server.

      Incompetent and lazy programmers, along with business with no tech sense is the main reason why you need beefier machines to run slightly more complex software compared to 10 year ago.

    66. Re:An Old Story by Anonymous Coward · · Score: 0

      Operator overloading in C++ is a mess.

      Ruby does it right. real operators can not be overloaded and the rest of methods on specific objects i.e + - / * are all methods in the Numeric class and not operators so can be overloaded. But = is a real operator and you can not overload it which keeps things nice and clean.

      Welcome to real OO.

    67. Re:An Old Story by Anonymous Coward · · Score: 0

      Java interfaces suck.

      Gosling is on record that they suck and were a mistake. Allowing implementation to be included in interfaces in Java 8 is a huge step forward and gets rid of a ton of repeated code but are still very useless. It is basically a bookkeeping entry to keep the compiler happy.

      Implementing an interface only guarantees that a method with a specific signature is available, not that it does the correct thing.

    68. Re:An Old Story by Anonymous Coward · · Score: 0

      If < insert really bad programming practice here >, yeah sure it is bad.

      It has nothing to do with MI.

      I personally like Mixins, it avoids the complex class hierarchy while avoiding the pointlessness and boilerplate of interfaces and keeps everything nice and DRY and is easily testable in isolation.

    69. Re:An Old Story by Anonymous Coward · · Score: 0

      There is no valid reason to deep copy an immutable object.

      That is the most fucking retard thing I have heard in a while.

      Grats

    70. 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!
    71. 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.

    72. 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.

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

      That's true.

      --
      "First they came for the slanderers and i said nothing."
  4. 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 Anonymous Coward · · Score: 0

      While I agree with your sentiment, I don't think your right. If your theory was right, everybody would be using Ada.

    9. 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!}

    10. 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
    11. 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.
    12. Re:Programming languages must cater to humans by bluefoxlucid · · Score: 1

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

  5. 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 Anonymous Coward · · Score: 0

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

      Rust never sleeps?

    2. Re:Named after the product of corrosion? by chadenright · · Score: 1

      Designed obsolescence.

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

      Rust Never Sleeps.

      --
      Why is Snark Required?
    4. 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"

  6. wah wah wah by Anonymous Coward · · Score: 0, Insightful

    >the fact itself that someone is making decisions for me regarding things like that makes me feel somewhat displeased

    Every language makes design decisions. The decision to take in every idea is a design decision. And guess what? Lots of people make fun of, and avoid, C++ for being the kitchen sink and a house attached.

    Go made its own design decisions, and seems to be very successful in its domain. Rust has made similar decisions, and once 1.0 stable with updated docs, we can gauge as a community its value, its deployment, and its utility. But to say their very /act/ of making a subjective design decision makes you uneasy? Come off it with the contrarian clickbait.

  7. 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.

  8. 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 Anonymous Coward · · Score: 0

      With self disclipline you can get C++ code almost as small as C code.

      And with just a little more self-discipline, you could just write C code. How hard is it to get 90% of the usefulness of objects (encapsulation, because polymorphism and inheritance just aren't all that useful most of the time) without having to put up with C++'s baggage?

      If you're competent, not hard at all. There's these things called structs and these other things called functions. If you make a set of functions that operates on a particular type of struct, you have yourself the most useful bits of OO.

      IMNSHO, I'm pretty sure that structured programming was more useful than the invention of OO.

    4. 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.
    5. 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.
    6. 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.
    7. 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.
    8. 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
    9. 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
    10. 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.
    11. 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
  9. 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!
  10. 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: 0, Interesting

      I've spent the past 30+ years programming mostly in Ada but also Pascal, C and Fortran. I'm currently taking a C++ class and I can't get over how much the programmer has to fight the language to get it to work. Ada is a dream! You are not fighting the language to get the program to work. You have strong typing and that can be a pain (my guess as to why most programmers/hackers dislike strongly typed languages is that they don't want the compiler to tell them they are doing it wrong when they are... doing it wrong!) but it keeps you from shooting yourself in the foot or worse. C is even worse! My God that should have been left in the trash heap of history in the 80's.

    2. 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.

    3. 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.
    4. 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.

    5. 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.

    6. 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.

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

      C has never been a "HIGH-LEVEL language". In fact, Kernighan and Richie call it a "relatively low-level language".

      C does not hold the programmer's hands or put major restrictions on what the programmer is allowed to do. Anything you can do in assembly language, you can do in C. It can even directly use in-line assembly language. I think of C as a (mostly) portable assembly language. It isn't higher-level than assembly language, it just has a nicer syntax than most assembly languages and the syntax is consistent across CPU arches.

    8. 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."
    9. Re:The source of troubles is usually in humans by Anonymous Coward · · Score: 0

      >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.

      If you're implying that the only reason people use lower level languages is because they're hipsters or whatever, then just shut the fuck up.

    10. 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.

    11. 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.

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

      I perfectly agree with you.
      With today's hardware and computer languages available the reasons to write anything in C/C++ beside OSes are pretty much zero.
      I would go as far as requiring to label any software with their programming language.
      I really don't feel safe running softwares written in C/C++ in my computer and if i had a choice i would avoid installing any of that crap. While i certainly know that completely avoiding C/C++ softwares is nearly impossible i would at least try to minimize the surface of possible attacks by running as much as non C/C++ softwares i could.

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

      I'll just wait here while you implement linux in python (or whatever language you prefer) with no C code in it whatsoever.

    14. 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.
    15. 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.
    16. 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.
    17. 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.

    18. 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);

    19. 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)
    20. Re:The source of troubles is usually in humans by Anonymous Coward · · Score: 0

      > Anything you can do in assembly language, you can do in C
      Not really, not without in-line assembly.
      > It can even directly use in-line assembly language
      With compiler specific extensions.
      C abstracts away the stack. There isn't a way to generate a trap in C. (must be assembly).
      C doesn't know about link registers.
      In assembly I can replace the value in the link register so that when the function I call returns, it returns to a different function than the one it was called from.
      Try doing that in C. Not sure when you would actually want to do that, but C definitely has some restrictions over assembly.

    21. 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.

    22. 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.

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

      You're right. I didn't read the last sentence there.
      Sorry bout that.

    24. 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.

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

      I haven't had any problems using rolls in embedded C platforms that just have a function to do that. Pretty much any assembly command can be turned into a C function. And at least in the rolling case, having looked at disassemble code afterwards, it is the same single roll command as if it was written in assembly, although now with the benefit of allowing replacement with other operation on some chips that don't support the same kind of roll.

    26. 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.

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

      By Dennis Ritchie. Does anyone else matter?

    28. 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.
    29. 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.

    30. 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.

    31. 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
    32. 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.
    33. 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.
    34. 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.
    35. 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.

    36. 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.
    37. 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.

  11. 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 Anonymous Coward · · Score: 0

      Because shared_ptr, unique_ptr, and boost::scoped_ptr are not things.

      C++ has the tools, people just don;t want to learn how the language has changed in the last 15 years.

    4. 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."
    5. Re:You dont' need another language to do this. by Anonymous Coward · · Score: 0

      And if you actually look at those languages, they (and their peers that followed their lead) DID make things safer. So what's with the snark?

    6. 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.

    7. 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.

    8. Re:You dont' need another language to do this. by Anonymous Coward · · Score: 0

      Sure, but none of them tried to do it how Rust is trying to do it.

      We're still new at programming. We've still got a lot to learn about how to do it.

    9. 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.
    10. 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."
    11. Re:You dont' need another language to do this. by vilanye · · Score: 1

      Turing not Touring

  12. 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 phantomfive · · Score: 0

      I don't expect Microsoft or Google or Apple's code to be very good, because generally their code sucks. A good portion of open source code sucks, too.

      What 'terrible bugs' being found are you talking about precisely though? Apparently I haven't been keeping up.

      --
      "First they came for the slanderers and i said nothing."
    3. 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.

    4. 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."
    5. Re:language improvements by Anonymous Coward · · Score: 0

      This is why you run those tools yourself--religiously. Save changes, recompile, run with Valgrind et al. every single time.

      Doing things the simple way, rather than trying to be clever, will save you shooting off your foot 90% of the time. Cleverness is reserved for exceptional requirements on which exceptional care can be taken.

    6. 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
  13. 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 Anonymous Coward · · Score: 0

      They mean that anything the C++ compiler will choke up on will also fail the Rust compiler, and the Rust compiler will catch some mistakes the C/C++ language will let you get away with.

    2. Re:Come again? by Anonymous Coward · · Score: 0, Insightful

      Given that they said "all the bugs typical of C++" one might think they they're implying that they are "simply capable of detecting bugs of all the typical C++ bug categories". If they'd said "it can catch all the bugs that have ever been put in C++ and God DAMN but we solved the halting problem!" then you might have a point, but they didn't, so you don't.

      Learning how to read is a useful skill. I advise practice.

    3. 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!
    4. Re:Come again? by Anonymous Coward · · Score: 0

      That's untrue, because mutual-exclusion deadlocks (and by extension sleeping on IPC primitives) is reducible to the halting problem.

    5. 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
    6. 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!
    7. 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!
    8. 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
  14. What's easier to change? by eggz128 · · Score: 2

    Human fallibility or the language/compiler?

    1. Re:What's easier to change? by Anonymous Coward · · Score: 0

      human fallibility for sure.

  15. 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: 0

      > The fact that he still considers inheritance as somehow essential just reveals his ignorance [...]
      Yes. And mine. Would it be so hard to have put in a small link to LTU or wiki or google or whatever so those such as us could discover what we've lamentably missed out on, instead of making us feel stupid?
      Thanks in advance.

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

      Someone praises every new language as "walking the path of simplification" because 1) every language starts out simpler than it will eventually end up, and 2) there are always programmers out there who have been burned by a "powerful" or "expressive" language being too much for them to handle. So they flock to something simpler. But if that simple language takes off, it won't stay simple for long.

      I've seen this happen with VB, Java, C++, and so on, and it won't stop with a particular language until that language has insufficient users left to keep piling features into it.

      Better to learn a decent language, and learn how to wield it correctly.

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

      I don't even... So by this argument, C++ restricts me from using generators and first-class delimited continuations,

      I think generators and continuations are planned for a future release. In the mean time you may have to fall back onto the implementation provided by boost , a library which combines both the good and the crazy of what can be achieved with C++ ( also acts as a testbed for future standardization ) .

    4. 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.

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

      I can generally understand why it doesn't have a decent inheritance

      The fact that he still considers inheritance as somehow essential

      You keep using this word....

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

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

      A generator is how you cleanly expose an iterator as a function. It allows you to keep state on the stack. Saying they're equivalent is like saying that any Turing complete language is equivalent.

      To really understand the difference, look at the king of all generators: symmetric coroutines such as in Lua. Python's generators are nowhere near as awesome as coroutines in Lua (which are also stackless--they don't play games with the C stack), but nonetheless can be very expressive.

      Why people prefer Python instead of Lua I'll never understand--it's faster, cleaner, more expressive, and easier to integrate with C (either embedded or vice-versa).

    7. 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
    8. 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...

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

      Um, I think the continuations you'll find in Scheme can fill the role of an exeption handler that scales from local to global. I think that exploring continuations was a primary reason for developing Scheme in the first play (Guy L Steele & Gerald Jay Sussman). Continuations can be used for *lots* of things, partticularly non-local transfers of control. As an *abstraction* I think they more than qualify!

  16. 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."
  17. 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: 0

      I absolutely love C.

      Really? Then you must not be writing much cross-platform code, or else you would be complaining about how C does not detect arithmetic overflow, and how the results of overflow are platform-dependent.

      A dear old friend of mine told me that "C lets you paint on the ceiling" which means that C will let you do whatever you want to do with a pointer, you can point to legitimate memory or you can cause a bus error or you can overwrite something else. The terrible thing about C is that it is not possible in general to detect misuse of pointers, and there are frightfully subtle language constructs in C that will give results that are not expected on first or second or even third viewing of the code. I refer you to the obfuscated code contests for further details on code that does stuff differently than how it looks.

      And as you can tell from the unending onslaught of software updates on any system you have, you can see that (for example) even the most rudimentary unix programs like sed and grep are still getting bugs fixed and found. So these 35 year old relatively trivial C programs are still buggy even after 35 years of continuous software updates, I would hazard a guess that C is not a good language for writing bug free programs.

    4. 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?

    5. 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.
    6. 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.

    7. 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.

    8. 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.
    9. Re:Rust is putting the cart before the horse by Anonymous Coward · · Score: 0

      Yeah, you can write incorrect code quickly that runs fast and gives you errors. Yay, C.

      Doing serious math work in something with a poorly-described numeric tower is insane, yet still popular. :-(

      (At least doing serious math work with a *well-described* numeric tower will give you expected results, even if that tower handcuffs you to a handful of types that you have to manage yourself, with little to no hinting from the compiler about performance tradeoffs, and little or no hinting from the compiler about systematic issues that arise from your choice of type (mmmm, IEEE fp). But that's still better than working directly in gmp to do numerical work.)

      http://www.wilfred.me.uk/blog/...

    10. Re:Rust is putting the cart before the horse by Anonymous Coward · · Score: 0

      Or you could just learn the damn rules.

    11. Re:Rust is putting the cart before the horse by Anonymous Coward · · Score: 0

      I worked on a few different commercial and open-source compilers, especially various optimizations like instruction scheduling including modulo scheduling, various kinds of register allocation algorithms, etc. And, to be honest, unless your code is simple, I can't really easily predict what the compiler would do. Modern optimizing compiler, especially with profile-guided optimization, can sometimes produce some surprising code (even for the authors of the compiler).

    12. Re:Rust is putting the cart before the horse by Anonymous Coward · · Score: 0

      A language that needs such a hack cannot be beautiful

      0.9 and 1.0 versions of programming languages tend to be elegant, reflecting the visions of their creators.

      If the language is fortunate enough to achieve commercial success, it will be subject to various kinds of pressures. Feature creep. Standard API explosion. Vendor incompatibilities. Fads and trends in programming language design. Interoperability with new platforms. And all the time, maintaining compatibility with existing code - give up that and you'll lose everybody.

      In the year 15 or 20 edition of the language, "cdecl" would be the smallest of the hacks that are needed.

    13. 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.

    14. 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?

    15. Re:Rust is putting the cart before the horse by Anonymous Coward · · Score: 0

      K&R C used declarations like Algol 60. In Algol 60, K&R C, and 70's Pascal, you couldn't specify the types of arguments to function pointers or functional parameters, only their return types.
      Types like integer procedure f or int (*f)() didn't include the parameter types so you could pass anything and the compilers wouldn't check.
      Algol 68 was strongly typed, so all types had to be checked at compile time. There were no incomplete types or untyped parameters in Algol 68.
      I think the more complicated type syntax was invented for C++ and then borrowed by ANSI because they wanted stronger type safety. C uses f() to mean unspecified arguments and f(void) to mean no arguments because originally argument types couldn't be specified.

    16. 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.

  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
    6. Re:I despise the blame the human idea by Anonymous Coward · · Score: 0

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

      That is only a problem if you hire programming language X end-users. These people are not programmers for any rational definition of programmer. Programmers understand the science of computation, programming language X end-users are API monkeys, at best.

      If you hire actual programmers with a solid background, it won't matter at all.

  19. Re:Someone is making decisions for me regarding th by Actually,+I+do+RTFA · · Score: 0

    When has a GOTO ever been correct? I've used GOTO's in production code. I've always felt dirty about it, as if it was an error in my youth (but I no longer have access to the source). Please help assuage my conscience.

    --
    Your ad here. Ask me how!
  20. 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.

  21. 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 Anonymous Coward · · Score: 0

      Whenever a programming task can be precisely defined, a machine can do it better.

      And what the precise hell do you think that the programmer does?

    6. 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.
  22. 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.

  23. 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 Anonymous Coward · · Score: 0

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

      Or both! That is to say that C programmers can code in C++ and avoid all the bullshit. As for Rust... is the language over it's breakage yet and will both Rust and it's package manager actually build from git?

      Cargo refused to build once for me over a period of about 6 months. Why is there so many dependencies for a package manager and how can so many of them be broken for so long? Rust didn't even make evaluation on that project and I'd hesitate to consider it again -- even considering it was an in-development language.

    3. 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.

    4. Re:Get the bullshit bingo bot out of here! by Anonymous Coward · · Score: 0

      People who make stupid meta-posts about TFS likely have nothing worthwhile to contribute to the discussion.

    5. Re:Get the bullshit bingo bot out of here! by Anonymous Coward · · Score: 0

      As a C programmer, that's something that constantly pisses me off.

      I'm not a C/C++ programmer, I'm a C programmer, and I've seen what happens when C++ programmers think that because they know C++, they know C.

    6. 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
    7. 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.

    8. Re:Get the bullshit bingo bot out of here! by Anonymous Coward · · Score: 0

      FWIW I can say as someone who entered a C++ dev job having not done C++ for about 14 or 15 years and receiving training at work, so long as you've spent that long without being exposed to raw pointers, newing and deleting, it's actually very easy to use all the std wrappers rather than the raw mechanisms. Hell, new itself in the MS implementation ends up calling malloc. 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. Since we also make widespread use of Create methods, it's really hard to get something that news a raw pointer through code review and it's hard to even implement it in the first place if you want the style of code to remain consistent with what's around it.

      That said, I've seen some astonishing abuse of character literals. In particular someone who enjoyed themselves doing things like char[20] and then writing 21 characters into it. Evidently they *never ran it on a Debug build* given you very rapidly get onscreen dialogue errors about heap corruption doing that. The fucking incompetent prick.

    9. 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)

    10. 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
    11. 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).

  24. 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.

  25. Quantum Computing. by Anonymous Coward · · Score: 0

    "C++/C will be here forever, there is too much code to transfer to a new system" and other such wondrous hits.

    Tell that to Quantum Computers. You can throw however many programs you want at it, it will still suck shit.
    Not only that, future architectures in general will likely require huge changes to computing in general, never mind the probable QC age.

    Already a massive amount of programs that depend on high speed are becoming more and more terrible as cores increase, and speed and core complexity decreases.
    This WILL require rewrites or some genius to come out with a load-balancer amazingly better than the not-all-that-bad ones we have now.
    As we breach 20 cores as common desktop processors, some programs will become unsuitably slow that it will need to be rewritten. (especially Dwarf Fortress. But Toady will be dead by then with his diet. It will never be finished. Go home and cry.)
    The point I am trying to get across is new things are being rewritten all the time, it does happen, it will happen.
    People also change languages all the time. They learn, slowly albeit, but they do learn.
    More and more people are also adhering to the toolbox methodology, in that all languages have their good uses, and bad uses.

    Ironically enough, C and C++ are a bit of a superposition of both. These languages are equally atrocious and brilliant, I don't think I have ever known anyone to like either of those languages, but they still use them because each discrete incompatible area of the language as they are still the best at what it does.
    The issue with both, C++ especially, is they are too big a scope. It is almost like a language designed by committee.
    Obtusely large and specific, unwieldy and abused most of the time.
    C++ is literally "Goto is bad" as a language.
    Honestly, I think these languages will evolve to a point where they will likely end up forking in to dedicated areas.
    Stagnation is never a good thing, even if it does work.
    They will die. They will not last past 2040. Period. And it this awful place hasn't been destroyed further and is still here at that year, I will come back to say I told you so. (unless I die with the Toad. In which case I will be .)

    1. 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
    2. 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.

    3. Re:Quantum Computing. by Anonymous Coward · · Score: 0

      Why multiple ways to dereference a pointer?
      Because some things are done so often its useful to have a shorthand for it.
      like
      a->b instead of (*a).b
      a[i] instead of *(a+i)
      I agree that typedefs are mostly useless, and I think they are mostly there because of the strange struct and union syntax that requires you to put
      struct everywhere if you don't typedef it.
      The preprocessor is one of the most misused things in C imho that makes things undebuggable.
      But we need it because C doesn't have templates/generics/ or anything to write generic code.
      The build system is bad because you have to make sure you write your makefiles to take into account .h files.

    4. Re:Quantum Computing. by Anonymous Coward · · Score: 0

      > How many ways are there to dereference a pointer?
      Two.

      If that's all it takes for you to consider a language "too large", then I hope for your sake you never see PHP.

    5. Re:Quantum Computing. by Anonymous Coward · · Score: 0

      wow. i congratulate your attempt to turn some arguable failings of C into an accusation of bloat

      compared to language specifications for C++ or java, C remains remarkably svelte

      cpp is a bad bad boy. but typedef?

      points for....a useless bit a vomit?

    6. 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.

    7. Re:Quantum Computing. by Anonymous Coward · · Score: 0

      You'd have an aneurysm looking at Common Lisp.

  26. Re:Ruby is gay! by Anonymous Coward · · Score: 0

    I love to fuck mens' butts. It's why I'm a Macbook-using Rubyist.

    - Ruby Develope

  27. 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.

    1. Re:Old programming languages never die by Anonymous Coward · · Score: 0

      PL/I

  28. clever things by johnrpenner · · Score: 0

    UNIX was not designed to stop you from doing stupid things,
    because that would also stop you from doing clever things. (Doug Gwyn)

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

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

    2. Re:clever things by Anonymous Coward · · Score: 0

      You must write software for the wrong industry.

  29. C++ needs help by Anonymous Coward · · Score: 0

    Agreed on the point about Java, but C++ needs some good error checking.

    I always thought that they could just build some error checking in, so when you're running development code, the checking gets done,
    and when you're running production code, you turn it off and get the speed edge. Anything is better than Seg faults. Why are they still possible in C++? It's 2015.

  30. 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.
    1. Re:If I hear this again, I may puke. by Anonymous Coward · · Score: 0

      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.

      No. This tastes like the same bullshit "customer is always right" fallacy. Sometimes the customer/user IS wrong and a fucking idiot who needs to not be using tools he doesn't understand.

    2. Re:If I hear this again, I may puke. by Anonymous Coward · · Score: 0

      Yeah, the problem with that is that all those goals oppose each other and the language designer has to make a tradeoff between clean syntax, static analysis, ease of use, run time checks, performance. Lastly, since the language is an interface to actual hardware and not some kind of magic, there are limits to how simple things can be. Maybe you mean the library designers fucked up?
      For instance, in C++, people like being able to overload anything and everything (it allows for nice interfaces), but then they complain because it's hard to know for sure if something will be a function call or not.
      Not that I think C++ is the end all be all of languages, and that languages can't be improved.
      But saying that the language designers failed because they had to make some trade off between clarity, exactness, and performance is pretty naive.

    3. Re:If I hear this again, I may puke. by Anonymous Coward · · Score: 0

      If you cant manege to hammer a nail straight in it's not the hammers fault.

    4. Re:If I hear this again, I may puke. by Anonymous Coward · · Score: 0

      What ? To all humans ? To you ? To me ? To my mother ? How safe should this language be ? Pretty sure "human" isn't descriptive enough

    5. Re:If I hear this again, I may puke. by Anonymous Coward · · Score: 0

      Fuck you for making me reply to this. Are you fucking kidding me? The fact that ten different people can come up with ten different ways to write the same function - half of which are probably wrong - in any language, should more than amply prove that, yes, humans can most definitely be wrong. You need to get out of your mom's basement.

    6. Re:If I hear this again, I may puke. by Anonymous Coward · · Score: 0

      The humans, by definition *can't* be wrong.

      What an absurd position to hold. I'm human, and I think you're a moron. Hahahaha, I can't be wrong!!!!!

      Now, seriously. WTF? This is not about designing the ultimate pen grip rubber piece. It's NOT a machine, It's NOT an interface, It's a f*kign LANGUAGE. Its a convention to express ideas. Neurophysiology? Don't make me laugh! Go learn some mathematics, kid.

    7. Re:If I hear this again, I may puke. by Anonymous Coward · · Score: 0

      I've tried and I can't learn the Mandarin Chinese language. Other Americans have also reported problems learning it. That must because the language was poorly designed, isn't suitable for humans, right? If enough of us all say that Chinese is too hard to learn, then that should be enough to convince a reasonable person.

  31. 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 Anonymous Coward · · Score: 0

      I've always wondered why people don't like C++ exceptions. Is it because they haven't read Herb Sutters book, or because they simply don't want to think about it?
      Or do you have something to back up that C++ exceptions are actually broken, and not just misused?
      And from reading their documentation it's not at all clear how Rust features are different from inheritance.

    2. 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."
    3. 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.
    4. Re:Pretty weak by russotto · · Score: 0

      C++ exceptions in particular aren't "broke". But exceptions in general are. The last thing I need in my language is spooky action at a distance. When I write two function calls in a row I want to know that, barring the end of the process, once the first is completed it'll execute the second. Not skip executing the second because somewhere deep in a library routine an exception was thrown that was caught somewhere above me in the call stack.

    5. Re:Pretty weak by Anonymous Coward · · Score: 0

      The author did not say C++ has decent inheritance and exceptions. It says Rust does not have them.

    6. Re:Pretty weak by Anonymous Coward · · Score: 0

      You have describard Dart. Rust is nothing like C.

    7. Re:Pretty weak by Anonymous Coward · · Score: 0

      Rust uses = for assignment, but the return type of an assignment is (), which is not a boolean, so no mistakes can be made where you accidentally assign in a condition instead of checking for equality.

    8. 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
    9. Re:Pretty weak by Tailhook · · Score: 1
      --
      Maw! Fire up the karma burner!
    10. 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
    11. 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!
  32. Yelling at the computer by Anonymous Coward · · Score: 0

    I don't think I could ever get use to a language that has me yelling (println!) every time I want to print something....

  33. Uhhhh No. Just No. by Anonymous Coward · · Score: 0

    That reasoning is what brought us the C library with its predilection to buffer overflows. Thank goodness Unix grew up in a university environment so that its security issues could be hammered out by a lot of hackers. There is a direct correlation between bugs and lack of security. Allowing just any old code to compile means that very small mistakes due to sloppy coding become a nasty exploit years down the road.

  34. 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 Anonymous Coward · · Score: 0

      Aside from LUA I don't think TCO has ever mattered much. It won't matter for Rust either.

      In any case, TCO isn't off the table for Rust. They haven't blessed it yet, but they are deliberately not precluding it as the language evolves.

    6. 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.

    7. Re: better reasons by Anonymous Coward · · Score: 0

      If everything ever written in schema vanished tomorrow it's possible no one would notice outside academe. Your claim of "all strictly functional programming languages on earth" is exaggerated. Few guarantee the optimization.

  35. 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

  36. 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.

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

    When has a GOTO ever been correct?

    In assembly language. :-)

  38. Re:Someone is making decisions for me regarding th by Anonymous Coward · · Score: 0

    When has a GOTO ever been correct? I've used GOTO's in production code. I've always felt dirty about it, as if it was an error in my youth (but I no longer have access to the source). Please help assuage my conscience.

    goto is the cleanest way to implement a finite state machine. Every other method involves moving the states into a static data structure that you interpret in a loop or putting a huge switch statement into a loop.

  39. I Guess We Should Kill 18-Wheelers, and Ban Guns by Anonymous Coward · · Score: 0

    All these harebrained ideas about "replacing" C and C++ are because shitty programmers use the languages to write shit code.

    C++ is more approachable and safer than ever before, but that's like fitting an automatic transmission to an 18-wheeler.

    It's crazy to let folks that don't have CDL licenses drive big rigs; auto transmissions or not.

    Languages like Swift definitely have their place (I use it). However, there is unlikely to ever be a better systems language than C (and, in some cases, C++).

    If a company insists on hiring cheap brogrammers, then they should keep those idiots away from dangerous languages like C. Give them a nice playroom, with brightly-colored, child-safe toys.

    Keep the guns locked up in a safe.

  40. 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.

  41. 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.

  42. Why yet another language?? by ealbers · · Score: 0

    From the rust page: // This code is editable and runnable!
    fn main() { // A simple integer calculator: // `+` or `-` means add or subtract by 1 // `*` or `/` means multiply or divide by 2

            let program = "+ + * - /";
            let mut accumulator = 0;

            for token in program.chars() {
                    match token {
                            '+' => accumulator += 1,
                            '-' => accumulator -= 1,
                            '*' => accumulator *= 2,
                            '/' => accumulator /= 2,
                            _ => { /* ignore everything else */ }
                    }
            }

            println!("The program \"{}\" calculates the value {}",
                                program, accumulator);
    }

    why not: // This code is editable and runnable!
    main()
    {
          var program = "+ + * - /";
          var mut accumulator = 0;

            foreach token in program
            {
                    switch(token)
                    {
                            case '+' : accumulator += 1,
                            case '-' : accumulator -= 1,
                            case '*' : accumulator *= 2,
                            case '/' : accumulator /= 2,
                            default : { /* ignore everything else */ }
                    }
            }

            println!("The program \"{}\" calculates the value {}",
                                program, accumulator);
    }

    I mean, if your going to create a 'new' language, why not use the already existing syntax of the most used languages.

    Inventing a let x=1 is not helpful, get rid of the let altogether or do what javascript does and just use var
    Also, why the ugly switch equivalent? Since everyone knows a switch statement leave it the same!?

    Iterators are done in all languages, keep with the standard ones, C/C++/Java/Javascript centric....

    Its just silly to 'change the syntax' just because you want to make yourself different.

    If the language brings something to the table, BRING it...and only the differences please!

    I get so tired of these lame 'new languages' get on with the improvements already and don't even get me started on using whitespace as a code block!

    1. Re:Why yet another language?? by Anonymous Coward · · Score: 0

      match can destructure the thing it is matching on. It can be used like a switch statement, but it is more powerful. It's funny that you should mention var as "what javascript does" because javascript is getting let in the new standard.

  43. 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.
  44. Re: Someone is making decisions for me regarding t by ZeroWaiteState · · Score: 1

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

  45. Stockholm syndrom by Anonymous Coward · · Score: 0

    It's probably Stockholm, but I kind of like C++. I've even gotten used to doing terrible things with templates when what you really wanted was reflection.

    Portability is terrible though.

  46. 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.

  47. Re: Pretty sure the heat death of the universe wil by Anonymous Coward · · Score: 0

    For the person falling into the black hole, everything else in the universe seems to speed up more and more until you cross the event horizon. Not sure what happens at that point, my one semester general relativity class was looking ago.

  48. C++ 3 by Anonymous Coward · · Score: 0

    IT is not hard to learn.

    1. Re:C++ 3 by Anonymous Coward · · Score: 0

      Yes and no.

      Easy to learn the syntax, but it takes YEARS to learn to use it safely and properly.

      That's why C++ programmers tend to be older folks, and tend to make a fairly decent bit of dosh.

  49. um, GOTO is ALWAYS correct by Anonymous Coward · · Score: 0

    Down at the binary code level, there ARE no "while", "if-else", "do", "for-next", "case", etc statements - EVERYTHING is a GOTO (either an absolute jump or a relative jump, performed conditionally, or unconditionally).

    All those "structured programming" concepts you young whipper-snappers cling to as the ideal way to do things are just figments of your imagination implemented for you by a compiler and pumped into your head by instructors both to try to limit your incompetence and to shield your precious, fragile, easily-offended little sensibilities from the actual reality of a "dangerous" three-letter mnemonic: "JMP" (and its powerful cousins).

    If compiled exactly as written, those "structured programming" statements you use and that you think are superior would almost always be less efficient than GOTO/JMP statements, so your modern languages often optimize-out your exact structured code and produce code that you have been taught is EVIL "spaghetti code". You get away with this level of inefficiency and obscurity only because you generally have more memory and clock cycles to burn than you need for the tasks you are performing, unlike the generations of programmers who came before you and who had to be better coders than you.

    1. Re:um, GOTO is ALWAYS correct by Anonymous Coward · · Score: 0

      You are assuming that the language used allows you to manipulate stacks and call frames. Most Basic dialects and other languages with Goto neither give you full access to these structures nor do they unwind stacks and call frames correctly. The result of a Goto jump in these languages may create evil stack corruption and memory leaks.

  50. 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.
  51. 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.
  52. 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++.

  53. 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.

  54. Re:Someone is making decisions for me regarding th by Anonymous Coward · · Score: 0

    how to avoid goto but still have common cleanup:

    int DoStuff()
    {
            Setup()
            do
            {
                      if (DoSubThing1() == FAILURE) break;
                      if (DoSubThing2() == FAILURE) break;

                      return SUCCESS;
            } while(0);
            Cleanup();
            return FAILURE;
    }

  55. Some corrections... by FithisUX · · Score: 0

    Who have heard of Cyclone? -> Rust is Cyclone Who have heard of Vala? -> The Gnome developers? As far as Limbo/BitC they are academic attempt. One more correction. The article talks about C++ and comes into conclusion that C++ is the best. If you follow the logic you can safely assume that C11 is the best language ever. It is even better than C++ because you can write code in C call it from D, export a C header for the DLL and call it from Go. Can you do it in C++ without wrappers? Mine is bigger than yours. Moreover there are more compilers for C than C++.

  56. 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
  57. Re: Pretty sure the heat death of the universe wil by Anonymous Coward · · Score: 0

    No, there is no infinite shift for a person falling into a black hole. If you are in actual free fall, there will be a slight red shift of things behind you and the rest of the universe. For powered flight into a black hole, you can get anywhere from a stronger red shift to a finite blue shift. The only way to get something close to an infinite blue shift is if you hover just above the event horizon, expending extremely large amounts of energy to keep yourself from falling in.

  58. Re:Someone is making decisions for me regarding th by matfud · · Score: 1

    Even java has labeled breaks

  59. 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. :-)

  60. Re:Ruby is gay! by Anonymous Coward · · Score: 0

    So how stupid does one have to be to mistake Rust for Ruby?

    Is there a negative number small enough to properly describe it?

  61. 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?