Slashdot Mirror


Cairo 2D Graphics May Become Part of ISO C++

An anonymous reader sends this news from Phoronix: "The C++ standards committee is looking at adopting a Cairo C++ interface as part of a future revision to the ISO C++ standard to provide 2D drawing. Herb Sutter, the chair of the ISO C++ standards committee, sent out a message to the Cairo developers this week about their pursuit to potentially standardize a basic 2D drawing library for ISO C++. The committee right now is looking at using a C++-ified version of Cairo. Sutter wrote, 'we are currently investigating the direction of proposing a mechanically C++-ified version of Cairo. Specifically, "mechanically C++-ified" means taking Cairo as-is and transforming it with a one-page list of mechanical changes such as turning _create functions into constructors, (mystruct*, int length) function parameters to vector<struct>& parameters, that sort of thing — the design and abstractions and functions are unchanged.'"

430 comments

  1. Sure, why not by DoofusOfDeath · · Score: 4, Funny

    C++ stopped being a fully-humanly comprehensible language a long time ago. Might as well just add more crap to it like it's going out of style.

    1. Re:Sure, why not by TheRealMindChild · · Score: 0, Troll

      Yep. Seems they want C++ to be compiled javascript.

      --

      "When life gives you lemons, don't make lemonade. Make life take the lemons back!" -- Cave Johnson
    2. Re:Sure, why not by Anonymous Coward · · Score: 0

      Yeah. What next, adding the MFC interface?

      It's one thing to keep up with processor technology like threads as happened with this language but an interface for drawing? How far do you take this?

    3. Re:Sure, why not by Anonymous Coward · · Score: 1, Insightful

      C++ stopped being a fully-humanly comprehensible language a long time ago. Might as well just add more crap to it like it's going out of style.

      Competent programmers stopped being formed a good 10-12 years ago. The JAVA/.NET generation is a fucking disaster.

    4. Re:Sure, why not by beelsebob · · Score: 2

      You got +5 Funny, I don't know why, this comment is damn insightful.

    5. Re:Sure, why not by StripedCow · · Score: 1

      Why can't they just eliminate header files first?
      Why is C/C++ practically the only language that requires headers?
      Why do I need to type each function declaration twice. It is so cumbersome!

      --
      If Pandora's box is destined to be opened, *I* want to be the one to open it.
    6. Re:Sure, why not by rubycodez · · Score: 2, Insightful

      don't have to, you could mark everything inline and define in the header without typing each function declaration twice.

      not recommended for general practice 8D

    7. Re:Sure, why not by StripedCow · · Score: 1

      Your second sentence says it all.

      --
      If Pandora's box is destined to be opened, *I* want to be the one to open it.
    8. Re:Sure, why not by Daniel+Hoffmann · · Score: 1

      It's is like the classic "80% of the users use only 20% of the features" also know as the Word Syndrome. But since each user uses a different set of features you need to have everything in there. I'm not saying this is necessarily saying this is a bad thing.

    9. Re:Sure, why not by VanGarrett · · Score: 3, Interesting

      As something of a .NET programmer myself, I can testify to the veracity of this. .NET does a great deal for you, and I really think the handicap has prevented me from learning what's really going on.

    10. Re:Sure, why not by dreamchaser · · Score: 4, Interesting

      It's sad but true. My wife works in the CS department at a major University, and I'm appalled at what they are churning out with regards to graduates. I know I'll probably get modded down and see the inevitable jokes about 'get off my lawn' and such, but it's really true. The vast majority of new programmers are more or less clueless aside from pushing out cookie cutter bloated code.

    11. Re:Sure, why not by Anonymous Coward · · Score: 0

      In 2005 a language called SystemVerilog was created and the designers specifically copied the header file system from C++.

    12. Re:Sure, why not by Anonymous Coward · · Score: 0

      Why can't they just eliminate header files first?

      Let's say you've got a library compiled *properly*. It check-sums out so you know it's good. You can link against that with headers. IMHO that might be the "killer app" for headers. Can you come up with a better solution? Sure you could put the equivalent of headers in the compiled binary. I don't see that as being a better alternative. Sure you could just ship the source. Aside from the "evil closed source" problem, there's the aforementioned problem of developers throwing the wrong switch when recompiling the library. There are a lot of compiler switch permutations, and that would be too good a way to create strange bugs that are hard to reproduce--the so called "works on my machine" problem. DLL hell might be annoying, but if the DLL checks-sums out at least you know what you've got.

      Anyway, I've got an open mind. What's your alternative for a language that has to compile "to the metal". No, "just make it dynamic" cheats, please.

    13. Re:Sure, why not by celle · · Score: 1, Insightful

      "The JAVA/.NET generation is a fucking disaster."

            Fucking disasters is more like it and all the coupling is creating a whole new generation of mega disasters.

    14. Re:Sure, why not by Anonymous Coward · · Score: 1

      This is a library only addition. Say what you will about the language itself but C++ has a very small standard library. Compare it to something like .Net or Java which is huge. This is one if the big complaints about the language is any real program written in it will have to use a ton of 3rd party libraries. Everyone uses different libraries and it this makes it difficult to combine code together.

      This is just a proposal, it might not go anywhere. I wouldn't see 2D graphics as being the first place to expand the libraries but it doesn't sound unreasonable. Having a standard including software libraries isn't unheard of either. Microsoft did this for .Net and ECMA.

    15. Re:Sure, why not by beelsebob · · Score: 2, Interesting

      To be honest, I love headers, and I'd love to see more languages use them. Not as a necessity to allow the compiler to see what's declared, but instead, as enforced documentation of what's a public API.

    16. Re:Sure, why not by rsilvergun · · Score: 4, Insightful

      News flash, the vast majority of _all_ people are like that. Very few people are capable of being the sort of 'Rockstar' programmer you're pining for. And what's wrong with that? Is it just me, or do we as a society just have unrealistic expectations of people? If you can't work 70 hours a week banging out amazing code non-stop you're worthless as a human being just because somewhere out there is someone who can. We hold up what are essentially freaks of nature that don't need sleep as the norm and wonder why the rat race is getting so awful...

      --
      Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
    17. Re:Sure, why not by jcr · · Score: 2

      Before the Java/.net generation, there was the VB generation, and if you keep going back you can find more. Good programmers are still being trained, just as there always were. The difference now is just that there are a lot more of the low-skills chaff to sift through.

      -jcr

      --
      The only title of honor that a tyrant can grant is "Enemy of the State."
    18. Re:Sure, why not by DoofusOfDeath · · Score: 1

      It's sad but true. My wife works in the CS department at a major University, and I'm appalled at what they are churning out with regards to graduates. I know I'll probably get modded down and see the inevitable jokes about 'get off my lawn' and such, but it's really true. The vast majority of new programmers are more or less clueless aside from pushing out cookie cutter bloated code.

      I think the real question is whether or not there's a long-term trend here. I wonder how many of us, who now have a great deal more experience, would have said the same thing regarding 1980's college freshmen.

    19. Re:Sure, why not by Anonymous Coward · · Score: 0

      Because backwards compatibility and inertia.

    20. Re:Sure, why not by radish · · Score: 1

      I find the keywords "public" and "private" work very well for that, no need for a separate file :)

      --

      ---- Den ene knappen er powerknapp, den andre er Bender voice knapp "Bite My Shiny Metal Ass"

    21. Re:Sure, why not by beelsebob · · Score: 2

      The problem is that large proportions of the populace of programmers are idiots, and if you show them the private things, they will rely on them.

      One simple file that says "this is the public interface, and it's documentation" is an extremely useful tool.

    22. Re:Sure, why not by Anonymous Coward · · Score: 0

      Why can't they just eliminate header files first?
      Why is C/C++ practically the only language that requires headers?
      Why do I need to type each function declaration twice. It is so cumbersome!

      The answer is: lazy language designers and lazy compiler writers.

      It would be absolutely possible to get rid of header files. But the compiler would then have to scan the source file in one of two modes: (1) header mode, where the compiler simply collects all of the external and export declarations, and then (2) code-generation mode, where the compiler creates the object file.

      Basically, the original C designers/compiler-writers were too lazy to implement this dual-scan approach, so it never got implemented. It was just easier to force the programmer to duplicate their exports in a separate file. They probably didn't realize that forcing programmers to write declarations twice would be quite the imposition that it turned out to be.

      The problem with C/C++ is that there isn't enough information in the declarations to allow the dual-mode approach to collect all of necessary information when run in header mode. For example, you can't put an "extern" declaration on a global typedef, so therefore the compiler doesn't have any way of knowing if you intend to export that typedef or not.

      It would be pretty easy to enhance C/C++ -- say, with a new "export" specifier keyword -- to support dual-mode scanning, which would allow you to eliminate the header files. (You would pay the price with a longer compile time, but if that's a big problem for you then just go back to header files.) Of course, if this is a really huge issue to you, you can always use an "export" keyword anyway and then write a tool to generate the header files automatically during the compilation process.

    23. Re:Sure, why not by Anonymous Coward · · Score: 0

      It's about hiding implementational details... in a header you only have to #include things that the header relies on and forward declare the rest... in the implementation file you can include additional headers that fill in the details of the forward declarations... when the detail changes the scope of the recompile is limited.

      Read 'Large Scale C++ Software Design' by John Lakos for real insight as to why keeping headers and implementation separate is vital for any non-trivial C++ project.

      See also the pimpl idiom... the impl parts of my pimpls are usually declared in the .cpp file (no separate header) and tend to be mostly defined inline (don't force it with the inline keyword, the compiler will work out what should be inlined... the inline keyword is only a hint anyway).

    24. Re:Sure, why not by savuporo · · Score: 1

      Except that in most cases, headers dont declare just the public API, but bring in a ton of implementation details. Unless you are using PIMPL or bridge design a lot.

      Both come with their own downsides. Or unless you are using .. fast PIMPL without the allocation overhead, but then did C++11 give you out of the box template for implementing fast PIMPL ? Of course not.

      It will give you a pretty dumb version of a 2D rasterization library with outdated narrow usage drawing primitives, which i am going to run on which realtime-critical Cortex-M MCU that will never have a display exactly ?

      Going in the right direction, sure.

      Maybe a better idea is to pull up Joint Strike Fighter coding guidelines and think hard and long about how to make the language more make a bit more sense, so that 142 page document could be around 20 instead.

      --
      http://validator.w3.org/check?uri=http%3A%2F%2Fwww.slashdot.org Errors found while checking this document as HTML5!
    25. Re:Sure, why not by savuporo · · Score: 1

      Oh, also finally coming up with an ABI standard for the thing would be a big help, thank you !

      --
      http://validator.w3.org/check?uri=http%3A%2F%2Fwww.slashdot.org Errors found while checking this document as HTML5!
    26. Re:Sure, why not by cultiv8 · · Score: 1

      I'm fine with this. At least I can review their code and learn why they pursued a CS degree. My perspective is a programmer is inherently a programmer; they value logic, have a desire to learn, and want to know why something works the way it works. CS teaches you the concepts and fundamentals, it should not teach you a language or two. Case-in-point: I recently hired a college intern to work on a large-ish scale website project (PHP/JS based). My boss was floored that I would not hire someone who did not know how to setup a local dev environment, her thought was that "this comes after graduation." My response: Someone who wants a career in programming should already be programming before they graduate.

      --
      sysadmins and parents of newborns get the same amount of sleep.
    27. Re:Sure, why not by beelsebob · · Score: 1

      In C++, certainly, headers tend to contain way more than it would be nice for them to. That's one of the reasons I don't like C++ much.

    28. Re:Sure, why not by ShanghaiBill · · Score: 3, Interesting

      I wonder how many of us, who now have a great deal more experience, would have said the same thing regarding 1980's college freshmen.

      I would. I graduated in the 1970's and was a manager in the 1980's. The majority of the CS graduates that I interviewed back then were worthless. I see less incompetence when interviewing new grads today, but that is probably because I have become better at pre-screening resumes.

    29. Re:Sure, why not by shutdown+-p+now · · Score: 2

      Why can't they just eliminate header files first?
      Why is C/C++ practically the only language that requires headers?

      Because templates.

      But they're working on it - it's called the "modules" proposal. It has been floating around since C++0x days. It won't get into C++14, but it probably will in C++17 - and, given how things are going in C++ standardization land, it'll likely be implemented in gcc and maybe even VC before the final standard is published.

    30. Re:Sure, why not by Octorian · · Score: 1

      Except the VB generation was always a separate group from your more traditionally educated software engineers. Java, on the other hand, has wholesale infected CompSci education.

      (While I will admit that I've done a fair amount of Java and .NET development in the real world, I'm also forever grateful that I went to college *before* it took over there.)

    31. Re:Sure, why not by Anonymous Coward · · Score: 0

      Didn't know how to set one up at all or didn't know how to set up your particular (undocumented as hell) required environment?

    32. Re:Sure, why not by Anonymous Coward · · Score: 1

      Agreed completely. Seems like the folks bitching about this are probably not actually developers as developers exist in most shops. Most of the folks I've run into in enterprise software land need domain knowledge to solve business needs. They don't need to be able to write an OS or device driver, they need to bang out an implementation of some business processes and keep them up to date. High level tools and soft skills are exactly what is needed here.

    33. Re:Sure, why not by Anonymous Coward · · Score: 0

      I expect that people understand what they're doing. Most don't, as you said. This is not a good thing, and that is why I turn away over 95% of the people who send in resumes. Strangely (or not so strangely) enough, self-taught programmers tend to be superior to those that come from colleges.

    34. Re:Sure, why not by Anonymous Coward · · Score: 0

      To be honest, I love headers, and I'd love to see more languages use them. Not as a necessity to allow the compiler to see what's declared, but instead, as enforced documentation of what's a public API.

      I agree. However, I don't like C/C++ for large-scale software projects for unrelated reasons, so I've settled into the Java world quite comfortably. Just recently I discovered OSGi, and it is awesome. All the separation and encapsulation you want from header files, all the clean code of Java, all the ever-updating optimizations of the JVM. It just makes me happy. And as a bonus, OSGi containers strictly enforce the public/private (or exported/private if you prefer) separation, it is not possible to circumvent it at runtime using casting or even reflection. Private means private!

    35. Re:Sure, why not by Anonymous Coward · · Score: 0

      If you did a bit of googling or reading some MSDN articles and some of their many awesome blogs, you'd find out pretty much how .Net works and what it does in the background. The only thing that has handy capped you is your lack of interest to find out how .Net works.

      Sure, if you're just messing around to see if you can get a proof of concept to work, mess with it. If you plan to do any professional development, one should understand what is going on under the hood, assuming there is accessible documentation.

    36. Re:Sure, why not by Anonymous Coward · · Score: 0

      This is not a good thing. A grand majority of graduates don't understand the concepts or fundamentals, and are terrible programmers.

    37. Re:Sure, why not by rsilvergun · · Score: 4, Interesting

      Actually you turn away 95% of ppl who send in resumes because 30 years of attacks on the middle class have let you be _way_ too picky with your candidates and to force people to pay to train themselves.

      Self taught programmers aren't superior, they're just more desperate. They'll give you 20 hours of free labor a week to keep up. People are people. Your expectations are either a) unrealistic or b) only possible due to a warped labor market that exists to enrich a lucky few (re: 1%).

      --
      Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
    38. Re:Sure, why not by MouseTheLuckyDog · · Score: 1

      I think much has to do with the way computers are taught, with focus more on "Karel the Robot" or Logo type machines-- is step one - step two - step three.
      instead of focusing on von Neumann architectures like Mix ( well not as much ) or the "little man computer". most modern programmers have no idea what's going on inside.

    39. Re:Sure, why not by Anonymous Coward · · Score: 0

      Most of us are worthless when we get out. Then we get a boring job somewhere cranking crap code. Then after a few years of experience we get better.

      I am pretty good now. But my early code would not pass any code review I run now.

      The best skill is not the language but learning how to debug. How to use 'the method' (divide and conquer if you dont know). How to understand flow. They do not teach that. They never have.

    40. Re:Sure, why not by Greyfox · · Score: 1

      Headers define the interface and are documentation to other programmers. If you don't care who sees your code, you could just put everything in classes and put all your code inside those classes, just like a Java class. It'll slow down your compilation, but if you break down your code into libraries and unit test all your libraries, you shouldn't have to compile the main project all that often. Most of your maintenance churn can go on in the libraries and once you're sure all those are solid you can roll them all up for deployment.

      --

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

    41. Re:Sure, why not by fjolnir · · Score: 1

      If you're good, you don't need to work 70 hour weeks. Also I don't think it's unreasonable to expect programmers to be good at what they do. Ones who aren't should be doing some other job, not dragging down quality and pay rates.

    42. Re:Sure, why not by Gravis+Zero · · Score: 4, Funny

      C++ stopped being a fully-humanly comprehensible language a long time ago.

      That's a lie! BEEP. BOOP. I'm a fully humanly and I can comprehensible language just fine a long time ago. BEEP. BEEP.

      --
      Anons need not reply. Questions end with a question mark.
    43. Re:Sure, why not by Anonymous Coward · · Score: 0

      As things are going in C++ standardization land, they will be announced as highlighted feature for C++2017, then shortly before finishing the standard there will be a disagreement over some detail, which ultimately causes the whole feature to be removed from the draft and scheduled to be revisited for a later draft, but never arrive.

    44. Re:Sure, why not by Mr0bvious · · Score: 1

      You don't need to use the aspects you find incomprehensible and those aspects don't negate the value of the bits you can comprehend.

      --
      Never happened. True story.
    45. Re:Sure, why not by Mr0bvious · · Score: 1

      As much as I'm a fan of C/C++, I expect the headers could be generated at compile time for distribution with libraries or for compiling against - I see no reason for the developer to maintain the header file. That way you can still hide your implementation etc and not have the burden of flicking between headers & source etc.

      --
      Never happened. True story.
    46. Re:Sure, why not by Anonymous Coward · · Score: 4, Insightful

      Wrong. I turn away 95% of the people who send in resumes because they don't understand what they're doing. They don't understand the logic behind anything, or what's happening in the background. I personally interview everyone, and I can attest to this fact. Self-taught people typically have drive, intelligence, and interest, and those things combined enable them to be competent.

      Your expectations are either a) unrealistic

      They're unrealistic in the sense that most people don't meet them. That's fine by me, as I don't accept garbage. But the fact is, some people do meet or exceed my expectations, and I'm quite happy even though there aren't many who do.

    47. Re:Sure, why not by Anonymous Coward · · Score: 0

      C++ stopped being a fully-humanly comprehensible language

      Horseshit. I really enjoy working in C++ and have no difficulty reading it. Maybe it is beyond the usual web programmer or whomever, but not all of us cower in fear at the sight of a polymorphic template.

    48. Re:Sure, why not by ShoulderOfOrion · · Score: 1

      In my opinion, this is one of the things that Modula-2 got right: a Definition Module for the API, and an Implementation Module for the code. PIMPL just ain't the same.

    49. Re:Sure, why not by anatoli · · Score: 2

      C/C++ is undefined behavior. Don't do that, kids!

      --
      Industrial space for lease in Flatlandia.
    50. Re:Sure, why not by AuMatar · · Score: 1

      I'd rather add headers to all other languages. Most of the time, when I look at a class I want the hilights- the functionality it exports, maybe the major variables it uses. Its damn difficult to tell those at a glance in Java, C#, etc- you need to scroll past hundreds or thousands of lines of code. Headers are absolutely perfect for this. Javadoc was pretty much created to work around the lack of headers in Java.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    51. Re:Sure, why not by _Shad0w_ · · Score: 2

      Some of us .NET developers started off as C developers; we're only working in C# now because that's what people want. I'm honestly completely fed up of the entire software development profession now; I just want to change careers. Maybe in a few years I can go back to writing software as something I do for enjoyment again.

      --

      Yeah, I had a sig once; I got bored of it.

    52. Re:Sure, why not by Anonymous Coward · · Score: 0

      And I had the opposite experience.

    53. Re:Sure, why not by billcarson · · Score: 1

      What is this "other job" you speak off? It's easy enough to say "go away" to those that don't fit your profile. Mind that they are also trying to make a living.

    54. Re:Sure, why not by satuon · · Score: 2

      Say what you will about the language itself but C++ has a very small standard library. Compare it to something like .Net or Java which is huge. This is one if the big complaints about the language is any real program written in it will have to use a ton of 3rd party libraries. Everyone uses different libraries and it this makes it difficult to combine code together.

      That is why I prefer using Qt these ways. It's a great standard library, it's the C++ answer to Java and .NET.

    55. Re:Sure, why not by satuon · · Score: 1

      I've been programming only in C++, and to tell you the truth, I seldom have crashes, and when I do, 99% of the time they're easy to fix. Most bugs I get are not crashes, just bugs in the business logic, and they would still happen in Java.

      I must admit that I'm kind of envious of how you get a nice stack trace when you have a crash in Java (an unhandled exception).

    56. Re:Sure, why not by hamvil · · Score: 0

      The "Someone who wants a career in programming should already be programming before they graduate." is a philosophy that applies very well to art (as in painting, music, etc.) or to some extend crafting. OTOH in real world enterprises you want the deterministic and repeatable results that you obtain trough standardized training (read classroom). Sure Leonardo was a great painter but if my business is to paint office I'd rather call a professional painter. This is particularly true in the case of Leonardo since he was spotty at delivering.

    57. Re:Sure, why not by gbjbaanb · · Score: 1

      there are lots of "other jobs" out there - lawyers, accountants, architects, loads of professional professions. If you can't hack computing, then maybe these other types of job are also not for you and you should try something requiring less knowledge-based and more of a craft or manual job instead.

      I know programming is becoming more and more like a manual skilled job, where anyone with minimum training can perform the basic tasks required, but I feel we would be better served if it were more formalised as a profession, like accountancy for example. Its just as boring and maths based, and requires you to keep up to date with the latest rules that everyone uses.

    58. Re:Sure, why not by gbjbaanb · · Score: 1

      What I found very strange, as a C++ dev going to a C# shop, was that the practice of having a separate file to define the interface remains, even in a language like C# that generates the header metadata definition behind the scenes (yes, its still there, the compiler just hides it from you)

      The best practice method we followed (and I believe it is a best practice too) in C# was to have everything we used in a class defined in an interface. This interface was written out in a separate .cs file. So really, there's no pragmatic difference between what I did as a C# dev and a C++ dev (in this regard).

      You see a lot of interfaces used in C# by the unit testing boys because the test tools require them to be there if you want to mock them.

      I don't mind writing it out twice, partly because I don't mind doing things right, and partly because I like to see the 'summary' of my code without resorting to nasty, nasty bodges like #region directives..

      So, get rid of header files... hahahahaha.

    59. Re:Sure, why not by billcarson · · Score: 1

      The jobs you mention all require a degree and investment.
      Unfortunately for many, you can't know that you're not skilful at computer programming before you start at it.

    60. Re:Sure, why not by KingOfBLASH · · Score: 1

      A computer science course does not cover how to be a developer it covers the science of computing. Learning to be a developer is an on-the-job thing and takes some years.

      You should more be asking what the CS graduates who decide to become developers are like in 5 years.

      Or did you think Calc III and Diff Eq just weren't enough maths?

    61. Re:Sure, why not by Anonymous Coward · · Score: 1

      What's the problem ? I'm pretty sure future microprocessors will execute Javascript natively. And don't forget that Y generation thinks Javascript is the lowest level, just on top of the physical device layer.

    62. Re:Sure, why not by Anonymous Coward · · Score: 0

      Each generation thinks the next one is lazier, dumber, weaker... Nothing new here

      CAPTCHA: snatches !

    63. Re:Sure, why not by Anonymous Coward · · Score: 0

      If he receives 20 times as many offers to work as he has vacancies then his expectations seem to be pretty much spot on. There seems to be a huge glut of programmers and so only the very best can expect work at all.

      This is most certainly a warped labour market but I don't see how that benefits lottery winners and people that inherit enough to retire.

    64. Re:Sure, why not by Anonymous Coward · · Score: 0

      I'm trying to make a living too. Will you employ me billcarson?

    65. Re: Sure, why not by Anonymous Coward · · Score: 0

      I work with java and you can see that a project will have some good testing when almost every class has an interface. But, this can also interfere with some specific objects, like say, Employee interface and EmployeeImpl class? Ugh!

    66. Re:Sure, why not by Anonymous Coward · · Score: 0

      I've noticed a distinct trend toward dumbing-down many of the articles in Slashdot lately, and it seems the modding of comments is following suit. I'm wearied (but not surprised) by "C++ is garbage/unintelligible/dangerous" comments from wannabe techies. It was mildly funny many years ago, but it's tired to the point of trollishness now. This is supposed to be a site for people who know and love technology, who aren't afraid of complex problems. What impression is a techie supposed to get when a daft, off-hand quip like this gets anything better than "Troll"?

      Anyone with significant experience in the industry knows that languages are designed to solve specific types of problems. Trying to adapt one language to all problem domains is a recipe for disaster. C++ is essential for certain problems, typically very complex and/or large. It's an engineering tool. The syntax of the base language is tiny, and can be learned in a day. But it takes many years to master the art of developing solutions that are both efficient and comprehensible. And C++ (in the right hands) can deliver that.

      I've seen incomprehensible coding in every language I've looked at. The language is not the problem –it boils down to immaturity. Perceiving that it is possible to do some very clever/tricky things in C++, a novice will try to use them everywhere. The result is predictably unintelligible, but the language isn't the cause. If you're tempted to say that C++ readily enables you to do this, think again about the problem domain C++ is targeting. We are dealing with situations where a fine degree of control is essential. Memory management is just one example. Automatic garbage collection is a fine thing for some problems, reference counting for others;there are many other possibilities, but a solution should be selected that best fits the context. It might also involve classes or templates, the STL, Boost or any number of 3rd-party languages. C++ gives you that choice – that's what it's designed to do. Some developers need that, others don't. It makes Slashdot look infantile when comments that don't recognise that fact are highlighted as witty or insightful.

    67. Re:Sure, why not by Anonymous Coward · · Score: 0

      Self taught programmers aren't superior, they're just more desperate. They'll give you 20 hours of free labor a week to keep up. People are people. Your expectations are either a) unrealistic or b) only possible due to a warped labor market that exists to enrich a lucky few (re: 1%).

      We're not lawyers who start the clock if they're thinking about a case, even if they're on the toilet. And if we're not doing that, then as a society how do we fairly count the time spent doing work that is mostly thinking?

      I see a lot of talk here about not criminalizing thought and making it harder to account for what you are thinking, but when thought is the new form of industrial labor, and you get paid to think, it may be time to figure out how to account for thought a bit better.

    68. Re:Sure, why not by Anonymous Coward · · Score: 0

      95% sounds like a made up statistics.

    69. Re:Sure, why not by ericloewe · · Score: 1

      Sounds like a reasonably easy parse job. I'd be surprised if nobody had ever written and published such a thing.

      Maybe your favorite IDE even has that feature buried somewhere.

    70. Re:Sure, why not by neokushan · · Score: 1

      Thank fuck someone on slashdot has some sense!

      How dare we evolve computers to make things easier for everyone. How dare we rip off as much boilerplate code as possible and create utilities that help with tedious or repetitive tasks! I mean what the hell were we thinking, Computers weren't meant to make our lives easier, were they?!

      --
      +1 IDisagreeSoHeMustBeATrollOrAnAstroturferOrAShill
    71. Re:Sure, why not by Mr0bvious · · Score: 1

      I expect the real issue is modifying the common build tools to work nicely with this setup - make, gcc, etc...

      Would be nice feature though!

      --
      Never happened. True story.
    72. Re:Sure, why not by Anonymous Coward · · Score: 0

      Javascript is getting incomprehensible already.

    73. Re: Sure, why not by taylorius · · Score: 1

      As you say, headers are useful when using libraries. But why not have the compiler generate the headers itself, or perhaps the library creation utility? IMHO if something is a deterministic one to one copy of something else, then there's no reason to force a human to copy it out by hand.

    74. Re:Sure, why not by Anonymous Coward · · Score: 0

      > (undocumented as hell) required environment

      He's setting up a website. The PHP+JS tells you that. Localhost will do pig.

    75. Re: Sure, why not by Anonymous Coward · · Score: 0

      This....

      I am not a programmer at all, but I got the logic right away when it was now whined about why they don't get rid of them...

      It simply is work what developer will enjoy when they later need to come back to project or check what others have done.
      Something what does require coders to do it well in first place.

      Reading and hearing about new generation programmers works, they don't have patience or vision for what they do like old programmers do. Young ones want to get working software in minutes and they don't want to know what really happening. They want to create something and get fame and money for their ignorance.

      It is same thing in many profession and life in while, but simply there are just few of those who really have passion to first learn the whole process before they believe they master it well and that can take years easily.

    76. Re:Sure, why not by gtall · · Score: 1

      Hell, that was true 12 years ago. Being at a major U.S. uni at the time, I was exposed to their "honors" group. They had no ability to size up a problem much less know to solve it. And that was using Java. I don't think the problem was with Java, it was rather the concentration on a functional language as somehow giving them "computer science principles". That might be true but all those principles were lost on them because they had no context. And I'm fairly sure they had no understanding of what went on behind the language or frameworks.

    77. Re:Sure, why not by Anonymous Coward · · Score: 0

      I know programming is becoming more and more like a
      manual skilled job, where anyone with minimum training
      can perform the basic tasks required, but I feel we would be better served if it were more formalised as a profession, like accountancy for example.

      Its just as boring and maths based, and requires you to
      keep up to date with the latest rules that everyone uses.

      Accountancy is not the place to look. You act as though they follow their own rules. The rules are for you to believe and follow, while they ignore them and take advantage of your gullibility.

      Rules will just make people more careless, lazy, and naive, and they will be trounced when they meet someone or something that doesn't care two bits about their little rules or how they think things are supposed to work.

      It will just result in pointing blame at a broken set of rules instead of actually fixing the problem.

      We don't need (more) rules, we need solid, working code. Preferably not so solid that it is not flexible.

      The way to get that is more experience, not more theory.

      We'd be better served with apprenticeships and more real-world experience. Or people building real projects from start to maintaining, playing as many roles as they can (developing, documenting, administrating, managing, support, QA, maintaining, ...) and then they will have a much better picture of things than just the tiny bubble where they were told how things are supposed to work and what rules people are supposed to follow.

      We don't need more people to race to regurgitate whatever the latest self-appointed "rulers" are spewing this week. We don't need any more self-appointed "rulers" to tell us what to think.

      We need people who can think critically, question things, and understand why things are the way they are, not run from bandwagon to wagon as the fashions change.

      The programmer who knows what actually happens when users are involved is worth more than someone who can bang out perfect code that fails upon deployment because people and the world just don't work like they were expected, or how they were told things work.

    78. Re:Sure, why not by gtall · · Score: 0

      Soooo....all you do is GUis and somehow that makes C++ the answer to Java and .NET?

    79. Re: Sure, why not by Anonymous Coward · · Score: 0

      It's a large website. They might need a more complex setup than localhost to loadtest connections between db and web servers and other machines to see if anything is bottlenecking.

    80. Re:Sure, why not by gnasher719 · · Score: 1

      If you're good, you don't need to work 70 hour weeks.

      Whether you are good or not, if you work 70 hours a week you are (1) a first rate idiot for allowing yourself to be exploited unless you are paid by the hour, you are (2) not good anymore because you are too tired to be any use, and (3) whatever manager or boss talks you into or allows you to work 70 hours a week is a moron because of (2).

    81. Re:Sure, why not by gnasher719 · · Score: 1

      Why can't they just eliminate header files first?
      Why is C/C++ practically the only language that requires headers?
      Why do I need to type each function declaration twice. It is so cumbersome!

      There is interface, and there is implementation. I want the interface of everything, but only the implementation of the one thing I'm working on.

      Java is horrible because it mixes interface and implementation, making it impossible to look just at the interface.

      C is fine, and C++ is fine if you don't allow yourself to be carried away, becaue you can separate interface and implementation. C++ can contain a mix of interface and implementation, especially when written by Java educated people.

      The problem is of course programming languages that require separate files for interface and implementation, and IDEs that cannot separate the interface out for the developer to read, when he or she isn't interested in the implementation.

    82. Re:Sure, why not by gnasher719 · · Score: 1

      C/C++ is undefined behavior. Don't do that, kids!

      Not in Java. In Java, it is defined to yield 1 and increase C by 1.

    83. Re:Sure, why not by Anonymous Coward · · Score: 0

      Please remember the computers the original C language was designed for. Also a compiler is not an IDE.

    84. Re:Sure, why not by Anonymous Coward · · Score: 0

      Or perhaps this is another idication of why this shouldn't be followed as an economic system

    85. Re:Sure, why not by Anonymous Coward · · Score: 0

      new VB generation is PHP generation...

    86. Re:Sure, why not by Anonymous Coward · · Score: 0

      That's not entirely true. If someone else on your team starts to use these features you're screwed just as much. And sooner and later this is going to happen in any decently sized codebase.

    87. Re:Sure, why not by Anonymous Coward · · Score: 0

      If your buisness needs don't happen to fall into the correct 'cookie cutter' shape then you need to be able to make new cookie cutters. Also those without knowledge tend to leak information and implement things with poor efficiency; This can be very significant if it starts hammering a DB or making multiple network calls

    88. Re:Sure, why not by Anonymous Coward · · Score: 0

      If you have a repeatable and deterministic situation you want a program not a programmer

    89. Re:Sure, why not by angel'o'sphere · · Score: 1

      Other languages use interfaces for that or declare the public part ...erm, well public.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    90. Re:Sure, why not by angel'o'sphere · · Score: 1

      Yeah, if you already realized that, why do you demand "header files", as in C++ a header file also shows the private part.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    91. Re:Sure, why not by angel'o'sphere · · Score: 1

      Java is horrible because it mixes interface and implementation, making it impossible to look just at the interface.
      No one prevents you to use interface MyInterface { } to define the interface of a class in Java/C# etc.
      Your claim is bollocks.

      and IDEs that cannot separate the interface out for the developer to read IDEs usually have a so called "outline" for that, here you simply sort by public/private and you clearly see the "interface" and the "implementation" part.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    92. Re:Sure, why not by rsilvergun · · Score: 1, Interesting

      My point is that in the past you would have offered them training.

      True though, I'm making some assumptions though about your political views because you're so harsh on people. I'm assuming your politically and economically conservative, and would be opposed to high taxes on the wealthy to train and educate people and support them while they receive that training and education. I'm also assuming you've bought into the 'Job Creator' narrative that says employers are responsible for creating livelihoods for employees and that this excuses the obscene wealth they've been granted. Sorta like how the kings treated serfs back in the day, only worse.

      If my assumptions are wrong and you're in favor of the sorts of socialistic that correct for training then you're free to go on rejecting 95% of the candidates w/o a shred of guilt ( or more appropriately culpability).

      OTOH, if you're thinking of yourself as a noble lord protecting your serfs then I wish you'd just drop that fantasy and admit all you're really after is winner take all with yourselves as the winners.

      --
      Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
    93. Re:Sure, why not by angel'o'sphere · · Score: 1

      Unless C is zero ofc ... then it throws an exception ;D

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    94. Re:Sure, why not by toddestan · · Score: 1

      Is that because "computer science" back in the 80's was actually Computer Science, and "computer science" now is more like "programmer training"?

    95. Re:Sure, why not by angel'o'sphere · · Score: 1

      In most of europe it is plain illegal. The boss is standing with one foot in jail already. If the employee (or contractor advised under said boss) has an accident on its way from or to work, the boss is with both feet in jail.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    96. Re:Sure, why not by BlackHawk-666 · · Score: 1

      inline is a compiler directive that will cause the compiler to emit a copy of that routine every time it is called. This saves on function calls, makes for faster code (generally) but increases bloat.

      I think what you meant to say was you can just write your code such that the definition and declaration both appear in the header i.e. the definition immediately follows it's declaration.

      --
      All those moments will be lost in time, like tears in rain.
    97. Re:Sure, why not by BlackHawk-666 · · Score: 1

      Funny you mention that. I used to work with a guy who used to be employed writing parts of the HUD for the JSF. He was the second worst programmer I've ever had to work with in a 32 year career. The first prize goes to an accountant who thought that being able to automate Access databases qualified him to write code for the bank we both worked in.

      --
      All those moments will be lost in time, like tears in rain.
    98. Re:Sure, why not by Anonymous Coward · · Score: 0

      I write C# code all day and writing a separate interface that's essentially a copy of all the members of the associated class for every class is way overkill. Hopefully I'm just misunderstanding your explanation...

      Even for unit testing (and I'm normally a big fan of interfaces/abstracts for testing purposes and testing in general), that seems like a lot of unnecessary work to do up-front.

    99. Re:Sure, why not by RobertJ1729 · · Score: 1

      Soooo....all you do is GUis.

      Do you even know what Qt is? It's way more than just a widget toolkit.

    100. Re:Sure, why not by tibit · · Score: 1

      Agreed, especially that .net micro framework is open source - you can actually look at how mostly MS-folk implemented it for targeting systems that would have been considered desktop PCs in 1990 or so.

      --
      A successful API design takes a mixture of software design and pedagogy.
    101. Re:Sure, why not by tibit · · Score: 1

      Borland Pascal has had it solved long time ago. Unit files were binaries that had both object code and metadata for the compiler. The compiler would literally load the binary structures from the unit file as-is, do some light-weight merging of them into the global symbol table, and that was it. Fast and easy.

      --
      A successful API design takes a mixture of software design and pedagogy.
    102. Re:Sure, why not by tibit · · Score: 1

      Because templates.

      Nope. Templates are just another bunch of metadata that the compiler needs to instantiate them. There's no reason to extract that data over and over from text files. Borland-Pascal-style binary unit files that encapsulate object code (P-code for today's LTCG) and compiler metadata are exactly what one needs to solve it cleanly. There's no reason to think that a script couldn't extract the documented, human-readable interface description from such a file. It has been done (sans documentation) for BP unit files (did it once for TP 6 myself), so I just don't see what's so special about C++. Well, nothing is.

      --
      A successful API design takes a mixture of software design and pedagogy.
    103. Re:Sure, why not by rhodes777 · · Score: 1

      They're already working on modules (see 'SG2'):

      http://isocpp.org/files/img/wg21-structure.png

    104. Re:Sure, why not by david_thornley · · Score: 1

      "inline" is a compiler directive that any decent modern compiler will ignore, and make its own decisions. It does allow the program to have multiple definitions of an inline function, provided they're all they're all the same, and having the definition inside a translation unit (.cpp file including headers, basically) makes it easier for the compiler to inline.

      Inlining a function is not nearly as useful as being able to inline or call regularly on individual invocations. The programmer is unlikely to know whether an individual invocation should be inlined, as that depends on things like the instruction cache, and the programmer is unlikely to know what part of the code will fit in an instruction cache line. Cache misses kill performance, and the compiler is going to be much better at making the call in almost all cases.

      It is possible to put everything in one big translation unit, but that's usually the wrong thing to do.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    105. Re: Sure, why not by david_thornley · · Score: 1

      That doesn't work with the existing C++ syntax, as there are things that are in function declarations but not stand-alone function definitions, such as "virtual" and default parameter values. There's a lot of historical baggage in C++, mostly but not exclusively taken from C. I assume any competently redesigned C++ replacement (such as D) would not need header files.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    106. Re:Sure, why not by david_thornley · · Score: 1

      Borland Pascal was one non-standard implementation of a language, and ran on a limited number of platforms. C++ is a standard, with many implementations on many platforms. One is easier to change than the other.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    107. Re:Sure, why not by tibit · · Score: 1

      Unit files for C++ would be an implementation detail, they'd require zero changes to the language standard.

      --
      A successful API design takes a mixture of software design and pedagogy.
    108. Re:Sure, why not by Anonymous Coward · · Score: 0

      There seems to be a huge glut of programmers

      Huge glut of people applying for programmer jobs, not actual "programmers". I've read stories of companies who literally have about 90% of their applicants lie about having a programming background. They couldn't pass a "hello world" test.

    109. Re:Sure, why not by david_thornley · · Score: 1

      In Java, every data object is either a basic type (like int), or it's a pointer. It is never necessary for the compiler to know the size of a given class when not doing things specifically related to that class. In C++, objects can be existing in memory (like Java's basic types) or separately on the heap (like Java's classes). This means it's often necessary to know how large an instantiation of a class will be, which leads to the private members being viewable.

      This is pretty much necessary given the design goals of C++ design, but it does have its downsides (there are some moderately unfortunate results in name lookup, for example).

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    110. Re:Sure, why not by Anonymous Coward · · Score: 0

      Why can't they just eliminate header files first?
      Why is C/C++ practically the only language that requires headers?
      Why do I need to type each function declaration twice. It is so cumbersome!

      They are

    111. Re:Sure, why not by HiThere · · Score: 1

      Sorry, but if you don't understand a simple assembler, say Z-80 or simpler, even MIX will do, you don't really understand programming. You should almost NEVER use this, you understand, but it's a basic underpinning necessary to understand code. You should also understand C, even if you never use it. (I hate it, personally. I consider it too dangerous for production work because of the way it encourages unrestricted use of pointers.) You *do* need to understand it, to understand how assembler morphs into useful languages. (I don't *think* you need to go any lower than assembler, but it wouldn't hurt to do a couple of actual hex code programs for a simple machine [which can be virtual as well as not].)

      If all you learn is Java, C#, Python, Ruby, Javascript, and the rest of that ilk, then you don't really understand programming. For most applications, that's the level of language you should USE, but you can't use them to ground your understanding of what you are doing.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    112. Re:Sure, why not by HiThere · · Score: 1

      You could give D a look. ( http://dlang.org/index.html ). To me it seems like one of the best languages that compile "to the metal". It's problem is the perennial one of new languages: Not enough libraries. Of course, you can link against any library with a C calling convention (and I think those with a C++ calling convention), but there are problems with data structure translation. Even strings require special handling. And it doesn't recognize C/C++ macros, so all the header files need to be translated...which is a bit of a difficult problem, and currently each case needs to be handled manually. Etc.

      It's enough of a problem that I'm not doing my current project in D. But I still wish I could.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    113. Re:Sure, why not by Anonymous Coward · · Score: 0

      Until you need to maintain someone else's code. Same problem as Perl.

    114. Re:Sure, why not by HiThere · · Score: 1

      More to the point, why don't they implement decent Unicode handling. That's much more suitable to a compiler standard than graphics. (Actually, the reason is probably because MS and Java settled on a totally rediculous implementation of Unicode [it was more reasonable at the time], and you'd need to get one of them to change to a sane standard. Either utf8, utf32, or optionally either would work, though. There are arguments in favor of each, but utf16 is indefensible.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    115. Re:Sure, why not by joseph90 · · Score: 1

      I once went to a talk where a guy from MSoft basically said that they only hire the top 5% of graduates and complained that very few graduates were in the top 5% (about 1 in 20 I believe ;-).

      This is the same complaint here!

      J.

    116. Re:Sure, why not by shutdown+-p+now · · Score: 1

      The problem is that template metadata that's actually needed to instantiate them is awfully close to a serialized AST, or perhaps even a sequence of tokens - because a great many things inside the template are extremely dependent on what the parameters are. Not just semantically, but syntactically - it's possible to write code in template that can be either an expression or a variable declaration depending on template parameters - and different instantiations would have different meaning for it. Consider this code:

      template<bool> struct a;
       
      template<> struct a<true> {
          enum { b };
      };
       
      template<> struct a<false> {
          template<int> struct b {};
      };
       
      enum { c, d };
       
      template<bool X> struct e {
          e() {
              a<X>::b<c>d;
          }
      };
       
      int main() {
          e<true>();
          e<false>();
      }

      The line of code inside e::e() is what I'm talking about. Depending on X, it will parse either as expression: (a<X>::b < c) > d; or as a variable declaration: a<X>::b<c> d.

      Is it still possible to serialize it somehow? Yes, sure. That's what "export template" feature was all about. It was, in fact, mandated by C++98, but in over a decade of the standard being in force, only one compiler (EDG) has actually implemented them - and then it took them several years. Based on their experience, this has been removed from the spec in C++11.

      Anyway, you're complaining about the wrong thing. There's nothing wrong about storing metadata etc in a text file, and raw code is exactly such a metadata. The problem with C++ headers is their inclusion model, which is purely textual - hence the need for header guards, separation into header and implementation file, and other associated silliness. The modules proposal for C++1y is going to deal with that, letting you write C++ modules in a way very similar to how BP and Delphi units were written.

    117. Re:Sure, why not by HiThere · · Score: 1

      Yeah, but C++ has made a series of bad choices. Now it's to the point where I would prefer to use Ada. Actually, neither is my preference, but C++ is a nightmare. It's ok as long as it's just my own code, but there are so many dangerouly "neat" ways to do things, that it's an abomination.

      Hell, even C, with free use of the macro processor, can easily turn into something incomprehensible. And they guy who did that can justify each choice. C++ takes that up an octave. Even the guy who did it is often unable to explain what it was intended to do, even if the code is successfully doing it.

      I will grant that custom subsets of C/C++ can be good, and even optimal, for a given problem or SMALL group of users. But that's not what you commonly see. So, depending on the problem, I tend to prefer Python, Ada, or D...and very occasionally Java. C I mainly use for linking libraries and routines in different languages.

      P.S.: I wonder if Vala will ever become usable. It's a language design with great promise. But the last time I checked they hadn't even documented many of the most basic features. Perhaps they presume that "well, since it's almost like C, we don't really need to document it", but to me it just looks incomplete.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    118. Re:Sure, why not by turgid · · Score: 1

      Once upon a time there was a language called Modula-2 which I think you will find interesting. For a time, it competed with C for the mainstream. I learned a bit of Modula-2 (1989-1990) after having done a little bit of C and it made me a much better C programmer. It also made it trivial to pick up Turbo Pascal a couple of years after that.

    119. Re:Sure, why not by Anonymous Coward · · Score: 0

      [I'm not the same AC.]

      When a candidate for a programming position has a firm grasp of the fundamentals (including those relative to the position, of course), then I'd be willing to hire them even if they need OTJ training. An example might be such a candidate coming from a primarily C++ background for a position that will primarily require OCaml. OTJ training could easily be acceptable in that case.

      However, at least for software development positions, there exists a plethora of candidates who really don't know their trade at all. I'm talking about not knowing the difference between sorting and searching. There's no way most employers can afford to offer OTJ training at that level - those candidates belong in a different field of work. While they don't make up 95% of applicants, you might be surprised at how common it is. Once those are weeded out, the next hurdle is the candidates who seem to grasp the basics just fine, but still somehow cannot write straightforward code that solves a simple problem. I don't mean elegant, unblemished code, just a solution that doesn't meander all over the place to ultimately arrive at something which appears to work almost by accident. That's disturbingly common, too. We're not at 95% yet, but getting there.

      Often, applicants who are very good in one area, such as embedded programming, will apply for a position which isn't a good fit for their experience, such as web development. That's just the nature of the job market. While such applicants aren't an automatic rejection, it's rare to find one who can bridge a significant experience gap with a reasonable level of OTJ training, and few employers can afford to take many risks like that, especially SMBs.

      We finally start approaching 95% when we consider the resume padders, or even outright liars. That's another reality of the job market, but I suspect that it's more pernicious in software and other IT fields. Interviews are often done by HR personnel and non-technical managers, so it might be easier to get away with a dishonest resume than it is for many other careers.

      In software (and maybe IT in general), it can be quite reasonable to end up rejecting 9 of every 10 applicants regardless of one's politics.

      - T

    120. Re:Sure, why not by Anonymous Coward · · Score: 0

      .Net does a ton of stuff automatically, but if you don't know what it's doing under the hood, you'll screw something up very badly, eventually.

      I've done my fair share (and probably more) of "unsafe" .Net code, getting down and dirty with packed structs, calling the marshaller directly to pack bitshifts into a UInt32, and feeding straight-up wonky stuff into a byte array to be written to disk. In fact, there probably isn't really a better way to write an AVI file writer in managed code.

      The .Net developers to worry about (and avoid hiring) are the ones who aren't comfortable with something as mundane as DllImportAttribute. If they're afraid of it, they're not going to build software that uses it, even if it's the correct way to do something. It also doesn't bode well for either their ability to work with byte arrays of data or their likelihood of using reflection for anything that won't someday show up on The Daily WTF.

    121. Re:Sure, why not by Anonymous Coward · · Score: 0

      More to the point, why don't they implement decent Unicode handling.

      What exactly is missing in C++11?

    122. Re:Sure, why not by spitzak · · Score: 1

      What exactly is missing in C++11?

      UTF-8 string constants (with \xNN producing raw bytes whether or not they are valid UTF-8).

      These are not there due to Microsoft's insistence on translating the input to UTF-16 before the parser runs and they wanted to preserve the ability to make string constants in CP1252 or other 8-bit sets. Otherwise it would be trivial because it would involve copying the bytes unchanged from the source code to the string constant.

    123. Re:Sure, why not by Anonymous Coward · · Score: 0

      But, at the same time it has allowed you to write far more complex code. By 'standing on the shoulders of giants' you are able to produce work that you could never hope to achieve if you coded everything from basics.

    124. Re:Sure, why not by Anonymous Coward · · Score: 0

      gdb bt ?

    125. Re:Sure, why not by angel'o'sphere · · Score: 1

      In C++, objects can be existing in memory (like Java's basic types) or separately on the heap (like Java's classes)
      I believe you don't really understand about what you write.
      "Static allocated" memory, stack for parameter passing and heap memory for dynamic allocated data is very common amoung *all programming languages*.

      This means it's often necessary to know how large an instantiation of a class will be, which leads to the private members being viewable.
      Private members have nothing to do with the size of objects.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    126. Re:Sure, why not by ynp7 · · Score: 1

      I think the difference now is that instead of most people being somewhat incompetent C/C++/etc. programmers, they're less than competent Java/.Net/JavaScript programmers. The level of competency may not have changed, but the bar for competency has lowered so overall quality has fallen a lot.

    127. Re:Sure, why not by Ambiguous+Puzuma · · Score: 1

      I'm not the grandparent poster, and my political and economic views are well to the left (within the US spectrum). But I, too, found that many candidates were astonishingly bad in a way that no amount of training would likely have corrected for.

      At my previous job, our test/icebreaker was simple: we sat the candidate down at a computer with a C++ file to read and digest for up to half an hour, left the room and then returned with this question: "So, what does this code do?" There were no tricks--the file was about 300 lines long, was designed to be readable (with meaningful variable names and occasional comments), and used only the most basic of C++ features. It did nothing more sophisticated than applying some logical tests to an input object in order to select a return value.

      You know what I did that impressed the team when I was asked "So, what does this code do" on my interview? I gave a one-sentence summary before diving into details. I was skeptical when my boss told me this shortly after starting the new job. But we interviewed a dozen or so additional candidates over the following year, and half of them were only capable of giving line-by-line explanations ("Well, at the top of this function first we check if this parameter is less than 60, if so we stop and return this value, otherwise...") even after we stopped them and specifically asked for a brief high level summary. They all interpreted the individual lines of code correctly, but only half could express what the code did as a whole.

      We hired three people from this group (so about 1/4 of the people we interviewed). And we did provide plenty of training, or more accurately, we each taught each other based on our individual strengths. I had more SQL experience than the rest of the team, for example, so I took on the more difficult SQL-related tasks myself while others completed simpler tasks with my advice and guidance. Similarly, another member had more experience with pthreads than I did, so he helped me whenever I had issues related to multithreading. The end result was a team where everyone had specialties but could complete basic tasks in any relevant area.

    128. Re:Sure, why not by Anonymous Coward · · Score: 0

      If all you learn is Java, C#, Python, Ruby, Javascript, and the rest of that ilk, then you don't really understand programming. For most applications, that's the level of language you should USE, but you can't use them to ground your understanding of what you are doing.

      Why? What exactly is there in, say Javascript for example, that you need to understand C and Z80 assembler to be able to do properly?

      The idea that good programmers must know and understand an irrelevant language that they won't use is as antiquated as the notion that all good English speakers must know and understand Latin just because it came first and was the basis. You can learn all that you need to know to program in these high level languages by using and learning these high level languages, the things that you can't learn from there are the things that you can't touch from there anyway.

    129. Re:Sure, why not by CptPicard · · Score: 1

      Not even assembly is no longer a real representation of "what is really going on". While I have a pretty good sense in general what goes on in the emulation of a x86 processor that runs there in the hardware, I've never really thought of it as contributing that much to the way I approach programming in higher-level languages. Exposure to things like Lisp have been much more instructive in that regard.

      --
      I want to play Free Market with a drowning Libertarian.
    130. Re:Sure, why not by Anonymous Coward · · Score: 0

      Competent programmers stopped being formed a good 10-12 years ago. The JAVA/.NET generation is a fucking disaster.

      That's absolute trash! Look at all the buggy, horrible applications that were pushed out through the 80s and 90s. Programs of that ilk were of poor quality and had far fewer features and capabilities than those of today.

      Yes there are poor quality graduates these days, just as there always have been.

    131. Re:Sure, why not by exomondo · · Score: 1

      inline is a compiler directive that will cause the compiler to emit a copy of that routine every time it is called. This saves on function calls, makes for faster code (generally) but increases bloat.

      What exactly is "bloat"? I think what you are trying to say is that it increases size.

    132. Re:Sure, why not by Anonymous Coward · · Score: 0

      The line of code inside e::e() is what I'm talking about. Depending on X, it will parse either as expression: (a::b d; or as a variable declaration: a::b d.

      No. On a standard-conforming C++ compiler, it will always compile as (a::b d; and give an error if that is not a valid parse (i.e. when passing false as template argument of e). If you want it to parse as variable declaration, you must use typename and template like this:

      typename a<X>::template b<c> d;

    133. Re:Sure, why not by Anonymous Coward · · Score: 0

      Oops, Slashdot ate my angles ... it of course will compile as (a<X>::b < c) > d;.

      (And stupid Slashdot makes me wait a long time for posting this correction ...

    134. Re:Sure, why not by Anonymous Coward · · Score: 0

      In C++, objects can be existing in memory (like Java's basic types) or separately on the heap (like Java's classes).

      The heap is memory, and in Java you can have primitive types on the heap as well as the stack, for example where exactly do you think the primitive types within a heap allocated instance of a class are stored?

      This means it's often necessary to know how large an instantiation of a class will be, which leads to the private members being viewable.

      That has nothing to do with private members being "viewable". In Java you can work with interfaces which can abstract away the actual implementation, but of course you can do that in C++ too.

    135. Re:Sure, why not by exomondo · · Score: 1

      It is never necessary for the compiler to know the size of a given class when not doing things specifically related to that class. In C++, objects can be existing in memory (like Java's basic types) or separately on the heap (like Java's classes). This means it's often necessary to know how large an instantiation of a class will be, which leads to the private members being viewable.

      It's necessary in both C++ and Java, the point of difference is if you were to create a stack allocated instance of a class in C++ but not use it, why would you be doing that?

    136. Re:Sure, why not by jonwil · · Score: 1

      I grew up back when Pascal was still used as teaching language (in fact, it was the first language I learned how to program in) and am a great C/C++ programmer.

      Problem is, no-one around here will give me a job because they all want C#/.NET/J2EE/Oracle/SQL Server/etc code monkeys (generally with "at least 3 years commercial experience in xyz" or whatever meaning I cant just go and get some sort of certification or qualification in the technology and get a job that way)

    137. Re:Sure, why not by Anonymous Coward · · Score: 0

      I propose the next versions of those platforms to be named as Yellowstone and Toba.

    138. Re:Sure, why not by jonwil · · Score: 1

      I think sockets and web/internet protocols (HTTP, HTTPS, FTP, SMTP, POP, IMAP and other standardized protocols) as well as various other standard and widely used algorithms like zlib/deflate would be more useful in C++ than 2D drawing primitives.

    139. Re:Sure, why not by beelsebob · · Score: 1

      Right, which means that all the moron programmers in the world get to see your underpants pulled down and start to rely on what's behind them.

    140. Re:Sure, why not by Anonymous Coward · · Score: 0

      An ABI standard should not be part of the language standard, just like the C ABI is not part of the C language standard. After all, an ABI is very much dependent on the underlying architecture (and in the case of C++, you want it also be compatible with the C ABI used on the machine).

      However there do exist ABI standards for C++. But unlike in C, an ABI standard in C++ is not sufficient for interoperability because of the complexity of the standard library. Unless both compilers use the exact same standard library implementation, even something as simple as passing a string to a function compiler with another compiler may not work.

      In C, this is less of an issue because the types are all simple types or fully-specified structs, and the functions are mostly self-contained. However note that as soon as dynamic allocation comes into play, you may also get in trouble with C (allocating and deallocating in different DLLs can even be a problem if the very same C compiler is used! And now think about the fact that many C++ library types internally use allocation/deallocation).

    141. Re:Sure, why not by Anonymous Coward · · Score: 0

      Of what use is an UTF-8 string constant with invalid UTF-8 in it?

    142. Re:Sure, why not by Xest · · Score: 1

      "Self taught programmers aren't superior, they're just more desperate."

      That's nonsense, self-teaching requires interest in a subject, especially something that takes a prolonged period and a lot of concentration to learn like programming.

      Self-taught programmers are superior because they have a genuine passion for the subject, something that simply goes hand in hand with being able to self-teach yourself such a relatively complex topic.

      If they were doing it out of desperation rather than because of a genuine interest in the topic then they wouldn't have the pre-requisite interest to be able to get through what is rather monotonous if you don't genuinely enjoy it.

      There are two classes of programmers, those who do it because they stumbled across the topic one way or another and have a genuine passion for it, and those who did it because they never figured out a career and it sounded like something that paid well according to all the dotcom era hype and subsequent "13 year old millionaire programmer (whose daddy is an investment banker but we don't tell you that bit)" nonsense since. That latter group is the group that sucks - they don't really care, they're not really interested, they just want a decent wage. The former group is where all the great programmers come from.

      All this said I don't entirely disagree with the original premise of your argument, that it's silly to assume everyone should be a rockstar programmer. I agree because the fact is sometimes you need the crap developers because there aren't even close to enough developers in general, let alone great ones. If the choice is between having a crap developer do something or not have it done at all, more often than not it's better to have a half-arsed solution to a problem from a crap developer than no solution at all. There are varying levels of talent in every industry and you can't ever expect everyone to be top tier, sometimes all a company can afford are those further down the rung, and sometimes that's good enough, and good enough for the further down the rung developers too, because they're happy being at that level through their entire career, and because the company is happy for them to be at that level relative to what they're paying.

      FWIW I am a self-taught developer. It was never because I was desperate, but simply because I loved it and was what I always just wanted to do. If I was desperate for a job, then given my maths degree, I'd have gone down the route of one of the millions of accountancy apprenticeships that are available and become an accountant who make decent money too, I certainly never chose programming out of any kind of desperation.

    143. Re:Sure, why not by Xest · · Score: 1

      No you can't testify to this, all you can testify to is the fact you've never bothered to learn what's going on, that's not the same as preventing you. The CLR and CIL is extremely well documented, it's fairly easy to understand what's going on under the hood if you can actually be bothered.

      Hell, depending on what you're doing you HAVE to know what's going on under the hood as well as any C++ programmer does. There are times where unmanaged code is unavoidable and at that point you have to understand as much as any C++ programmer does.

      You're conflating you're lack of a care for what's going on underneath or lack of will to touch anything outside your comfort zone with the language preventing that, it doesn't. If you're expecting the language to force you to know these things then C++ is no different, amusingly I've encountered C++ developers who never really understood pointers and memory management, in fact, that's why software used to be even more buggy and there used to be even more fatal crashes than there are today. The only difference between the likes of C++ and .NET/Java is that the latter actively prevent people like you who have no interest or care to learn the in depth details from causing as much damage as you used to but if you want to know more, or want to do more then you can. Unmanaged code in .NET and the JNI provide the scope for doing exactly that and there's nothing to prevent you learning the details of the managed runtimes and their bytecode either.

      If you really want to know what's going on with something in software it's not a closed box, even as an absolute last resort if there is no documentation available then there's always a debugger and assembly available at the end of the day whatever the technology that's involved.

    144. Re:Sure, why not by Xest · · Score: 1

      "My point is that in the past you would have offered them training."

      There's no point offering training to people who aren't interested in learning, and those who are interested in learning are happy to learn themselves, because they enjoy it.

      Learning isn't something you can buy, or force on people. It's something people do because they want to and there's no point throwing money down the drain on training if it's simply just being used as an excuse for incompetence because they still wont learn. I've seen this excuse used time and time again, and employers relent, call their bluff, and give them the training to shut them up and they come back from the training just as clueless because they didn't really want training so paid no attention whilst they were there, they just wanted an excuse for not doing something - "I haven't been trained in it".

    145. Re:Sure, why not by Rysc · · Score: 1

      What happens in assembler, and to a great extent in C, is what the computer is really doing (more or less, it's pretty close). In higher level languages this connection is very fuzzy. Not knowing what will really happen when you write that for loop is more likely to lead to you writing pathological and otherwise buggy code. It's not *essential* that you know how computers really work, but it's a *really damn good idea* and more or less essential for any really good programmer. The only people who disagree are the ones that never did learn a low-level language (IOW where you work with memory/registers/pointers/that sort of thing).

      --
      I want my Cowboyneal
    146. Re:Sure, why not by Anonymous Coward · · Score: 0

      If your language has the concept of public and private then it should damn well enforce that at the interface level.

    147. Re:Sure, why not by angel'o'sphere · · Score: 1

      You can't rely on something that is private, as you have no access to it.
      I for my part ignore the private stuff in a class completely and never had a reason "as pure client" to care about something private.
      If you search a bug, and you assume it is in the code you use, then ofc it makes sense to debug through them.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    148. Re:Sure, why not by Anonymous Coward · · Score: 0

      I don't understand why people consider things that do a bunch of work for you handicaps. Seriously? Would you rather build a structure out of bricks or atoms? Do you really think it's necessary to be a physicist to build a structure out of bricks?

      Why are you even using .NET if you feel it handicaps you? Start writing all your software in C++. I can almost guaruntee you that after about 2-3 hours, you are going to say, "Fuck This" and go back to .NET.

    149. Re:Sure, why not by Anonymous Coward · · Score: 0

      Wow, finally someone who actually lives in the real world. Sometimes I wonder about these slashdot folk. It's like they live in some kind of reality bubble.

    150. Re:Sure, why not by contracrostipunctus · · Score: 1

      This is probably the most irritating and self-defeating tentacle of the culture of programming. "Everyone on the road is such a terrible driver, but me, I know what I'm doing!" I've only been graduated for a year, and before I got hired at a fortune 500, I went through all the books (Cracking the Coding Interview, etc), I looked up advice for grads, I polished my projects, and I lived in fear that "everyone is terrible! everyone doesn't know what they're doing!" The drumbeat of your lazy self-aggrandizing isn't helping anyone be better at what they do, or get all those "rockstar programmers" to work for you. But then, whining about the next generation really isn't about fixing or improving anything at all, is it?

    151. Re:Sure, why not by contracrostipunctus · · Score: 1

      Listen, if all you know is Z-80 Assembly and not binary programming for the ENIAC, you really don't know programming. You must be one of the crap programmers that need all the hand-holding of these modern toy languages.

    152. Re:Sure, why not by david_thornley · · Score: 1

      If you think private members have nothing to do with the size of objects, you don't understand what you write.

      Static allocated memory is used in all programming languages I know, but not necessarily for variable-length objects.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    153. Re:Sure, why not by david_thornley · · Score: 1

      Huh? The point of difference is that variable-length objects are represented by their pointers in Java, and not necessarily in C++. In specific, if class A has class B as a member, the size of class A doesn't depend on the size of class B in Java (since it's a pointer anyway), but it does in C++.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    154. Re:Sure, why not by david_thornley · · Score: 1

      Really? How do you do away with header files when not all the necessary information is in the .cpp files?

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    155. Re:Sure, why not by H0p313ss · · Score: 1

      Self-taught programmers are superior

      First reaction: Bullshit.

      But I'll try not to generalize too much, and I do agree with many of your points. I will accept that many self-taught programmers are superior to the mindless drones schools are now turning out (including some I graduated with). However I suspect that if you compare the best of each you will find there's lots of things that schools do teach that you might have missed out on. (And probably vice versa...)

      As you point out, the superior developers are superior because they are:

      1) Smart
      2) Motivated

      If you take a smart and motivated person and then put them through a halfway decent school system you get something even better than the smart and motivated self-taught types.

      Therefore, my counter statement would be:

      Smart and motivated self-taught developers may be superior to unmotivated cookie cutter drones.

      --
      XML is a known as a key material required to create SMD: Software of Mass Destruction
    156. Re:Sure, why not by H0p313ss · · Score: 1

      Of what use is an UTF-8 string constant with invalid UTF-8 in it?

      They're really awesome for generating bugs, it's called coding for job security.

      Yes... I'm kidding. (Or am I.... )

      --
      XML is a known as a key material required to create SMD: Software of Mass Destruction
    157. Re:Sure, why not by H0p313ss · · Score: 1

      "There's an old saying in Tennessee - I know it's in Texas, probably in Tennessee - that says, fool me once, shame on - shame on you. Fool me - you can't get fooled again."

      --
      XML is a known as a key material required to create SMD: Software of Mass Destruction
    158. Re:Sure, why not by spitzak · · Score: 1

      To stop discouraging use of Unicode. Currently if there is text on a disk that for some reason has a string of bytes that is not UTF-8, even if it is *mostly* UTF-8 and contains even the tiniest error, the programmer is often forced to abandon use of UTF-8 due to the perverse insistence of people (perhaps you) that somehow a subset of byte strings somehow violates god's principles and must be made impossible at all costs.

      This is probably the biggest impediment to I18N, and the weird thing is that the people behind it actually think they are helping.

    159. Re:Sure, why not by angel'o'sphere · · Score: 1

      What has "the size" of objects to do with the question if you use a header in C or an interface in Java/C# or simply use proper public/private scoping?
      And why do you care about the size of an object? If you are "reusing" it? You can't change anything about it. So you somehow argument pretty strange ...

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    160. Re:Sure, why not by Anonymous Coward · · Score: 0

      preprocessor and macros.

    161. Re:Sure, why not by enharmonix · · Score: 1

      The JAVA/.NET generation is a fucking disaster.

      I've never liked C++ better than C. I liked the object oriented design, but it was even more dangerous than C. When C# came out, I said, "Now this is what C++ should have been." I think .NET would be in better shape had all the C++ programmers moved to C#. Unfortunately, employers are still of the opinion that somebody who learned C# in college last year is going to be a better .NET developer than somebody who's been programming C++ for 15 years. Clueless. Actually, when I considered moving to C#, I remember seeing a job posting in 2001 that demanded 7 years .NET experience in lieu of having learned .NET in college. Again, this was not recently, this was in 2001. I can only imagine how that worked out.

    162. Re:Sure, why not by buddhasystem · · Score: 1

      C++ stopped being a humanly comprehensible language when the majority of humans decided that they can't be bothered to learn this capable tool, became lazy and complacent and otherwise started to suck at programming.

    163. Re:Sure, why not by enharmonix · · Score: 1

      .NET does a great deal for you, and I really think the handicap has prevented me from learning what's really going on.

      Rats. I had a really long reply about how C# was superior to C++ and that the stuff behind the scenes was the stuff you don't want to deal with, but then I realized you're whole point is not that you want to do it but that you want to see how it's done (and even just what's happening). So I concede, you are right. .NET is not great if you are trying to understanding how computing and programming work at a low level. Once you learn all the stuff that has to happen at that level, chances are you'll then appreciate that .NET does these things for you.

    164. Re:Sure, why not by tibit · · Score: 1

      Oh, the header files will be there, except that the compiler won't actually read them, it'll read the unit files instead.

      --
      A successful API design takes a mixture of software design and pedagogy.
    165. Re:Sure, why not by lucien86 · · Score: 1

      Don't blame the programmers, blame the **@"! expletives who control language development and the developer environment. MFC being a prime example - 'hypercomplex', tangled, frequently illogical, often very hard to do things outside the box, very ugly and unreadable code, etc.

      --
      Below the speed of light Special Relativity is one of the most accurate theories in physics - above the speed of light..
    166. Re:Sure, why not by tibit · · Score: 1

      The problem is that template metadata that's actually needed to instantiate them is awfully close to a serialized AST

      And why would that be a problem? Because, you know, actually it isn't a problem!

      --
      A successful API design takes a mixture of software design and pedagogy.
    167. Re:Sure, why not by shutdown+-p+now · · Score: 1

      It's not a problem. It does invite the question of why you need binary serialization in the first place, if it's one for one mapping of the source, anyway.

    168. Re:Sure, why not by jejones · · Score: 1

      C++ has made the same choice over and over again: "When you come to a fork in the road, take it."

      "And [Stroustrup] said “no” to no one. He put every feature in that language that ever existed. It wasn’t cleanly designed—it was just the union of everything that came along." --Ken Thompson

    169. Re:Sure, why not by Nethemas+the+Great · · Score: 1

      Javascript became incomprehensible long ago, back when fools tortured the language into an object-oriented, scripting, assembly language complete with multiple personality and ADHD. You can't build a foundation upon semantic loopholes and expect anything good to come of it.

      --
      Two of my imaginary friends reproduced once ... with negative results.
    170. Re:Sure, why not by beelsebob · · Score: 1

      So what you're saying is that as a good programmer, it's frustrating having to ignore a bunch of stuff that's private, and makes the code harder to read, while for a bad programmer, it makes it easy to rely on things that make them bad.

      The point is that a header file neatly separates this out, making it much easier to read "this is the API, this is what you're allowed to use", without any implementation detail being visible (assuming the library author was competent).

    171. Re:Sure, why not by Anonymous Coward · · Score: 0

      It's too late for that, sadly. If they did that now, there would be at least one major implementation that would refuse to change, and the standard would be useless. They don't want the standard to be completely useless (I suppose having things like name mangling be implementation-defined makes it only mostly useless?)

    172. Re:Sure, why not by HiThere · · Score: 1

      There are a large number of misfeatures. Compare the C11 std implementation with Vala, Python, D, hell, even Java. (I don't like Java's implementation because it uses the utf16 unicode, but the design is good.)

      There's no reason that a string should be modifiable, but if you don't allow that, you need to allow arrays of char that can be easily converted into a string. Some languages pick one choice, some another, both are reasonable. (Unmodifiable strings are desireable because it makes compiling/designing for parallel execution easier and safer. How you achieve it is less important.)

      Perhaps some of my distaste with the C++11 std unicode handling relates to my dislike of C++ templates, but when I tried to use the C++11 unicode, I really hated it, unlike that of any other language that implemented it. I'd actually rather use byte strings and the Unicode std. library, which means it's (from my point of view) a really terrible design. I literally moved over to doing the project in C before deciding that I didn't need efficiency enough to fight that battle. So that part is not being done in Python. (I could have done it in D, but I'd need too many unsupported external libraries.)

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    173. Re:Sure, why not by angel'o'sphere · · Score: 1

      A header file does not separate that at all.

      It seems you never have read a header file from top to bottom.

      And you don't grasp how other languages work, hence you believe your limited experience is the only truth.

      Perhaps you should learn more programming languages? (And as Stroustrupp says: more human languages as well)

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    174. Re:Sure, why not by spitzak · · Score: 1

      I think I agree with you. There should not be any templates.

      I think the proper solution is to standardize on UTF-8, and use *ITERATORS* (not array index) to see the characters. This avoids the huge problem that "character" is not actually defined (ie what do you do with combining characters or invisible ones or with composite characters such as ½). Iterators will also allow errors in the UTF-8 to be returned as unique values, rather than using exceptions (which typically destroy the iterator) or lossy conversion to a character that could be valid encoded. This inability to handle errors is *HUGE* and I am really annoyed by all the people who want to pretend that some physical natural law is going to make them non-existent, this is so misguided that I am absolutely floored that anybody believes it, but most UTF-8 decoders act this way!

      The fact that std::string::operator[] returns a non-const reference is another disgusting mistake, pandering to the idiots who think case-conversion is something users want and that it can be done by simply substituting "characters" (whatever a "character" is...). If operator[] returned a const reference we could use reference counting rather than having to copy std::strings.

      Libraries that don't use iterators and thus require pre-conversion to an array of "characters" are broken. Such conversions are wasteful, must be redone depending on what type of "character" the algorithim needs, and are lossy. I am ignoring all the current C++ attempts at "Unicode handling" because of this. But the language itself still needs UTF-8 string constants with the ability to insert arbitrary bytes, even if a fixed library is provided.

    175. Re:Sure, why not by Anonymous Coward · · Score: 0

      Unfortunately, you can't ignore it -- if the private stuff for a library changes, your code that depends on this library needs to be recompiled, even though (ostensibly) your code doesn't care about the private details! So much for "encapsulation".

    176. Re:Sure, why not by exomondo · · Score: 1

      Huh? The point of difference is that variable-length objects are represented by their pointers in Java, and not necessarily in C++. In specific, if class A has class B as a member, the size of class A doesn't depend on the size of class B in Java (since it's a pointer anyway), but it does in C++.

      Only if it isn't a pointer, so if you care about that then just use pointers, simple, though if you aren't doing things "specifically related to that class" then I'd question why you have it there as a member at all. But regardless, that's beside the point, how does the compiler needing to know the size of a class lead to showing that class's private members & functions to programmers and them subsequently relying on them?

    177. Re:Sure, why not by Anonymous Coward · · Score: 0

      You didn't answer the question, try reading it again.

      Not knowing what will really happen when you write that for loop is more likely to lead to you writing pathological and otherwise buggy code.

      Specifically what?

      So it is all well and good to say you should learn those lower level languages and that the only people that disagree with you are those who didn't but your failure to answer the question and give an actual example demonstrates that either your point isn't valid or you are just regurgitating something you heard and don't actually know much about it. So, assuming you know what you're talking about, try answering the question rather than dodging it and giving a vague response devoid of actual justification.

    178. Re:Sure, why not by Anonymous Coward · · Score: 0

      What next generation? There seem to be a bit more awful programmers now, but most programmers were always terrible. This is just a fact.

      "Everyone on the road is such a terrible driver, but me, I know what I'm doing!"

      That is, in fact, sometimes true. You can definitely tell good programmers from bad or mediocre ones if you take the time to try, and damn, most programmers are bad.

    179. Re:Sure, why not by Anonymous Coward · · Score: 0

      Then ask yourself why you attract such crappy applicants. With you giving no information about what the job is, who it is for, how it is advertized and what your expectations are (beyond vague terms like "interest" and "drive" - the fact that you are using those gives even more validity to the idea that you are the problem) there is every reason to assume it is you who is just terrible at attracting decent talent.

    180. Re:Sure, why not by Anonymous Coward · · Score: 0

      My point is that in the past you would have offered them training.

      We do offer training, but only to people who demonstrate that they are intelligent and know the fundamentals. If someone doesn't even know the fundamentals or the logic behind what is happening, that tells me that they have little interest in programming and/or no drive; I don't want to waste resources on such people.

      True though, I'm making some assumptions though about your political views because you're so harsh on people. I'm assuming your politically and economically conservative, and would be opposed to high taxes on the wealthy to train and educate people and support them while they receive that training and education. I'm also assuming you've bought into the 'Job Creator' narrative that says employers are responsible for creating livelihoods for employees and that this excuses the obscene wealth they've been granted.

      I don't know why you'd make such random assumptions; all of them are wrong.

    181. Re:Sure, why not by Anonymous Coward · · Score: 0

      However I suspect that if you compare the best of each you will find there's lots of things that schools do teach that you might have missed out on. (And probably vice versa...)

      Information doesn't only exist in schools, so I find that unlikely. Since we're comparing the best to the best, the best self-educators wouldn't miss a thing.

    182. Re:Sure, why not by Anonymous Coward · · Score: 0

      There are two classes of programmers, those who do it because they stumbled across the topic one way or another and have a genuine passion for it, and those who did it because they never figured out a career and it sounded like something that paid well

      And since the former the is not exclusively the domain of self-taught programmers most of your post is rubbish. And actually many self-taught programmers fall into the latter category because they thought making a website or an app was a way to get rich quick. This is nothing to do with being self-taught at all, it's purely about whether a person is motivated and interested in the field.

      FWIW I am a self-taught developer.

      Really? Wow! From your pious statement that "Self-taught programmers are superior" I never would have guessed!

      they have a genuine passion for the subject

      You ignore the fact that that has nothing to do with being self-taught. Motivated and interested people are generally going to be superior in any field than unmotivated and disinterested people, but that is hardly a revelation. The former will obviously have learned more skills on their own but that doesn't mean those motivated and interested people who are self-taught are better than those motivated and interested people who are formally trained, good formal training will give you the necessary underpinnings to complement self-learning. So stop being an arrogant dick and thinking you know everything.

    183. Re:Sure, why not by Xest · · Score: 1

      I should probably elaborate as both your response and the AC's suggest I probably wont clear enough. I do not think being self-taught necessarily precludes a university education also, because I think the best people who go to university also have passion enough for the topic in question to learn about it both before they take on the subject and whilst they are studying it formally. Everyone has some degree of formal education so I simply view someone as self-taught as someone who has learnt the majority of what they know off their own back and that may for example mean that they learnt everything in CS101 before they even went to university - university didn't teach them that, it simply provided useful confirmation, so I'd still define them as self-taught in that area.

      I also did exactly this because I also studied a comp. sci. degree alongside work after I'd started working professionally as a developer, in large part because I wanted academic confirmation of what I had taught myself. I'm not one of those who believes there is no merit in formal education, I fully appreciate the benefits of it, and I think it augments self-teaching very well, but I do not think it by itself guarantees any superiority over self-teaching, on the contrary.

      I do agree with you, my point was more that I believe someone who has only ever done a degree in software development or computer science and never bothered to study anything outside of that will not be as good as someone who is self-taught whether that self-taught person hasn't, or has also done a degree as well as being heavily self-taught.

      Or in other words, my point is that whether formal education is involved or not, self-teaching is the differentiator, someone who is self-taught is better than someone who is merely formally educated with no self-teaching outside of that, whilst, yes, I agree someone who is heavily self-taught but also did a degree as well will be even better again.

      My opinion is of course only formed by my own personal experience, so perhaps it doesn't work universally, but I believe a lot of this because I was helping my friends who went straight into comp. sci. degrees using purely my self-taught knowledge because I was well ahead of them by the time they were doing their degrees and after they'd graduated. I was also doing better in the field professionally than they were before I did my formal degree, but doing that degree has helped me do even better again, I appreciate the fact that it was a good opportunity to open my eyes to topics I might never have properly bothered with but which have become very useful for me, such as AI, specifically genetic algorithms and and neural nets.

      I should also add however that I believe my other degree in maths has been highly important in helping me grasp topics too that my friends struggled with and to find solutions that my colleagues couldn't, so perhaps my original study of that does distort things a little bit.

      Make of it what you will, but I've always found the best hires to be far and away those who spend a lot of time self-teaching, degree as well or not, so until I find a stellar candidate who has only ever done formal education if such a thing exists then I doubt my opinion will ever change.

      So I hope you'll understand at least that I'm not one of those who never bothered with academia and so claims it's useless because they never even tried it and don't want to admit they could be missing out, I do very much think it has value and despite being on a hiatus right now I do plan to do even more postgraduate study in the years to come, but I do think that value is secondary to being a motivated self-learner. After all, let's be honest, what happens when you've studied to the limits of human knowledge and available formal education on a topic? self-learning goes hand in hand with research into new frontiers and is the only way to further knowledge on a topic in the first place - when you reach that height, there is no formal education to further your abilities anyway, discovery through self-learning is the only way forward.

    184. Re:Sure, why not by david_thornley · · Score: 1

      So what's the point, if we're still going to have the header files? Is there any real difference between unit files and precompiled headers?

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    185. Re:Sure, why not by david_thornley · · Score: 1

      The compiler needs some way to determine the size of class B if it's included in class A. The declaration of class A isn't doing anything related to class B (other than laying out space for it in A), although the implementation presumably does.

      The inclusion of private members in the header file means that the compiler needs only the header file to determine the size of an object. Without that, there would have to be another way, and that would be a major redesign of the language.\

      Do you have a suggestion for finding the size of a class layout without knowing all the members?

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    186. Re:Sure, why not by cant_get_a_good_nick · · Score: 1

      Back when Joel could write, he penned this on what he called the Law of Leaky Abstractions. Related, his rant on Java Schools

      Joel's writing was always flawed, never perfect, but usually made you think some.

    187. Re:Sure, why not by david_thornley · · Score: 1

      The size of an object doesn't really matter in Java or C#, because such objects are always instantiated on the heap, so they're represented in all other use as a pointer. In C++, an object can be instantiated on the stack, in the heap, or as part of another object (whether on stack or in heap), and therefore it is necessary to know the size of an object when doing memory layout. It is necessary to have a memory layout for efficiency, so that A.foo can be translated into an offset from the start of object A.

      If, in Java, class A has a member of class B, the length in A's memory layout is known to be the size of a pointer (8 bytes, IIRC). In C++, the length in memory layout is the size of B (plus trailing alignment padding), so to lay out anything in memory past the B member it is necessary to know the size of B.

      The ability to embed an object directly into another object is a feature that comes pretty much from the design goals of C++, and which makes C++ more usable for some applications (like embedded code with tight restrictions) than Java or C#.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    188. Re:Sure, why not by angel'o'sphere · · Score: 1

      So you need to know the size of a struct in C to use it?

      Wow, I always thought allocation on the stack is done by the compiler, I did not know you need to know the size of the struct.

      And, strange, does size_of(struct_X) not work anymore?

      Sorry mate, no idea what point you like to prove.

      Your argument makes no sense at all.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    189. Re:Sure, why not by exomondo · · Score: 1

      Do you have a suggestion for finding the size of a class layout without knowing all the members?

      Use pointers for object members, just like Java does. Ultimately you still can't use those private members and you don't get any private implementation details from just the header anyway so the programmer isn't going to be relying on them at all.

    190. Re:Sure, why not by Anonymous Coward · · Score: 0

      If the header files you have observed do not separate this, then you are either 1) looking at bad code or 2) looking at C++. C++ unfortunately breaks this, in C, and ObjectiveC, this is *exactly* what a header does. It specifies exactly what the compiler (and hence a programmer writing another compile unit) is allowed to know about when working in that other compile unit. It exactly corresponds to what is public.

      If you've observed code that makes more things public than it should (and is not C++), then as I said above, this is bad code.

    191. Re:Sure, why not by david_thornley · · Score: 1

      The compiler needs to know, and if the compiler knows you can find out (that's what sizeof is for).

      Good luck using sizeof on a struct when the definition is not available to that translation unit.

      However, to put this into painstaking detail:

      In compiling a class description, the compiler needs to know how to lay the class out in memory, assigning offsets to each member. This is true for most compiled languages that have something like classes and structs. This means the compiler needs to know how much memory to allocate for each member.

      In C++, a class can directly include an instantiation of another embedded in it. Therefore, to compile the including class, it is necessary for the compiler to know the size of the included class.

      It's also common to put objects on the stack, and again the compiler has to know how big the class is if it is to properly increment or decrement the stack pointer.

      Therefore, it is often necessary, in C++, for the compiler to know how big a class is. This does not apply, of course, when there's a pointer to the class and nothing more, since the compiler knows how large a pointer will be (typically 4 or 8 bytes).

      Now, how is the compiler supposed to know the memory requirements of a class? In C++, it's done by giving the compiler the class definition so it can calculate that. Private members need to be in the class instantiation, and that's why they're needed in the class definition, which is usually in the header file. In addition, functions can affect the size of a class, so the compiler has to have information about them. Frankly, I don't know offhand a better way to provide this information, and if you have an actual intelligent suggestion I'd like to know what it is.

      If we actually go back upthread, we find that you asked about headers that include private members. I'm attempting to answer this well. You have persisted in missing the point, as well as making statements that make me think you don't know C++. I'm trying to show you what you're missing.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    192. Re:Sure, why not by angel'o'sphere · · Score: 1

      So, why do you inform us about this?
      We all know that.
      But a few posts back you claimed "you " need to know the size of structs.
      You claimed: all languages should use headers because that is "better".
      You claimed it is easy to separate "public" parts from "private" parts with headers.
      Now you explained far and long that a class definition needs to be in the header so the compiler knows the size. (You see the contradiction? Do you?)
      So: how again do you want to remove the private parts and still have a header? Sure: you refactor your program to move everything private into a different class. Just so that your "header" is free of it ...
      And private methods are "verboten" as the user of a class might "rely" on them? How should he be able to rely on something he can not call?

      If we actually go back upthread, we find that you asked about headers that include private members. I'm attempting to answer this well. You have persisted in missing the point, as well as making statements that make me think you don't know C++. I'm trying to show you what you're missing.
      Then you misunderstood something, I'm pretty aware about C++ (before C++11x, I wrote roughly 650kLOC between 1989 and 1999).

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    193. Re:Sure, why not by david_thornley · · Score: 1

      I have no idea who claimed headers were better, or that it's easy to separate public from private parts with headers. I do know who claimed that private parts didn't affect class size, and who claimed I didn't understand what I was talking about (gold medal on Stack Overflow for C++).

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    194. Re:Sure, why not by angel'o'sphere · · Score: 1

      Well, then you crossed into a discussion with someone else (I'm bad in remembering names).

      I'm not aware that someone claimed that private "data" members don't effect class sizes, I certainly did not.

      However I guess there was talked about "private" methods ... as many people don't realize that the amount of methods a class has does not effect its "objects size".

      So, if I accused you "you don't know what you talk about" then my apologizes and likely I misunderstood one of your posts or you wrote it pretty unclear, sorry for that.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  2. huh? by epyT-R · · Score: 0

    This is redundant. High level concepts like drawing graphics are always going to be system dependent, and today's operating systems come with them already. I don't see why having this as part of the C++ base library benefits..

    1. Re:huh? by Anonymous Coward · · Score: 0

      Benefits what, or whom? Please complete your sentence.

    2. Re:huh? by carld · · Score: 1

      We have stdio.h why not stddraw.h ?? It's not like stdin/stdout are not system/hardware independant.

    3. Re:huh? by JDG1980 · · Score: 4, Informative

      This is redundant. High level concepts like drawing graphics are always going to be system dependent, and today's operating systems come with them already. I don't see why having this as part of the C++ base library benefits..

      Blitting to the screen may be OS-dependent, but rendering to a canvas need not be.

    4. Re:huh? by Anonymous Coward · · Score: 1, Informative

      Rasterization is hardly system dependent.

      There's a variety of well defined mathematical algorithms for coordinate space transformation, intersection, and ultimately rasterization of polygonal and parametric/polynomial shapes.

      No one is saying this graphics library is going to draw to the screen, in fact based on the discussions and proposals - it'd raster directly into memory (and it's up to the user to implement system dependent methods to take it from memory and display it on the screen, if that's even what the user wants).

    5. Re:huh? by epyT-R · · Score: 1

      Actually, it's correct grammar. Benefit is also a verb.

      http://www.merriam-webster.com/dictionary/benefit

      (scroll down)

    6. Re:huh? by beelsebob · · Score: 1

      It had better be both damn well specified, and super under specified at the same time.

      If it's not well enough specified, different OSes will do different things re (for example) antialiasing, where they decide the centre of a pixel is, etc

      If it's too well specified, no OS will be able to implement it efficiently.

      My suspicion is that it'll end up under-specified, and useless because of it, in the same way as java's drawing libraries are typically an endless source of bugs (common ones being that the developer assumed that no AA would happen, and then breaking on OS X or more recent windows installs, and rendering nasty looking halos around things, because the developer assumed they could just over-draw something and it would disappear).

    7. Re:huh? by beelsebob · · Score: 2

      The problem is, what's efficient, or nice, is not well defined. Should you antialias lines? If so, what type of antialiasing? Is that type of AA efficient on the graphics card in use? If you don't do that, do certain programs break?

      These are all questions that have been answered before by java –yes, everything breaks, because everyone needs to implement graphics subtly differently.

    8. Re:huh? by epyT-R · · Score: 1

      Yes, I know, but it seems to me that those kinds of functions don't belong in the base library as the particulars would be design dependent anyway. For example, we have mpfr for floating point math, which is distinctly separate from the rest of the toolchain, and is an optional piece. Maybe the line is arbitrary, but it seems like feature creep to me.

    9. Re:huh? by Anonymous Coward · · Score: 1

      Except for the glitz backend, Cairo has nothing to do with the GPU - it's all implemented on the CPU, same implementation on all architectures, all platforms.

      Antialiasing options are defined as flags.

    10. Re: huh? by michaelmalak · · Score: 1

      Yes benefits is a verb, but in this context it is a transitive verb, meaning a direct object is required.

    11. Re: huh? by behrooz0az · · Score: 1

      ... benefits me.
      Satisfied?

      --
      Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion. -- Spazmania (174582)
    12. Re:huh? by dreamchaser · · Score: 1

      I'll finish it for him...'anyone.'

    13. Re:huh? by behrooz0az · · Score: 2, Insightful

      Do you develop for windows? I suspect yes, because in linux we've had this library for years and everyone knows it's a freakin' cross-platform library with very good documentation, coding style, naming convensions, specs, ...
      Stop ranting already.

      --
      Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion. -- Spazmania (174582)
    14. Re:huh? by beelsebob · · Score: 1

      You seem to be confusing "this works well on linux" with "this is the perfect solution for all platforms, and it works perfectly across all platforms".

    15. Re:huh? by beelsebob · · Score: 2

      "It's implemented on the CPU" is the first gigantic red flag here. The implication of this is that it's so tightly specified that it's impossible to implement efficiently (i.e. on all vendors different GPUs which do subtly different things re how the exact pixel colours come out).

    16. Re:huh? by shutdown+-p+now · · Score: 1

      No, he isn't. He's saying that people who code for Windows only aren't even aware of the fact that there are great cross-platform libraries available to them which work just fine on Windows. And he is right.

      libxml2 has a similar story, by the way.

    17. Re:huh? by beelsebob · · Score: 1

      No, he's assuming that the existence of one cross platform library for one well specified task means that another task can be well specified in a way that it can be efficiently implemented on all platforms. That's not true of graphics. This isn't even true of different implementations of graphics drivers on one platform, let alone across platforms.

    18. Re:huh? by Anonymous Coward · · Score: 0

      At least I've seen it somewhere instead of just speculating.
        And my reason for mentioning Linux was mentioning it's age there and the fact that it *has* to be enough specified to be working there for all this time.

    19. Re:huh? by shutdown+-p+now · · Score: 1

      Why isn't it true for rendering 2D graphics to a memory or a file? What, exactly, is different between Windows and Linux in drawing a line of a given color and thickness from (x1, y1) to (x2, y2)?

      (And don't say "anti-aliasing algorithm" - that should just be a configurable parameter.)

    20. Re:huh? by dryeo · · Score: 1

      A real world complex cross platform program using Cairo is Firefox (most recent might use something different by default on Windows, I haven't kept up). It works pretty good on all platforms including non-main stream with (at least on my platform) options to control things like anti-aliasing.

      --
      https://en.wikipedia.org/wiki/Inverted_totalitarianism
    21. Re:huh? by JDG1980 · · Score: 1

      You seem to be confusing "this works well on linux" with "this is the perfect solution for all platforms, and it works perfectly across all platforms".

      Cairo works fine on Windows. Firefox used it for quite a few releases, and I believe still has it included as a fallback if their custom "Azure" rendering library is turned off or can't work for some reason. In fact, it was Mozilla that contributed the Direct2D back-end to Cairo. (Cairo is quite flexible - you can make it render its canvas to almost anything: SVG, PDF, Windows GDI, X11, and a couple of others.)

    22. Re:huh? by JDG1980 · · Score: 2

      The problem is, what's efficient, or nice, is not well defined. Should you antialias lines? If so, what type of antialiasing? Is that type of AA efficient on the graphics card in use? If you don't do that, do certain programs break?

      You're making this more complicated than it needs to be.

      First of all, why would you ever want to draw Bresenham-style non-anti-aliased lines? The only reasons I can think of would be if you're emulating some sort of legacy system, or if you are working on an embedded platform with a monochrome LCD display. And these are unusual enough situations that I think it's reasonable to expect you to write your own code or use a library designed specifically for your purposes, rather than demand that a proposed industry standard be modified or eliminated entirely simply because it doesn't fit your particular idiosyncratic need.

      And since when is it important precisely which anti-aliasing algorithm gets used? I checked the SVG standard, and it says nothing about what particular algorithm is used for lines and other primitives. Indeed, as you mention, it would probably be inefficient to do so, since not all GPUs may be optimized for the same method. Yet this is a cross-platform standard, supported by multiple browsers, and works just fine in the real world. If someone is writing vector graphics that rely on undocumented, system-dependent aspects of rendering to display correctly, they're doing it wrong.

    23. Re:huh? by Anonymous Coward · · Score: 0

      How to draw a line using hardware accelerated graphics cards. However proper 2D drawing primitives haven't been done in hardware for quite a while, but who knows it may get a comeback, maybe they can use cairo or display pdf as a standard.

    24. Re:huh? by beelsebob · · Score: 1

      The point is that AA algorithm *can not* be a configurable parameter, because different hardware simply does it in different ways. It's impossible to implement FXAA efficiently on nVidia hardware, and it's impossible to implement CSAA efficiently on AMD hardware. This is the point, efficient implementation of graphics *must* be sufficiently weakly specified that it can be efficiently implemented. The result of that is that it can not be sufficiently strongly specified that all platforms behave the same, and you can get benefit from having a nice abstracted cross platform API.

    25. Re:huh? by tibit · · Score: 1

      Such high-level concepts wouldn't be high level concepts if they were system dependent. Cairo offers a device-agnostic interface, just as C++ iostreams does, or C's file I/O. Many of Cairo's devices are completely system independent - pretty much any device that is not tied to the API of an operating system. So, if you use Cairo to draw into platform-specific handle on Windows or OS X then yes, your application is system dependent. But those are the only examples I think. Everything else is agnostic. With Cairo, you write to raster or vector files the same no matter what OS you're on, and the output is supposed to be the same; unless floating point implementation details interfere with that. Even output via Xlib will work the same for a given X server - you could be accessing that server from OS X, Windows, Linux, BSD, or even an OS-less embedded device that uses xlib with a stand-alone TCP/IP stack.

      --
      A successful API design takes a mixture of software design and pedagogy.
    26. Re:huh? by tibit · · Score: 1

      That's just silly. All of what you mention is still system-independent. Whether you antialias or not is just a choice of algorithms you use to draw lines. It produces identical output no matter where you run it. If you use Cairo to generate a PDF file or a JPEG file, the only differences in output will be due to floating point implementation differences. The operating system has nothing to do with anything here.

      --
      A successful API design takes a mixture of software design and pedagogy.
    27. Re:huh? by tibit · · Score: 1

      Nobody in their fucking sane mind uses an OS-provided library/API for antialiasing or for actually rasterizing anything! It hasn't been done for ages if you care about portability at all. Anything that is portable out there will positively not use any platform APIs since they are usually a hell to deal with and are quirky (read: bugs that became "features" by default, not by design). Both Cairo and Qt do basic rasterization using their own code. If you use a cross-platform web browser, it doesn't use any platform APIs for drawing other than for copying the final bitmap to the screen. We're talking anything webkit-based, anything gecko-based, etc. If you use any recent Qt-based application, it does the same.

      --
      A successful API design takes a mixture of software design and pedagogy.
    28. Re:huh? by tibit · · Score: 1

      Cairo works better at rendering stuff on Windows than winapi-style libraries are. Seriously.

      --
      A successful API design takes a mixture of software design and pedagogy.
    29. Re:huh? by tibit · · Score: 1

      Drawing a line using hardware acceleration ends up in a bunch of geometry generated and sent to DirectX or OpenGL. That's how it's currently done, and even Cairo has a glitz backend that does just that. Qt supports this model widely. Legacy QPainter API using the OpenGL backend is available for QWidget and QWindow-based apps, and for Qt Quick 1. Qt Quick 2 has a way better performing scene graph implementation that renders using OpenGL as well.

      --
      A successful API design takes a mixture of software design and pedagogy.
    30. Re:huh? by david_thornley · · Score: 1

      Your arguments don't seem to work well together. A few posts ago, you argued that the existence of a good cross-platform Linux solution didn't mean a good Windows solution, but now you're arguing about efficiency on different hardware. Any good general Linux solution is going to work on a very wide range of hardware, and in fact if there couldn't be a good solution across a range of hardware there couldn't be a good Windows solution either.

      If it's possible to produce a general Windows graphics library, or a general Linux one, it's possible to have a general graphics library that works fine on either.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    31. Re:huh? by shutdown+-p+now · · Score: 1

      The point is that AA algorithm *can not* be a configurable parameter, because different hardware simply does it in different ways. It's impossible to implement FXAA efficiently on nVidia hardware, and it's impossible to implement CSAA efficiently on AMD hardware. This is the point, efficient implementation of graphics *must* be sufficiently weakly specified that it can be efficiently implemented.

      We are talking about 2D graphics here. FXAA and CSAA are not used to antialias 2D lines. Unlike 3D scenes, where you can't AA as you draw because of Z-order, in 2D, it's entirely viable, and is how things have always been done.

      Also, accelerating basic 2D primitives is rarely even worth it, and few libraries have done it historically - yet no-one has complained about it even ten years ago, when desktops were several times slower than our phones today. The only thing that normally needs acceleration is blitting images, but that one is easy to specify in such a way that it can be efficiently done everywhere.

      The result of that is that it can not be sufficiently strongly specified that all platforms behave the same, and you can get benefit from having a nice abstracted cross platform API.

      This also presupposes that all platforms behaving the same is a desirable outcome, which is not necessarily true. E.g. as far as rendering on screen goes, I would strongly prefer the app to use text rendering appropriate to the platform - which would result in different output on Windows vs OS X, but said output would then be consistent with all the other apps that I may be running at the time.

    32. Re:huh? by turgid · · Score: 1

      Someone already did that a while back.

    33. Re:huh? by Anonymous Coward · · Score: 0

      You mean high level things like file I/O? There is no good reason why 2d graphics should not be standard across platforms. Now many OS already have a Cairo library already available? http://cairographics.org/backends/ Looks like more than a few. I would even like to see a GUI library become a standard part of the language but that might be asking for too much.

    34. Re:huh? by Xest · · Score: 1

      Exactly. Any software house that does cross platform graphics work most likely already has a library that does this already. Graphics abstraction layers are insanely common way of masking the underlying hardware or operating system differences whilst providing a common way of drawing to screen.

      I've not looked into the details but I'm guessing all this does is standardise that, so that rather than everyone rolling their own, there can now be one that's standard for everyone. You can hop between companies and still know exactly how to draw to screen in C++ without having to learn their own custom internal abstraction layer for doing exactly that.

    35. Re:huh? by Nethemas+the+Great · · Score: 1

      Graphics have be a part of C/C++ from nearly the beginning. They've been nearly worthless since the beginning (and probably still will be), but they've always been in there. This I suppose is just a refresh of "graphics.h" but instead of wrapping BIOS calls it's wrapping OS API. Perhaps this will serve as a good foundation for high-quality cross-platform GUI libraries but I'm leaning pessimistic.

      --
      Two of my imaginary friends reproduced once ... with negative results.
  3. That's unfortunate by PhrostyMcByte · · Score: 2, Interesting

    Cairo is a great library, I've used it and found it very easy, but it's not remotely approaching a standards-quality design. The closest I've seen would be Anti-Grain Geometry, which makes phenomenal use of templates.

    1. Re:That's unfortunate by Dahamma · · Score: 5, Funny

      Cairo is a great library, I've used it and found it very easy, but it's not remotely approaching a standards-quality design.

      Yeah, to make it C++ standards-quality they'll need to make it much less intuitive, add tons of templates to make it unreadable, and change the method names to something that makes much less sense...

    2. Re:That's unfortunate by edxwelch · · Score: 1

      I can't think of any case where templates would be needed in a graphics library. That's just going to make the code more cryptic and harder to understand.

    3. Re:That's unfortunate by Cyberax · · Score: 2

      Unfortunately, Anti-Grain's author had died recently so it's unlikely Antigrain is going to be developed fast enough to be standardized.

    4. Re:That's unfortunate by mraeormg · · Score: 3, Interesting

      While AGG is one of the most cleanest and high quality 2D rendering APIs, it's improbable that AGG will be accepted by the c++ committee, Herb Sutter works for microsoft, and AGG's author is very critical of many graphical features of windows, like the sub par font rendering. An example of this is the the dialog window for enabling high dpi font scaling.
      http://i1.wp.com/www.istartedsomething.com/wp-content/uploads/2006/12/dpi480_3_l.jpg

    5. Re:That's unfortunate by biohazard123 · · Score: 0

      Are you confusing boost with the standard library??

    6. Re:That's unfortunate by mraeormg · · Score: 1

      Templates are useful when application developers should be able to make low-level, detailed optimizations, like specifying if pixels should be 8, 16, 24-bit. Or even float/double, with/or without alpha.

    7. Re:That's unfortunate by PhrostyMcByte · · Score: 1

      AGG uses templates to select all number of things, from component type, colorspace, blending, renderers, and various other things. It is not cryptic at all.

    8. Re:That's unfortunate by Anonymous Coward · · Score: 0

      Yeah, AGG seems very C++... First example even uses FILE, fprintf, etc...

    9. Re:That's unfortunate by Anonymous Coward · · Score: 0

      Cairo is a great library, I've used it and found it very easy, but it's not remotely approaching a standards-quality design. The closest I've seen would be Anti-Grain Geometry, which makes phenomenal use of templates.

      Miguel de Icaza says the exact opposite

    10. Re:That's unfortunate by shutdown+-p+now · · Score: 1

      It's not exactly a secret that C++ iostream library is ridiculously badly designed, even among C++ programmers.

    11. Re:That's unfortunate by Anonymous Coward · · Score: 2, Insightful

      Really?

      glVertex2d
      glVertex2f
      glVertex2i
      glVertex2s
      glVertex3d
      glVertex3f
      glVertex3i
      glVertex3s
      glVertex4d
      glVertex4f
      glVertex4i
      glVertex4s
      glVertex2dv
      glVertex2fv
      glVertex2iv
      glVertex2sv
      glVertex3dv
      glVertex3fv
      glVertex3iv
      glVertex3sv
      glVertex4dv
      glVertex4fv
      glVertex4iv
      glVertex4sv

    12. Re:That's unfortunate by AuMatar · · Score: 0

      You're assuming that the math behind those is the same for all those types. It it is, a template may work. If it isn't, a template will not work.

      You also then run into problems with the type assumptions- lets say you're doing mostly floating point math, but you get some numbers in as integers (say from a mouse click). If you have named functions like these, C++ will type convert for you. If you use templates, C++ will call the int version and the result of the function may be rounded differently do to it.

      This is someplace I'd be very leery of templates.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    13. Re:That's unfortunate by AuMatar · · Score: 0

      Like damn near every C++ program in existence? In 14 years of programming C++ professionally, I've never seen anyone use iostream for file IO. It has some major flaws, and isn't any more readable. It also features a bad use of operator overloading- completely redefining what > mean. The only time I've seen it used is cin and cout with very simple programs, and even cin is avoided for text input.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    14. Re:That's unfortunate by ciroknight · · Score: 1

      That's unfortunate. They looked at AGG as literally the example of what *not* to standardize because of it's horrendous usage of templates.

      --
      "Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is." G.W.Bush
    15. Re:That's unfortunate by ameline · · Score: 2

      Why are all the insightful posts in this thread being modded "funny"?

      C++ is *way* too big a language already. It's got the PL/1 problem (yeah, get off my lawn) -- when everyone only understands 0.8 of your language (or some amount under 1.0) it winds up being a different 0.8 for everyone. And this means that virtually any programmer will write code that is unreadable to another. (and if there is one thing that over 25 years of programming has taught me is that code readability trumps almost everything else).

      Interestingly enough, IBM created PL.8 (an 80% subset of PL/1) for internal use. The original XL compiler back-end for RS6000/PPC was written in PL.8

      / Really -- my lawn -- get off of it!

      --
      Ian Ameline
    16. Re:That's unfortunate by Carewolf · · Score: 2

      You're assuming that the math behind those is the same for all those types. It it is, a template may work. If it isn't, a template will not work.

      No, templates will still work in the later case. How do you think hash-tables are implemented? It is possible to do specialization in templates, for instance specialize all integer and floating point versions.

    17. Re:That's unfortunate by edxwelch · · Score: 1

      You don't need templates for that.

    18. Re:That's unfortunate by tibit · · Score: 1

      You must really not have a feel for how modern C++11 code can look like, and what templates are used for. You're stuck in the C-with-objects mentality.

      --
      A successful API design takes a mixture of software design and pedagogy.
    19. Re:That's unfortunate by tibit · · Score: 2

      You seriously need to look at the eigen project to understand that C++ with its templates can actually generate better numerical machine code than C. Yes, all with different math for different things. You demonstrably don't grok idiomatic C++. A whole lot has happened there in the last 13 years. Yes, admittedly it all reads like functional-style workarounds for stuff that was mostly a solved problem with LISP, but hey, at least it's a mainstream language that produces efficient assembly.

      --
      A successful API design takes a mixture of software design and pedagogy.
    20. Re:That's unfortunate by Tailhook · · Score: 1

      If it isn't, a template will not work.

      I'm afraid you've revealed a degree of ignorance here that discredits whatever opinions you may have about C++. C++ provides template specialization, which permits distinct, parallel implementations based on template parameter type. Foo<double> and Foo<int> need not share implemenations.

      C++ templates have been used very successfully in libraries that involve co-variant types and sophisticated algorithms. See OpenCV for a popular and widely used example. Templates are endemic among the fundamental types of that library and the C++ API has displaced the now deprecated C API because the C++ language itself and our contemporary cadre of C++ compilers are handling these use cases just fine.

      So please stop bad-mouthing things you don't understand.

      --
      Maw! Fire up the karma burner!
    21. Re:That's unfortunate by david_thornley · · Score: 1

      We use iostreams for file serialization. It works pretty well there, since (unlike stdio) it's easy to create the operators for any given data type. I wouldn't want to use it for any sort of human-formatted output, because it sucks for that.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    22. Re:That's unfortunate by AuMatar · · Score: 1

      Sure, they don't have to. But if they don't share implementation, all the benefits of using a template are gone. If you have to specialize in a dozen different ways, your only reason for using templates is mental masturbation. Having to write specific specializations for types is the number 1 sign that your solution shouldn't be using a template.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    23. Re:That's unfortunate by Anonymous Coward · · Score: 0

      Wrong, the above is easily done with templates + overloading. Hell, even if you completely discount overloads, it can still be done, just not quite as conveniently. And it would really be just the utmost tiny little tip of the iceberg of what you could do with templates if you cared to try.

      As for implicit type casts, those are really quite trivial to prevent. Obviously if your input getter returns integer coordinates for the mouse, you would know that it does, and you can simply cast them yourself. If you want a more fool-proof way, you could force the use of various "strong" type aliases (thin wrapper classes that will be compiled away with optimisations turned on, but that ensure implicit casts are not done).

      I'm sorry, but if you're not aware of simple things like these, you really have no place commenting on the design of a C++-library.

      Preemptive disclaimer: I'm not saying C++ is a particularly well designed or sane language: I find it amazingly clunky and often incredibly annoying. However, I'm also annoyed when people write it (or other languages) off based on faulty assumptions or plain ignorance.

    24. Re:That's unfortunate by Anonymous Coward · · Score: 0

      Yah should just have a bunch of macros defined everywhere instead of templates, much more intuitive.

    25. Re:That's unfortunate by Anonymous Coward · · Score: 0

      Sure, they don't have to. But if they don't share implementation, all the benefits of using a template are gone.

      I didn't look at the library in question, but templates are not only useful if one algorithm is shared, but also

      * if *some* types share an algorithm, and others share another
      * if the general structure is the same, and different parts depend on different choices (i.e. avoiding combinatoric explosion)
      * if it enables the *user* to more easily interface with the library (on both ends: Automatic type deduction on the calling end, and easy customization or extension through traits templates)

      Also, it enforces a more consistent interface.

    26. Re:That's unfortunate by Anonymous Coward · · Score: 0

      What, you didn't get the C++11 memo? They're pulling lots of Boost into the standard library now.

    27. Re:That's unfortunate by Anonymous Coward · · Score: 0

      Also, it enforces a more consistent interface.

      dogma

    28. Re:That's unfortunate by Anonymous Coward · · Score: 0

      Oh god.. no!! C++ is a language and should be kept as such. Adding things like *any* graphical interface is plain stupid. There are already tons of such api's out there. When you add such a weak library then why should they bother getting a better one? I am asking honestly, because people are lazy by nature.

  4. Bad link in the summary by Anonymous Coward · · Score: 1

    The second link goes to the wrong article.
    Here is the correct link

    1. Re:Bad link in the summary by Rysc · · Score: 1

      I wish I could mod you up. The quality of slashdot stories (and correction speeds) has become rather abysmal!

      --
      I want my Cowboyneal
  5. meh by Anonymous Coward · · Score: 3, Informative

    i sincerely hope cairo itself remains 1. pure c and 2. as a project, entirely unconstrained by complaince to whatever 'standard' these c++/microsofty goons want. if they want to take a snapshot of cairo's api as a model for some c++ api, fine, whatever, couldn't even stop 'em if we tried. though the effort would be better spent finding more active maintainers for cairomm.

    but cairo underlies current versions of major linux gui toolkits. i can't help but view this as some sort of convoluted gambit on microsoft's part to infest it with bureaucracy and c++ architecture astronautism and eventually seize control of the direction or just kill it.

    1. Re:meh by shutdown+-p+now · · Score: 2

      ISO C++ only standardizes APIs, not implementations.

    2. Re:meh by Anonymous Coward · · Score: 0

      MS does not want to make it easy for people to draw things. That's what they do. If it becomes easy...

  6. Wrong link. by Anonymous Coward · · Score: 1

    Link 2 is for a different story.

  7. Please don't by Anonymous Coward · · Score: 0

    I can see the desire to have common UI/graphics/etc capabilities in a standardized form, but why mash this into C++ itself - why not make a new C++ library of some kind that contains these higher level features.

    The way I see it, this is a push to bring C++'s standard library to be more feature aligned with say, the .NET CLR or the standard java classpath - but that's just it, the CLR is not part of the .NET runtime library (mscorlib), it's an additional library - same in Java land.

    This should be part of a "Standard C++ Graphics library" or something, just like the STL isn't part of the standard runtime.

    1. Re:Please don't by shutdown+-p+now · · Score: 1

      just like the STL isn't part of the standard runtime.

      STL is the part of the standard C++ library - has been that way sinco ISO C++98.

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

      nope.
      slist

    3. Re:Please don't by shutdown+-p+now · · Score: 1

      You mean, std::forward_list?

    4. Re:Please don't by Anonymous Coward · · Score: 0

      well i dont actually even know what im talking about

  8. But... why? by zander · · Score: 2

    One of the hallmark problems of design-by-committee is that they extend languages for the sake of doing fun things, not because people need it.

    While everyone needs containers (like vector/hashmap), nobody needs a simple graphics library. There is practically no hardware out there that doesn't have some sort of hardware accelerated graphics and simple operations just make no sense there.

    So, my question really is why they are doing this? I'm betting the answer is not one where they have actual usecases in mind.

    1. Re:But... why? by JoeMerchant · · Score: 0

      If it's in the standard, it should (slowly) become available on any capable platform.

      Write once, run anywhere? Qt doesn't get out much beyond Win/Lin/Mac.

    2. Re:But... why? by phantomfive · · Score: 1

      The main reason is because it's portable. Java has one too.

      --
      "First they came for the slanderers and i said nothing."
    3. Re:But... why? by Anonymous Coward · · Score: 5, Insightful

      So, my question really is why they are doing this? I'm betting the answer is not one where they have actual usecases in mind.

      Firstly, I take issue with your premise that Cairo is no more than a toy and useless in actual work.

      Secondly, One very important usecase for a simple drawing library in the standard is to provide an easy route for novices to write cool, interactive and meaningful programs, without needing to write several hundred lines of scaffolding code and be well-versed in 6 different layers of abstraction from OSes to frameworks and graphics API.

      I don't know how other people learned programming, but in my case, the most engaging things I wrote all those years back in BASIC and Pascal (under DOS) were graphical programs in nature (extremely simple games, GUI-like apps that didn't really need the GUI, function plotting and other graphical toys, etc.) I'm guessing that I'm not unique in the fact that having access to simple, straightforward, inefficient, well-documented, built-in 2D graphics API led me to all sorts of cool experiences in programming and (majorly) determined my pursuit for the rest of the two decades since.

      Now, it is obvious that there will always be more novice programmers than experienced ones, so, I don't see the problem with the ISO C++ committee to explore standardizing such a library. Do you, really? Who is this going to hurt?! For most of us, this is pretty much out of our way, since we either write more serious graphical applications and need platform-specific, performance-oriented APIs that offer much more control and features, or we haven't written anything that needed a 2D immediate-mode graphics API in years. So, I ask the Slashdot readership again, what's wrong with standardizing a simple, straightforward 2D drawing API to help the novices and the occasional non-performance-sensitive drawing needs of the community?

    4. Re:But... why? by Gavagai80 · · Score: 4, Insightful

      Qt doesn't get out much beyond Win/Lin/Mac.

      Qt isn't available for enough platforms because it only runs on Windows, Mac, Linux, Android, iOS, Blackberry, Kindle, vXWorks, BSD, Solaris, Haiku, WebOS, OS/2, Tizen and AmigaOS? Anything that passes the "does it run on Amiga?" test is good enough for me.

      --
      This space intentionally left blank
    5. Re:But... why? by mytec · · Score: 4, Interesting

      So, my question really is why they are doing this? I'm betting the answer is not one where they have actual usecases in mind.

      There was a keynote done by Herb Sutter this past September and at roughly the 57 minute mark of his presentation Keynote: Herb Sutter - One C++ he shows a 15 LOC example of numbers being input and then output sorted. He then said, "We need to get past the VT100 era." He continued saying that the standard C++ program cannot even exercise the abilities of the VT100 which has underscore and bold, etc. Pure, portable C++ code cannot even drive a 1970s era VT100.

      If you continue watching you'll see the point Herb is trying to make and that point may help explain why they are looking to do this.

    6. Re:But... why? by DoofusOfDeath · · Score: 1

      Qt doesn't get out much beyond Win/Lin/Mac.

      Qt isn't available for enough platforms because it only runs on Windows, Mac, Linux, Android, iOS, Blackberry, Kindle, vXWorks, BSD, Solaris, Haiku, WebOS, OS/2, Tizen and AmigaOS? Anything that passes the "does it run on Amiga?" test is good enough for me.

      But can it run on Emacs?

    7. Re:But... why? by ProzacPatient · · Score: 2, Informative

      Unless things have changed I never paid Qt any attention because it is dually licensed and therefore not truly free software and its ownership keeps changing between commercial companies.
      Last I checked Qt is "free" for open source projects but requires an expensive commercial license for anything else.

      wxWidgets on the other hand is licensed under much more liberal terms and not owned by a commercial enterprise looking to make a buck or subject developers to strange licensing schemes.

    8. Re:But... why? by TheRealMindChild · · Score: 1

      BASIC and Pascal of the DOS era wrote to the very standardized and well documented VGA buffer. We don't have that luxury anymore.

      --

      "When life gives you lemons, don't make lemonade. Make life take the lemons back!" -- Cave Johnson
    9. Re:But... why? by Anonymous Coward · · Score: 1, Informative

      Wrong. Qt went LGPL years ago, it's properly free for any kind of software.

    10. Re:But... why? by maztuhblastah · · Score: 4, Informative

      Unless things have changed I never paid Qt any attention because it is dually licensed and therefore not truly free software and its ownership keeps changing between commercial companies.
      Last I checked Qt is "free" for open source projects but requires an expensive commercial license for anything else.

      You last checked about a decade ago, then.

      Here's how it works now (and has worked for a while now): Qt is Free. Not "free", but Free. It's under the LGPL. And the GPL.

      "But it's owned by a commercial company, and they can just close off the source."

      Nope. Still stays open. Back a few years ago, the KDE group got a special concession from Nokia. They set up the KDE Free Qt Foundation; if the commercial owners of Qt (Digia) stop releasing Qt under the LGPL and GPL3, KDE has the right to make the whole thing BSD. Irrevocably. And the agreement stays, even if Digia is sold, bought, etc. Read the link if you'd like to know more.

      Basically, Qt is Free. If the owners ever stop releasing it for Free, KDE gets to release it under an even more Free license.

      Qt has been Free for a while. Qt is still Free. It will remain Free

    11. Re:But... why? by Mr+Z · · Score: 1

      My DOS machine didn't have a VGA buffer, you insensitive clod! And on the machine I had before that, BASIC on my machine didn't even have bitmapped graphics!

    12. Re:But... why? by egr · · Score: 1

      You can do whatever projects you like with Qt (commercial or open source alike). You need to buy a commercial license only if you want to do static linking to the library.

    13. Re:But... why? by Anonymous Coward · · Score: 0

      BASIC and Pascal of the DOS era wrote to the very standardized and well documented VGA buffer. We don't have that luxury anymore.

      The 2D drawing libraries of those days in (e.g.) Borland Pascal or QBasic had nothing to do with the VGA buffer. Also, if you think working directly with VGA latches and its absurd memory model was a "luxury", you're out of your mind (or a glutton for punishment!)

      This is going off into irrelevant tangents, but let me just add this. Considering the variety and diversity of stuff we're doing right now with a GPU, our life (a graphics/game programmer's life) has gotten a lot easier over the past 20 years. Our programming models are simpler, our tools and techniques better, and our specs/APIs/libraries/OSes more useable. Not to mention the (almost) million-fold increase in hardware performance that have rendered everyday graphical tasks mundane and easy (i.e. you don't need hand-optimized assembly just to write an image viewer or GUI.)

    14. Re:But... why? by Anonymous Coward · · Score: 0

      Maybe not, but I bet you could have simulated it on the TI-99/4A by redefining the character bitmaps.

      You could simulate a lot of graphics by redefining character bitmaps and printing the characters at the right spots on the screen.

    15. Re:But... why? by Mr+Z · · Score: 1

      Well, you'd hardly get to VGA quality. You can't even get all the way to CGA resolution. The TMS9918A VDP supported a maximum of 16 colors on a 256 x 192 (sub-CGA) resolution. Furthermore, it had a limitation of no more than 2 colors per 8-pixel wide span (in Graphics II "bitmap" mode). You need a minimum of 24K bytes to support a 4bpp bitmap at 256 x 192, but the TMS9918A VDP could only address 16K bytes. The graphics II mode (with its color limitations) fit into more like ~13K bytes. (6K for the pattern table, 6K for the color table and 768 bytes for the name table.)

      Of course, TI BASIC and TI Extended BASIC didn't offer this mode. For one thing, TI BASIC / TI XB programs got stored in graphics memory, because the console itself only had 256 bytes of CPU addressable memory, and relied over-heavily on the VDP's graphics memory for everything else, including storing BASIC programs, variables, and sprite motion information (on top of the sprite position data that the VDP accessed directly itself).

      From BASIC, you had a subset of the character set that was redefineable. I forget how many characters; I think it was something like 192 in TI BASIC and 168 in TI Extended BASIC, but those numbers are from (faded) memory. So, you could (slowly) simulate bitmapped memory in TI BASIC / TI XB by drawing a small patch of screen (much less than full-screen), and redefining character tiles to simulate bitmaps. It wasn't terribly efficient, because CALL CHAR took character patterns as ASCII strings of hexadecimal digits. Useful for fixed bitmaps, but not for variable bitmaps. If you had a TI MiniMemory cartridge, though, you could use CALL PEEKV andCALL POKEV to do things more efficiently, or write a small assembly routine stored in the cartridge accessed through CALL LINK.

      Not that I'd actually know how to use that old computer.... ;-)

    16. Re:But... why? by Anonymous Coward · · Score: 0

      OK, that made me lol. :)

    17. Re:But... why? by serviscope_minor · · Score: 2, Interesting

      "We need to get past the VT100 era." He continued saying that the standard C++ program cannot even exercise the abilities of the VT100 which has underscore and bold, etc. Pure, portable C++ code cannot even drive a 1970s era VT100.

      Not sure I get that, or, Herb is less knowledgable about VT100s than he is about C++. This will work in a VT100 compatible terminal, like just about any common terminal program:

      std::cout << "\e[1mBold \e[0m\e[4munderline\e[0m\e[5m blink \e[0m\e[7minverse\e[0m text\n";

      Works on xterm. I have a CPU monitor written using xterm, C++ and swallowed by FVWM buttons. It has a 5 character number (up to 100.0) changing about once per second and a much more responsive backgroud colour which goes green to yellow to red smoothly as the load changes.

      It's 100% ISO C++. Of course, it only works on xterm-like terminals.

      Pure, portable C++ can certainly drive a VT100 fully but it won't look good on any other terminal.

      --
      SJW n. One who posts facts.
    18. Re:But... why? by Anonymous Coward · · Score: 0

      Qt isn't available for enough platforms because it only runs on Windows, Mac, Linux, Android, iOS, Blackberry, Kindle, vXWorks, BSD, Solaris, Haiku, WebOS, OS/2, Tizen and AmigaOS? Anything that passes the "does it run on Amiga?" test is good enough for me.

      And HTML5 + JS, of course :)

    19. Re:But... why? by Anonymous Coward · · Score: 0

      One of the hallmark problems of design-by-committee is that they extend languages for the sake of doing fun things, not because people need it.

      While everyone needs containers (like vector/hashmap), nobody needs a simple graphics library. There is practically no hardware out there that doesn't have some sort of hardware accelerated graphics and simple operations just make no sense there.

      So, my question really is why they are doing this? I'm betting the answer is not one where they have actual usecases in mind.

      Because not every piece of software out there requires accelerated graphics but many certainly benefit from advanced SVG ???? Even though an anti alias switch is used for most. If you are rastering music notation for example why do you require gpu accelerations or advanced text it is an overkill situation to say the least. NOT EVERY FREAKING THING REQUIRES high intensity graphics at high frame rates...DOH DUMB AND DUMBER GAME PROGRAMMERS who can't see the forest for the trees posting more fud on slashdot as usual. A really useful SVG lib like cairo should be included in the C++ standard, the inclusion will speed graphic orient program considerably as cairo is definitely the easiest C++ vectoring lib out there to use and the most versatile and stable OSS svg lib out there. One hell of a lot simpler and code efficient than rastering svg in java and .NUT!

    20. Re:But... why? by AuMatar · · Score: 1

      "Write once, run anywhere? "

      Doesn't exist. Its write once, debug, rewrite, fiddle with, and get it 95% working with 90% of the effort it would have taken to start from scratch everywhere.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    21. Re:But... why? by Anonymous Coward · · Score: 0

      MOC makes QT not c++. That's a pretty good reason to stay away from it.

    22. Re:But... why? by satuon · · Score: 1

      I use Qt Creator, and never notice MOC. I know it's there and it does its work, but It has never caused any problems for me.

    23. Re:But... why? by KingOfBLASH · · Score: 1

      M-x qt-mode

      duh

    24. Re:But... why? by Anonymous Coward · · Score: 1

      Pure, portable C++ can certainly drive a VT100 fully but it won't look good on any other terminal.

      I think we have different ideas of what portable means.
      To me portable doesn't just mean "compiles for another CPU", it has to be able to communicate with the rest of the system too.
      In the era when home computers were dominated by Amiga/Atari/Mac you could write your code in 68k assembly and it would be portable between all systems as long as you used a graphics library for your output.
      Even when it comes to pure ANSI-C it is barely portable. Sure, you can get the code to run, but if you write a command line tool you will have to decide on a way to handle arguments that won't automatically compile into something that the users of that particular system expects. (For example DOS and Linux uses different standards here. A DOS user will typically type /? to get the help while a Linux user will type --help.)
      There are libraries that makes argument parsing more portable but they aren't standardized.
      So, if you write code that works on any CPU but requires a VT100 terminal I wouldn't call that portable at all.

    25. Re:But... why? by Anonymous Coward · · Score: 0

      If it's tied to a certain terminal type to work correctly, then it's no longer portable, is it?

    26. Re:But... why? by JoeMerchant · · Score: 1

      Can you say "Epic Troll"?

      Mission accomplished.

    27. Re:But... why? by Anonymous Coward · · Score: 0

      So how would you make portable display code for a device without a display, or one wildly different (try running a teletype with a graphics library)?

    28. Re:But... why? by JoeMerchant · · Score: 1

      I made a "hex editor" back in the '90s that worked with terminal commands like that for color, position, etc.

      Worked great.

      Only if you had the right terminal driver running.

      Least portable thing I've ever put that much work into.

    29. Re:But... why? by Anonymous Coward · · Score: 0

      Easy: you wouldn't. And if you really want to do so, Cairo has other backends than a physical display.

    30. Re:But... why? by Anonymous Coward · · Score: 0

      'You need to buy a commercial license only if you want to do static linking to the library.' - Only if you're making a closed source app

    31. Re:But... why? by tibit · · Score: 1

      I think you don't quite get what "hardware accelerated graphics means". It means that you convert normal human-accessible primitives like lines, polygons, splines, gradients, etc. to discretized geometries accompanied by shader programs. Those are then passed to an OpenGL or DirectX implementation that runs them on a GPU. Even for non-accelerated output, there's still geometry and processing bits that get run on a CPU (or even a GPU) to rasterize the output. Sometimes the intermediate form is passed around (say, a PDF). The "hardware accelerated graphics" you speak of are very low-level and pretty much useless without higher level library support.

      --
      A successful API design takes a mixture of software design and pedagogy.
    32. Re:But... why? by tibit · · Score: 1

      So, you're a troglodyte who thinks code generation is for wimps. Why don't you hand-punch machine code on punched cards, then? I mean, why stop code generation at the level of a C++ compiler? Why don't go all the way down?

      Tell you what: if you want to be less productive, it's up to you. People who know their craft have long ago figured out what is well handled by code generators, and you know, they do use them.

      --
      A successful API design takes a mixture of software design and pedagogy.
    33. Re:But... why? by tibit · · Score: 1

      Not even then. LGPL merely mandates that there must be a way to re-link your binaries to modified Qt binaries. All you need to distribute for a commercial closed-source, statically-linked app is the object files. Heck, you can, you know, pack them into a static archive! Who'd have thought!

      --
      A successful API design takes a mixture of software design and pedagogy.
    34. Re:But... why? by tibit · · Score: 1

      On all platforms, the bits still end up on the screen, and you can still pass a binary bitmap to the platform API to put on the screen. Wouldn't you know, that's what Qt in fact does all the time! For non-Qt-Quick-2 code, Qt uses its own rendering backend (called raster) on all platforms by default, and the entirety of interface between Qt 5's gui module and the OS, apart from synchronization primitives, is bitmaps and I/O+timer events. Seriously.

      --
      A successful API design takes a mixture of software design and pedagogy.
    35. Re:But... why? by Anonymous Coward · · Score: 0

      Absolutely nothing wrong with having a solid, usable 2d drawing api.
      But to include it as a standard component of the C++ language is disingenuous. Don't add junk (ok, "features") to a programming language and mandate them just because a segment of the market could potentially use them. Not every application written in C++ needs 2d graphics support. For example: low-level developer tools such as compilers are frequently written in C++.

      Re: "Who is it going to hurt?"
      I believe the question should be "will the addition help the VAST majority of C++ developers?" Supporting a 2D library as part of the C++ standard is like strapping JATO rockets to a Pig to help make it run faster. Might make some interesting BBQ, but a very strange way to make the pig run faster.

    36. Re:But... why? by Anonymous Coward · · Score: 0

      Implementers of c++ compilers and the c++ standard library have a limited amount of development time, as do we all. Requiring them to implement unneeded features takes away time that could have been spent on things that actually matter. So, you ask who does it hurt? It hurts everyone who doesn't need it. File I/O, common data structures, resource management, error handling and threading are included in the things that most c++ programmers need. But easy 2-d drawing for novices? Not needed. They should either get a non-standard (but portable) library or better yet, not use c++. No programming language should try to satisfy all possible requirements and c++ is not intended to be a good first language.

    37. Re:But... why? by Anonymous Coward · · Score: 0

      You are aware that `\e` is not a standard C++ escape sequence?

    38. Re:But... why? by JohnnyLocust · · Score: 1

      Qt doesn't get out much beyond Win/Lin/Mac.

      Qt isn't available for enough platforms because it only runs on Windows, Mac, Linux, Android, iOS, Blackberry, Kindle, vXWorks, BSD, Solaris, Haiku, WebOS, OS/2, Tizen and AmigaOS? Anything that passes the "does it run on Amiga?" test is good enough for me.

      You forgot qt in a browser: http://vps2.etotheipiplusone.com:30176/redmine/projects/emscripten-qt/wiki/Demos

    39. Re:But... why? by Anonymous Coward · · Score: 0

      Java AWT was an improvement when it came out, but it was quickly overshadowed by better designed APIs. Same thing happened with Swing. And now nobody uses Java to write GUI applications on the desktop, anyhow. And Android, etc, has a completely different API.

      Now if you use Java's "portable" API your application instantly sucks. Tk was a great API (and widely portable, including Tcl, C, Perl, etc), but if you used it everybody thought your application sucked.

      The quickest way for Cairo to become obsolescent will be for C++ to adopt it. However, I suppose the reverse will also be true--the quickest way for C++ to become obsolescent will be for it to adopt Cairo. That's a bonus from my perspective.

      C has survived has long as it has because it's been extremely conservative about language features. C99, for all its great features, bombed. C11 ripped most of them out again. Call me when C++ learns that lesson.

    40. Re:But... why? by Anonymous Coward · · Score: 0

      There's nothing wrong with code generation, if you are honest that your source file is not C++, and it is sufficiently separated from the C++ parts. So "here are your C++ files, and there are your MOC files" would be OK. Not "this is a C++ file, but you first have to run it through MOC". If you first have to run it through MOC, it's no longer C++.

    41. Re:But... why? by MikeBabcock · · Score: 1

      If you have to specify implementation-specific special codes within your data stream then your language doesn't support the thing, your code is doing it.

      std::cout http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/attrib.html

      C++ doesn't understand Unicode strings (which Python now does for instance) and doesn't understand screen resolutions, emulations or graphics either. Do these belong in the standard library? If they're used as frequently as I think they are, I'd say yes.

      --
      - Michael T. Babcock (Yes, I blog)
    42. Re:But... why? by Anonymous Coward · · Score: 0

      It may be free, but it isn't C/

  9. written in C by Anonymous Coward · · Score: 0

    "[Cairo] is written in C and has bindings available for many programming languages, including C++, [...]"

    Haha, the irony. :)

  10. Cairo has API support for PS/PDF, Win32, Quartz by Anonymous Coward · · Score: 0

    Ugh. While these are useful features for an API, why do they belong in a standard library of a general purpose programming language?

    Graphics libraries and their APIs are Here Today, Gone Tomorrow. The hot thing today will most likely be superseded and irrelevant in 10-15 years time.

  11. Broken link by BenO'Shea · · Score: 1

    the "sent out a message to the Cairo developers this week" link above points to the knight's landing page from another story...

    1. Re:Broken link by jones_supa · · Score: 2

      Heh, that's correct.

      Here's the proper link to Herb's post. http://lists.cairographics.org/archives/cairo/2013-December/024858.html

      (You have to flip to 2014 archives to see the full thread.)

  12. standard c++ by mevets · · Score: 1, Insightful

    Is there anything it cannot do?
    The old C++ looks better and better as they nail every bit of crap they can find to her wretched offspring.

    1. Re:standard c++ by DoofusOfDeath · · Score: 1

      Is there anything it cannot do?

      Well, not to the extent that it approximates a Turing machine.

    2. Re:standard c++ by Anonymous Coward · · Score: 0

      Is there anything it cannot do?
      The old C++ looks better and better as they nail every bit of crap they can find to her wretched offspring.

      Really? I like C++, but you remind me of the old joke:

      "Making an object-oriented language by adding classes to C is like making an Octopus by nailing extra legs to a dog."

    3. Re:standard c++ by StripedCow · · Score: 4, Insightful

      Is there anything it cannot do?

      Garbage collection.

      --
      If Pandora's box is destined to be opened, *I* want to be the one to open it.
    4. Re: standard c++ by NicWilson · · Score: 1

      what a load of cobblers ALL other languages are C++ wanna-bes

    5. Re: standard c++ by Anonymous Coward · · Score: 0

      Tell that to smalltalk

    6. Re:standard c++ by phantomfive · · Score: 1

      The old C++ looks better and better as they nail every bit of crap they can find to her wretched offspring.

      Some people were saying that back in the 80s (specifically, Ken Thompson). It's always been the C++ design strategy.

      --
      "First they came for the slanderers and i said nothing."
    7. Re: standard c++ by phantomfive · · Score: 1

      what a load of cobblers ALL other languages are C++ wanna-bes,

      This comment shows the limitations of your own knowledge, not anything about languages.

      Check out APL sometime if you really want to blow your mind. FORTH is something interesting, too.

      --
      "First they came for the slanderers and i said nothing."
    8. Re:standard c++ by Anonymous Coward · · Score: 0

      Uhm... have you ever used C++? The standard library that comes with C++ is extremely tiny. It does almost nothing. Compare to the libraries that come with other general languages like Java, C# and Python. C++'s library needs to grow by one or two orders of magnitude to even reach parity.

    9. Re:standard c++ by suy · · Score: 1

      Is there anything it cannot do?

      Garbage collection.

      C++ does no garbage collection because C++ developers learn how not to produce garbage in the first place. Use proper mutex lockers, smart pointers or file handles, and you won't leak memory, won't miss freeing locks or file descriptors.

      And is not that you need to be a genius to make use of them. Just use, for example, a QFile, or QMutexLocker, and at the end of the scope the resource is freed. Done.

    10. Re: standard c++ by david_thornley · · Score: 1

      Not really, but until 10-15 years ago all other languages were Lisp wannabes.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    11. Re:standard c++ by Anonymous Coward · · Score: 0

      All the language seems to do is attract more garbage :)

    12. Re:standard c++ by Anonymous Coward · · Score: 0


      template<typename T>
      struct SmartAssPtr {
        template <typename... CTOR_ARGS>
        SmartAssPtr(CTOR_ARGS... args)
        {
              ptr = GC.getSingleton().construct(*this, args...);
          }
        ~SmartAssPtr() { GC.getSingleton().die(*this); }

          T* ptr;
      };

      struct GC {
          template<typename T, typename... CTOR_ARGS>
          T* construct(SmartAssPtr<T>& smartPtr, CTOR_ARGS... args)
          {
                MOLEST(smartPtr);
                void* pmem = GIEF_MEMORY( sizeof(T) );
                new(pmem) T(args...);
                return (T*)pmem;
          }

          template<typename T>
          void die(SmartAssPtr<T>& smartPtr)
          {
              ARCANE_MAGIC(smartPtr);
          }
      };

      For the most trivial GC possible, replace MOLEST with a simple reference counter, GIEF_MEMORY with a malloc() and ARCANE_MAGIC with directly destroying the object and free()ing the memory.

  13. As usual, fuck the implementation. by VortexCortex · · Score: 2, Interesting

    Hey let's get a standardized vector and 2D drawing library going! Fuck the hardware or implementation details which indicate you'd be better off not limiting the dimensions to 2. Never mind the fact that we'll be filling triangles on a GPU for any sort of efficiency at all. Nope. Fuck starting at the actual primitives present and working up from there, let's do the top-down approach yet again -- When the performance conscious folks include messed up limitations, like the Diamond Inheritance pattern (Which has no reason to exist, variable placement should be virtual too, dimwits).

    Yeah, I'll stick with C. At least it doesn't pretend to do anything but present the Von Neumann architectural constructs to me and let me build my OOP, etc atop them. It's still not optimal because it has the moronic assumption that functions should be on the stack and not the heap -- thus hindering or outright preventing closures, co-routines, and arbitrarily limiting recursion despite the system's available RAM -- but it's miles beyond C++ in terms of idealic design splattering all over the hard brick wall of reality's implementations. I mean really, if you can't use method overloading properly with templates and polymorphism then the language is broken by design, and there are no complete implementations.

    Hey! I got an idea. You know what would be nice in C++? How about a standardized ANSI terminal interface, like VT100 -- Get ncurses into the spec. Oh! And you know what else? How about RMI! Yeah! Oh oh oh!! I got one I got one! INTER-fucking-FACES for IPC! Yeah! So you could query a program's interface and pass data between processes transparently in a language independent way -- and the doc comments could be lexical tokens too, so that if the .dat file was present even a terminal mode program could query a program's usage without needing a manually constructed manpage, and other programs could implement the same interfaces allowing us to assemble programs from sets of features. You know, something smarter than STDIN and STDOUT and a char**? Something actually fucking useful for a damn change?

    1. Re:As usual, fuck the implementation. by Anonymous Coward · · Score: 1

      Why should the C++ committee jump through hoops to give you paragraph 3, when you already said you'd rather roll your own polymorphism etc on top of C (paragraph 2)? Unless paragraph 3 was meant as total sarcasm, which is possible too. I skimmed it twice and couldn't tell if you were joking or not.

    2. Re:As usual, fuck the implementation. by Jeeeb · · Score: 3, Informative

      Okay you don't like C++, that much is clear but...

      Hey let's get a standardized vector and 2D drawing library going! Fuck the hardware or implementation details which indicate you'd be better off not limiting the dimensions to 2. Never mind the fact that we'll be filling triangles on a GPU for any sort of efficiency at all. Nope. Fuck starting at the actual primitives present and working up from there, let's do the top-down approach yet again -- When the performance conscious folks include messed up limitations, like the Diamond Inheritance pattern (Which has no reason to exist, variable placement should be virtual too, dimwits).

      Cairo is not limited to outputing raster graphics. It also supports vector formats such as PostScript, PDF and SVG. You may be doing the work on the GPU, or the GPU may have nothing to do with it at all. Even for raster graphics, it is not guarnateed that a GPU is even present or the fastest option. Seperation of vector 2D graphics and 3D graphics output is a long established tradition and hardly a design descision of the C++ standards commitee.. They are after all only looking to standardise on an existing C library in widespread use.

      Yeah, I'll stick with C. At least it doesn't pretend to do anything but present the Von Neumann architectural constructs to me and let me build my OOP, etc atop them. It's still not optimal because it has the moronic assumption that functions should be on the stack and not the heap -- thus hindering or outright preventing closures, co-routines, and arbitrarily limiting recursion despite the system's available RAM -- but it's miles beyond C++ in terms of idealic design splattering all over the hard brick wall of reality's implementations. I mean really, if you can't use method overloading properly with templates and polymorphism then the language is broken by design, and there are no complete implementations.

      C++ sure has its warts and I am definitely keeping my eye on Rust and D but what exactly would you consider a good way of handling method overloading + templates + polymorphism, and as a C fan why do you want to introduce such complexity to your code? KISS works well in C++ as well. On a side note C++ does handle the combination of features (http://stackoverflow.com/questions/4525984/overloading-c-template-class-method), albeit it is hardly pretty

      Hey! I got an idea. You know what would be nice in C++? How about a standardized ANSI terminal interface, like VT100 -- Get ncurses into the spec. Oh! And you know what else? How about RMI! Yeah! Oh oh oh!! I got one I got one! INTER-fucking-FACES for IPC! Yeah! So you could query a program's interface and pass data between processes transparently in a language independent way -- and the doc comments could be lexical tokens too, so that if the .dat file was present even a terminal mode program could query a program's usage without needing a manually constructed manpage, and other programs could implement the same interfaces allowing us to assemble programs from sets of features. You know, something smarter than STDIN and STDOUT and a char**? Something actually fucking useful for a damn change?

      If you want IPC abstractions use Boost (http://www.boost.org/doc/libs/1_55_0/doc/html/interprocess.html). Maybe one day these abstractions will be added to the standard library as well. You could also look at platform specific IPC solutions such as COM, which seems fairly close to what you describe. However, until there is a commonly accepted base set of features which can be supported on all major platforms, looking to the C++ standards committe to provide guidance seems very odd to me.

    3. Re:As usual, fuck the implementation. by fisted · · Score: 1

      C [...] has the moronic assumption that functions should be on the stack and not the heap

      Dear Mr. experienced C programmer,
      There is no such assumption in C.

    4. Re:As usual, fuck the implementation. by Anonymous Coward · · Score: 0

      - When the performance conscious folks include messed up limitations, like the Diamond Inheritance pattern (Which has no reason to exist, variable placement should be virtual too, dimwits).

      I have never seen diamond inheritance in my code, if you have encountered then most likely as the result of some messed up library. In case you want to fix your messed up library you can just use virtual inheritance, which is called that way because it makes "variable placement virtual too" and is not the default because 99.999% of classes do not need it.

      Yeah, I'll stick with C

      You should stick with assembly, at least that does not pretend it had anything like static typing or support for fancy newfangled things like string. Avoiding void* and (casts*) is one of the best aspects of c++, right next to having a string library that does not default to buffer overflow and stack corruption.

      c. Oh! And you know what else? How about RMI! Yeah! Oh oh oh!! I got one I got one! INTER-fucking-FACES for IPC! Yeah! So you could query a program's interface and pass data between processes transparently in a language independent way

      C++ just added threads, an actually sane replacement for rand()* and a lot of other things. Since some of these things where adopted from boost you can look there if you can find something that covers your needs.

      * rand() pretends to be pseudo-random, which it arguably is. It has nice features like an undefined algorithm, global state, undefined thread safety (did I mention global state?), a small range and best of all an interface that requires a lot of thought to convert its output into the required range without messing up.

    5. Re:As usual, fuck the implementation. by Anonymous Coward · · Score: 0

      Okay, for starters: drawing triangels only gets you so far. Try to do stuff like smooth antialised Bezier curves with them. It's hard. It can be done within the standard OpenGL graphics pipeline, but it's hard. Filled arbitrary polygons with curved borders are even harder. And that's where cairo just gets started. And you really do want to have those features to draw anything decent that's not projected 3D. That stuff exists for a reason, you know?

      And cairo isn't just a stupid software rasterizer, either. In fact, most of its interface is an abstraction on top of very different implementations for the same features. It can be a software rasterizer, a PS, PDF, or SVG converter, it can be a frontend for Win32 drawing, X11 drawing, OpenGL (ES) (directly hardware accelerated as far as they managed to implement that so far) and various other things as well...

      Besides, the software rasterizer itself is actually very, very fast. It relies on a library of extremely optimized pixel operation functions called pixman. This library contains a lot of hand-written assembler code for a lot of different CPU architectures.

      If anything, cairo is for 2D graphics almost what OpenGL is for 3D graphics.

    6. Re:As usual, fuck the implementation. by tibit · · Score: 1

      In fact, I use an LLVM-based internal port to a micro controller where the usual calling convention puts parameters and return values in static memory locations. Those are laid out in memory by the linker, based on the call tree to facilitate overlapping data of the functions that don't coexist in any path through the call tree. Recursive functions that aren't tail calls are either forbidden, or, if enabled, they then use stack.

      --
      A successful API design takes a mixture of software design and pedagogy.
    7. Re:As usual, fuck the implementation. by Anonymous Coward · · Score: 0

      There is. Please try to allocate your function local variables on the heap.

    8. Re:As usual, fuck the implementation. by Anonymous Coward · · Score: 0

      Not only that, but IBM's C implementation on mainframes uses a linked list of frames allocated from the heap to implement "the stack".

      Most of the OPs rants ring true, though. C is about as close to the optimal level of machine abstraction as you can get, at least until quantum computers come out. Then we're gonna have to rethink a ton of things. Maybe Perl6 will be finished by then.

      C++ has cool features, but so does Perl, Java, or COBOL for that matter. If I want more language features for a project, I tend to skip C++ and go straight for scripting languages. Lua embeds* well in C and gives me closures, coroutines, heap-allocated-stacks, garbage collection, etc. C++ is just a tangle of bad compromises.

      * Lua excels at embedding in C, as well as supporting embedded C. Those are totally different scenarios. Perl, Python, etc, tend to only do well with support for the latter--embedding C inside a large Perl/Python application.

    9. Re:As usual, fuck the implementation. by Anonymous Coward · · Score: 0

      If you want this functionality and your compiler doesn't provide it, you can ask your compiler vendor to offer that. There's nothing in the C standard that forbids it. However chances are that the compiler vendor sees as little value in that option as I do, and therefore won't implement it.

  14. Windows? by Anonymous Coward · · Score: 0

    Cairo graphics? Why tie C++ to Windows 95?

    1. Re:Windows? by Anonymous Coward · · Score: 0

      "Cairo" was actually the code name of a successor to Windows NT which would include an object-oriented file system, a pet topic among researchers in distributed computing in the '90s. Of course that died a horrible death.

      I'm sure the irony of Microsoft (Sutter's employer) proposing another 'Cairo' project has not been lost on Herb.

  15. Windows? by michaelmalak · · Score: 0

    Cairo graphics? Why tie C++ to Windows 95?

  16. Java, C#, and JavaScript all have graphics libs by jmcbain · · Score: 2, Informative

    Java, C#, and JavaScript all have graphics and canvas component libraries. All these libraries render graphics differently on different systems. In the C++ universe, programmers have had to use 3rd-party libs like Qt, so a C++ standard library for graphics is long overdue.

    1. Re:Java, C#, and JavaScript all have graphics libs by Anonymous Coward · · Score: 0

      JavaScript began as, and still is mostly, a web browser programming language, so clearly it needs to support 2D graphics.

      Java also was originally targeted for desktop applications and browser applets. In addition, Java's collection of standard libraries is infamous for being a "kitchen sink" that stifles innovation and seems to vastly increase the length of time it takes for someone to claim reasonable proficiency in Java.

      C# and .NET was just Microsoft's response to Java, just as IE was their response to Netscape Navigator. They had 1000's of developers working for years to make sure it was at least as comprehensive as Java was, only maybe a little bit better with the advantage of hindsight.

  17. Seems like a bit of a can of worms... by Jeeeb · · Score: 1

    Obviously this is early stages, and I am not outright opposed to the concept of having a standard vector graphics library. The creation of formatted documents (pdf) and images is a low level and common task. The productivity of many programmers could be increased by having a standard library which can be easily linked against.

    However I do feel like this opens up a can of worms. Will they also include a FreeType interface to support text output? What backends will be included by default?

    A vector graphics library without the ability to handle text seems seriously crippled. On the other hand choices for including text output basically come down to:

    1. 1. Create a standard interface and leave the actual implementation to be platform dependent. In this case rendering results will differ depending on platform.
    2. 2. Choose one library (FreeType) as the standard. In this case rendering results will look natural on platforms that natively use the library (FreeType) but unnatural elsewhere (e.g. OS-X and Windows)
  18. Unredirected stdin/stdout is itself superseded by tepples · · Score: 1

    Graphics libraries and their APIs are Here Today, Gone Tomorrow. The hot thing today will most likely be superseded and irrelevant in 10-15 years time.

    Glass-TTY interfaces, like the implementations of stdin and stdout in C++ compilers targeting PCs when not redirected to a file or pipe, have for the most part been superseded by GUIs. At least Cairo would provide a starting point toward a bare-minimum image manipulation and GUI component that a C++ program can expect, much as Tkinter does for Python.

  19. C coroutines by tepples · · Score: 1

    One can implement coroutines in C.

  20. You see "implementation-defined" a lot in C spec by tepples · · Score: 1

    Create a standard interface and leave the actual implementation to be platform dependent. In this case rendering results will differ depending on platform.

    C and C++ leave even operations on signed integers implementation-defined, so leaving the precise appearance of text implementation-defined shouldn't be too much of a problem.

  21. I for one by Anonymous Coward · · Score: 0

    I for one welcome our new 2d graphics overlords

  22. Freestanding vs. hosted by tepples · · Score: 1

    the STL isn't part of the standard runtime

    I thought apart from <iostream> and friends, the STL was the C++ standard library. Are you by any chance referring to the difference between a "freestanding" implementation and a "hosted" one, where a "freestanding" implementation is permitted to leave out standard libraries?

    1. Re:Freestanding vs. hosted by AuMatar · · Score: 2

      The STL is *part of* the C++ standard library. Its the various container classes, algorithms functions, etc. There's also iostream, the old C header files, and some new stuff like threading in the C++ standard library.

      Also, not all C++ compilers implement all of the C++ spec (in fact, none of the major ones do, see export keyword). Most embedded compilers leave out the STL, because they don't support templates or do so only partially. Many others require you to separately build and link the STL, and don't by default have it in the runtime (for an example of this, the Android NDK). This is due to be fixed 3 years after the heat death of the universe.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    2. Re:Freestanding vs. hosted by Anonymous Coward · · Score: 0

      Don't forget that some parts of the STL are not in the standard. slist comes to mind.

    3. Re:Freestanding vs. hosted by satuon · · Score: 1

      The only 2 parts of STL that I use, like 99% of the time, is std::string and std::vector.

    4. Re:Freestanding vs. hosted by david_thornley · · Score: 1

      As of C++11, export was removed from the language. It's still an unused keyword. IIRC, both gcc and clang have recently claimed full C++11 support, although they never did have full C++98 support (export). VC++ is adding C++11 and C++14 support, but is not complete on either.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    5. Re:Freestanding vs. hosted by Anonymous Coward · · Score: 0

      std::string is not part of the STL (although an STL interface was bolted on it after the fact, in addition to its original interface, resulting in duplication of a lot of functionality).

    6. Re:Freestanding vs. hosted by AuMatar · · Score: 1

      std::map and std::list get used a lot too (although I do see a lot of lazy C++ programmers using vector where they should use list). Basically everyone uses the container classes, almost nobody uses the rest.

      --
      I still have more fans than freaks. WTF is wrong with you people?
  23. Re: C++ GC by Anonymous Coward · · Score: 1

    Is there anything it cannot do?

    Garbage collection.

    It can, tho. It's not yet in the standard but there are actual garbage collectors for C++.

  24. Watch the video by Anonymous Coward · · Score: 1

    Skip to 1:15:00 and watch Herb Sutter explain why they're doing this stuff.
    http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/C-11-VC-11-and-Beyond

    I hate reading the comments on Slashdot.

    1. Re:Watch the video by Kiwikwi · · Score: 1

      Skip to 1:15:00 and watch Herb Sutter explain why they're doing this stuff. http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/C-11-VC-11-and-Beyond

      I hate reading the comments on Slashdot.

      Mod parent up. Take the 15 minutes needed to understand why this is part of a very interesting and important new development for C++, which can also be seen in the work already slated to go into C++14, namely to improve the C++ standard library to a level where it can compete with newer languages.

      Notably, the goal is not to reinvent the wheel (which is why they're standardizing existing libraries), and portability is a must... which is why you should not expect e.g. a standard GUI library (oh, and people... graphics library != GUI library).

    2. Re:Watch the video by Anonymous Coward · · Score: 0

      Another big laugh at 1:30:45 : they don't want niche uses like Sci/Eng linear algebra but they do want a SMS messaging library in the Standard...
      I think he spent too much time at Microsoft...

    3. Re:Watch the video by Arkh89 · · Score: 1

      Another big laugh at 1:30:45 : so they want a SMS messaging standardized library but they don't want to make a "niche" library for linear algebra in the standard?
      WTF???

  25. Re: C++ GC by StripedCow · · Score: 1

    Conservative ones, yes.
    But accurate ones? Multithreaded? Without "stopping-the-world"?

    --
    If Pandora's box is destined to be opened, *I* want to be the one to open it.
  26. aaa by Anonymous Coward · · Score: 0

    Some people see the design of the C and C++ libraries, where file IO is standard and everything else is system dependent, and then start defending it as if it were some kind of blessed design that shouldn't be changed.

    It's great that they are finally considering adding more capabilities to the standard library. That will greatly help portability.

    If you need to program a microcontroller, C++'s standard library is already too big (files, dynamic memory allocation, etc.), but if you want to make an PC app for end-users, it's too small. I don't see why it coulndn't be expanded.

  27. The JAVA/.NET generation is a fucking disaster. by Anonymous Coward · · Score: 1

    As someone who learnt C then C++ as my first languages, I agree. If there's such a thing as too high level, we're reaching it.
    I'm self-taugh but I know how the metal works and made my own toy OS. Then learning other languages was a piece of cake.
    Languages like C#, Python,etc are so easy it almost feels like cheating.

  28. Re:You see "implementation-defined" a lot in C spe by Jeeeb · · Score: 1

    C and C++ leave even operations on signed integers implementation-defined, so leaving the precise appearance of text implementation-defined shouldn't be too much of a problem.

    Right. Except that is complexity exposed to the programmer and easily dealt with via int32_t, uint32_t .etc. This is inconsistency exposed to the user.

  29. HOAX by Anonymous Coward · · Score: 0

    HOAX

  30. Floating-point types by tepples · · Score: 1

    The implementation-defined precision of floating-point types (float, double, and long double) is inconsistency that could end up exposed to the user if the last significant figure is displayed or if a rounding difference causes an if statement to go one way or the other.

  31. Re: C++ GC by ProzacPatient · · Score: 0

    For me garbage collection is more annoying than its worth.
    Any programmer worth his salt is going to make sure his objects are properly cleaned up anyway regardless of garbage collection, but unfortunately most "programmers" these days don't seem to be worth their salt and consequently high-level languages have to compensate for bad programming practices.

  32. WTF? by Anonymous Coward · · Score: 0

    This is the most asinine idea I hace ever heard of. 2D graphics belongs in a separate library, not part of the language standard. Seriously, I want some of the crazy weed the proposer is smoking.

  33. Re:Uh what? by shutdown+-p+now · · Score: 1

    Since when do libraries become the "standard"?

    Since ANSI C89 standardized things like fopen()?

  34. Re: C++ GC by shutdown+-p+now · · Score: 2

    There was a paper in committee that would make it possible (authored by Boehm, no less). It didn't live to see C++11, though.

  35. Re: C++ GC by Anonymous Coward · · Score: 2, Interesting

    Most modern GC based languages can be faster and reduce memory fragmentation with heavy allocate and deallocate work loads, compared to C/C++. The trade off is less control and more jitter, but the benefit is potentially higher throughput. Without heavy micro-optimizations and essentially your own GC, C/C++ cannot compete.

    What it comes down to is the GC keeps working memory highly compacted in a very efficient way, such that it allows memory allocations to be nothing more than incrementing a pointer. No searching for free space involved. It can also do background compaction while your program is running, and on different threads. These things are less efficient than micromanaging this stuff yourself in C/C++, but the amount of work involved makes it an expensive optimization, which is virtually free in a GC language.

    I'm not trying to say that GC languages are faster in general, but in many common work loads, the GC compensates enough to make a GC language near C/C++ speeds. If I can write a program 5x faster, have fewer bugs, and have it running 80% the speed, that's a win.

    Most of the time, programs are not CPU or memory limited, just limited by bugs and development speed. The more popular programs are actually heavily IO bound. .Net with ASync and tasks will give most other languages a run for their money, it has better scaling than most others. It heavily focuses on reducing context switching and increasing data locality.

    Many C/C++ programs have negative scaling with lots of IO. Once you've hit peak performance, it actually gets slower instead of maintaining current rates.

  36. GUI toolkit on its way in? by croocan · · Score: 1

    Is there also a GUI toolkit such as GTK on its way into ISO C++?

    1. Re:GUI toolkit on its way in? by Anonymous Coward · · Score: 0

      More likely Motif.

  37. Need more than 4 years? by Anonymous Coward · · Score: 0

    I think it takes more than 4 years to turn someone with no experience into a mediocre programmer. Some of that time, best spent away from profs. A bunch of the people going to CS have experience prior college, and it gives them an edge.

  38. Re:You see "implementation-defined" a lot in C spe by windwalkr · · Score: 2

    I think he's referring to signed integer overflow conditions, which don't behave as most people would probably expect and aren't trivial to handle correctly.

  39. Rendering is great by anatoli · · Score: 1

    but how do I interact with the program? Will the new standard include anything like mouse input?

    --
    Industrial space for lease in Flatlandia.
  40. Re: C++ GC by serviscope_minor · · Score: 2

    Most modern GC based languages can be faster and reduce memory fragmentation with heavy allocate and deallocate work loads, compared to C/C++.

    Suspicious sounding statement. Such things are ususally based on writing C++ like java (i.e. new everything). C++ uses stack allocation for very much stuff, and that is free (the pointer increment is already done on function entry) and 100% guaranteed fragmentation free.

    If I can write a program 5x faster, have fewer bugs, and have it running 80% the speed, that's a win.

    Why would C++ be slower to develop? You're confusing garbage collection with "memory management". C++ does memory management very well. I can't recall the last time I had a leak and that's not because I'm super awesome.

    Most mm is just plain invisible in C++, since stuff is deallocated on scope exit. For everything else (nearly) there's reference counting. Reference counting doesn't work if you have general (i.e. cyclic) mutable graphs. I'm not sure I've ever had one of those.

    --
    SJW n. One who posts facts.
  41. Nice one by Anonymous Coward · · Score: 0

    It's just a joke. Isn't it? ...

  42. Re:You see "implementation-defined" a lot in C spe by Anonymous Coward · · Score: 0

    C and C++ leave even operations on signed integers implementation-defined, so leaving the precise appearance of text implementation-defined shouldn't be too much of a problem.

    Right. Except that is complexity exposed to the programmer and easily dealt with via int32_t, uint32_t .etc.

    He said signed integers, not integers in general.

    He's referring to the fact that the following code:
    #include <limits.h>
    int main() {
        int abc = INT_MAX;
        abc++;
        return 0;
    }

    will start World War 3 by launching everyone's nuclear warheads simultaneously.

    The C standard's "undefined behavior" is a load of bullshit on toast that does not even try to restrain the possible results. Does it cause a platform specific interrupt, does it work but produce a garbage value, does it wraparound to negative numbers, does it do any of these three things as defined by the platform hardware? Doesn't even bother to try and restrict the outcomes, at all.

  43. Re: C++ GC by Anonymous Coward · · Score: 0

    Why would C++ be slower to develop?

    Header/Source duplication? Long compile times (pulling thousands of headers each cpp file)? Hard to debug memory corruption issues? Good library design requires that you at least think about ctor, dtor, copy-ctor, operator=,std::move, etc. for every class and mutability/const-correctness for every method - C++ is a very complex language and getting everything right takes time.

    Such things are ususally based on writing C++ like java (i.e. new everything). C++ uses stack allocation for very much stuff, and that is free (the pointer increment is already done on function entry) and 100% guaranteed fragmentation free.

    std::string manages a pointer to the heap (unless your string is "small"), iostreams have a pointer to a buffer object also on the heap, vectors, lists, sets, maps, all have pointers to the heap. We might continue with things like std::function,thread,etc. but you might get the point that taking the c++ standard library as an example of C++ style code quite a bit of your objects reserve memory on the heap - it just ends up managed behind the scenes (RAII) and avoids a single indirection and an increment compared to a good garbage collected language where new is implemented to use a pointer increment.

    C++ code can be optimized quite a bit to have a great speed advantage and you can define classes that do not use heap memory (you can even use custom allocators with a lot of classes) but that is not handed to you on a silver platter unless you only work with simple struct like zero inheritance, fixed sized objects.

  44. There's an ISO standard for 2D graphics already by Anonymous Coward · · Score: 0

    There's an ISO standard for 2D graphics already called GKS. All that's needed is a C++ binding.

  45. Wrong link by Anonymous Coward · · Score: 0

    The link does not point to the mailing list, but to something completely different.

  46. Ditto on the waste of time by bussdriver · · Score: 1

    Rather than make C++ appeal to people who probably should stay in their high level languages, I think they should be putting their time into productivity. As much as I liked to spend time in C++ not writing any actual code playing with macros, templates, etc. in addition to finding new ways to hang myself; I don't find myself doing C++ anymore - I just don't like fooling around enough (yet I still do perl for fun; does that make sense?)

    I think all the man power needs to be put into technical development not fluffy graphics libraries. I'm not as big on portable compiling as I am for some kind of binary format and linking system that would make it easier for an old program to run on a newer OS without needing all these virtual machines. Not exactly Google's NaCl (or whatever it's called) or a byte code but an attempt to address such issues. Not for java style portability, but something so legacy software can run without easily breaking (which it can do even with Java over time) and yes, it would get into OS turf... just like many other languages do as far as how library code is linked and loaded.

    It's been a long time away for me... I've not looked at C++11 but here is a wishlist:
    Text output needs improvement more than we need graphics. More debugging, logging, dummy functions, test case related standardization - more dynamic binding, runtime introspection features and other things that go against the initial design goals but ONLY in limited contexts, such as debugging and testing; thereby, retaining the intent of C++ but unleashing it for development purposes (such as a console or recompiling running code and replacing it.) This would fit in with their trend to be all things to everybody without changing/breaking the past decisions. It would be difficult to implement in some cases; but it's a debug mode.

    I've always wanted named parameters; which could have been handled completely on the compiler side without run time penalty. ADA style typing was always appealing, for some things. How about something like JSON object literals? Native RegExp literals? A built-in parser generator (grammar definitions that produce parsing code you don't need to mess with.) Easier internationalization.... forget drawing lines, give me a great way to print "hello world" in many languages; or localize time and dates. A Money class to avoid common errors (use of float.) Configuration API. Apache's memory pool system seemed cool to me (APR,) garbage collecting not so much. Parallel processing features (if not already some, work on more-- again thinking of productivity and debugging.) We still don't have a multiple level break yet, correct? (like an exception but more limited in scope and as fast as a goto. Don't freak out, I didn't endorse goto.) I wouldn't mind a way to define a graph literal... I assume we must have a String object that handles unicode issues... we didn't last time I touched C++. Unicode source files... that allowed use of math operators like root... which have unicode characters...
    Just ideas... to help bloat the compiler.

    1. Re:Ditto on the waste of time by Anonymous Coward · · Score: 0

      Dude, just go buy a copy of PL/I or COBOL.

  47. Re: C++ GC by satuon · · Score: 2

    I've noticed that regardless of all claims about how Java can be faster than C++, I've never seen Java desktop applications beat C++ at the most important thing - startup time. I'll give you an example with JDownloader - that application takes 10-15 seconds to start.

    Speed perception from the user's point of view is based on startup time and latency. I still haven't seen a Java desktop application that feels responsive.

  48. Re: C++ GC by gbjbaanb · · Score: 1

    its not the GC that allows you to develop faster, its the surrounding infrstructure that does that. Imagien writing your C# code in notepad - you just wouldn't do it, it'd be painfully slow. That's where the development productivity comes from.

    GC can be a huge burden though, not only does it encourage sloppy 'the GC will take care of that' style attitude that hurts performance badly (as prime example consider why there is a StringBuilder class at all, if the GC is so fantastic and fast at memory management). If you need to manage something that is not memory, whatever that is, you start to have to worry quite alot about how to trap and free the resource correctly.

    I recall an old WCF program I wrote, I implemented IDispose correctly in the handler object, yet if anything thew an exception (which I wanted, to pass to the client as a SOAPFault) it wouldn't clean up the server-side state correctly, and the next call would contain a little bit (of logging state in my case) from the previous call. Bummer. Worse bummer - figuring out how to force the GC to correctly finalise my object when I wanted it done. Ended up having to manage all that object lifecycle manually. Manually! It ended up like coding C again and remembering where to put the delete() call.

    So no, GC in the real world is handy, but doesn't increase developer productivity, or code performance (except for benchmarks or simple stuff that don't use it like the real world). Fewer bugs - hardly, you just shift them elsewhere.

    FYI, take a look at Microsoft's SafeHandle class. That shows exactly the problem with GC systems. If you have to create a low-level reference counting class to work around the GC, but the creators of the entire VM, then you know GC is not a silver bullet.

    C++ is better off without it, stick to RAII and be happy.

  49. Re: C++ GC by Anonymous Coward · · Score: 0

    I also never seen a Java application have a snappy user interface. Almost always you click and only after a second has passed a menu appears, or the button animation clicks.

  50. Re:Uh what? by Anonymous Coward · · Score: 0

    Herb Sutter is a retard with no skills? Right...

  51. Re: C++ GC by Altrag · · Score: 1

    StringBuilder exists because the string data type is immutable. It has nothing to do with GC. String concatenation without StringBuilder is a painter's algorithm as it has to keep re-copying the working version of the string for every piece added.

    As for proper clean up with exceptions -- that's what using() and finally{} are for. If you're using an object that implements IDisposable and not properly disposing of it when it goes out of scope (for any reason) then you're doing it wrong.

    Finalizers are also usually the wrong thing to do in C#. The very definition of the language states that they will be called whenever the hell the GC feels like and you definitely should never rely on them being called in a timely fashion. Generally speaking, you can leave managed objects to take care of themselves and unmanaged objects taken care of in a Dispose() method. 99% of the time, the only thing you should use the finalizer for is forcing a call to Dispose() in case whoever is using your class doesn't bother properly disposing of it.

    Yes, Dispose() smells a lot like C++'s delete. That's the way of life -- if you want a guaranteed cleanup then you're going to have do it yourself. There's only so much guessing the GC is capable of. But most of the time you're dealing with regular managed objects and the GC does its job just fine, leaving you to worry about the logic of your program rather than whether or not its leaking memory.

    And yes, there are of course situations where the GC outright doesn't suffice. And the language designers gave us utilities for dealing with those situations when they occur. But I have yet to run into one that didn't turn out to be me just doing something dumb (I came from a C/C++ background myself.)

    You're right -- GC isn't a silver bullet. But its still a hell of a lot easier to write safe code when you only have to worry about object destruction 10-20% of the time. And if you're really stuck, you can force the GC to collect whenever you feel like (of course you take a performance hit for doing that so its generally not recommended.)

    (I suppose the C# team could implement a class attribute to force finalization when an object goes out of scope but I have no idea if that would be a huge performance hit or they just never thought of it or they thought of it and decided they didn't like it or what. Still only solves one small part of the problem in any case though.)

  52. Dumb idea by loonycyborg · · Score: 1

    What's the point of this? cairo is a C library. I guess you could standardize it as part of C2014 or something but just converting its interface to C++ as they say is just pointless. It would result in as much work as would be to make a proper C++ api from scratch and wouldn't necessarily result in as good C++ api as cairo is for C.

  53. Re:You see "implementation-defined" a lot in C spe by Anonymous Coward · · Score: 0

    Please remember C was designed as a system language (on PDPs as well so not exactly lightning fast or with large memory space). I certainly wouldn't want the overhead of limit checking in my OS, not to mention what it should then do if there is an error in the kernel. Incidently if you are that worried you could parse the file and insert assert statements but this would unsurprisingly slow the code.

  54. Yeah, ok, just as long as you can turn it off by RogueWarrior65 · · Score: 1

    My problem with this is how do you build a compiler from sources for a faceless embedded platform. I'm currently seeing this play out in the Qt environment. There are a lot of nice non-GUI features to it but I have yet to be able to cross-compile v5.x of the thing for an embedded ARM platform that has no display, keyboard, or mouse. 4.8.5 works fine but Digia changed a bunch of stuff in 5.x and now I'm SOL.

    IMHO, something like drawing should be compartmentalized into a library.

    1. Re:Yeah, ok, just as long as you can turn it off by tibit · · Score: 1

      I don't know what your problem is, since Qt 5 actually makes it easier than Qt 4! That's my experience, at least. Heck, I've been able to get Qt 5 core to run on Zilog's ZNEO. It even performs OK for a proof of concept, and that's practically a platform that runs at 10MIPS and has a 24 bit address space. I use a custom LLVM port to compile it. I need to do more work on cross-module constant propagation to get it to be where I want it to be, but it runs and is usable. And it all runs on bare metal, no OS.

      --
      A successful API design takes a mixture of software design and pedagogy.
    2. Re:Yeah, ok, just as long as you can turn it off by RogueWarrior65 · · Score: 1

      I was trying to build it with a GNU OABI compiler for an ARM SBC. Sadly, that SBC uses a crappy Cavium processor which doesn't support thumb instructions so I'm stuck with OABI. That said, I've been able to cross-compile Qt 4.8.5 but I couldn't get 5.1 to build. Lots of make/compile/link errors.

    3. Re:Yeah, ok, just as long as you can turn it off by Anonymous Coward · · Score: 0

      IMHO, something like drawing should be compartmentalized into a library.

      Don't worry, they'll not change the language to include graphics. They'll add it to the standard library.
      And I'm pretty sure they'll not add it to the list of things free-standing implementations need to support, therefore you'll not need to figure out how to implement it on your toaster.

  55. Re: C++ GC by Anonymous Coward · · Score: 0

    .Net doesn't really have this issue. I was a fan of Java when it came out, but it turned out to be a huge bloated security hole. At least it really is "compile" once, run almost anywhere compared to .Net.

  56. c++ is a programming language, not an o/s by advance-software · · Score: 0

    competent c++ programmers are quite capable of selecting and/or building the graphics APIs we wish to use.

    higher level languages/environments provide built in graphics support where deemed appropriate.

    c++ is metal. we're not pop. please don't bloat.

    - steve.

  57. Re: C++ GC by angel'o'sphere · · Score: 1

    When I start a Java application it usually runs for weeks if not months (until a system update requires a reboot).
    I don't really care if it takes 5, 10 or 120 seconds to start up.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  58. Can't wait! by Anonymous Coward · · Score: 0

    The resulting incomprehensible, overengineered library ought to be worth a laugh, if it ever gets standardized. Will they use their own bloated language to draw graphics at compile time using template metaprogramming? Will they use their own bloated I/O framework to create I/O streams for 2D matrices? Ought to be good!

    The code will probably look something like:

    #include"std2d" // can't use angle brackets as input
    #include"std2dio"
    #include"std2dxfrm"
    2dout matrix2 != std2dxfrm::brgtn(20) = std2d::clrblack + display3;

    1. Re:Can't wait! by Anonymous Coward · · Score: 0

      Slashdot doesn't like C++. There's something zen about that! Line of code ought to start with: "2dout angle-bracket angle-bracket matrix2 ...etc..." like the C++ scope resolution operator or whatever they call their I/O double-angle-bracket thing.

    2. Re:Can't wait! by Anonymous Coward · · Score: 0

      whatever they call their I/O double-angle-bracket thing.

      That would be the "bit shift operator", of course. I love how the C++ language standard allows you to override the behavior of an operator but not its precedence, because who would want to change that? You would only need to do that if you were doing something brain-dead with the semantics, of course. Then the standard library does exactly that. Let's throw in a quick debugging output to tell us if our status is bad:

      std::cout << status != STATUS_ERROR;

      There's a nice C++ trick question. Almost as funny as the well-defined behavior that happens when your destructor calls something that throws an exception during stack unwinding from another exception. Or all the code that runs in undefined order before main() is called. Or... but the deep, inherent flaws in C++ are well known by now, I'm sure, and plenty of people are getting +5 upmods for declaring that they build character.

      (By the way, you can get the angle brackets on Slashdot by using the HTML escape code - &lt;).

  59. Popcorn please by genocitizen · · Score: 1

    I kinda' missed these flame wars..

    1. Re:Popcorn please by captjc · · Score: 1

      Only in slashdot could adding a graphics library to the c++ standard be derided as one of the greatest tragedies to befall mankind.

      Just like the good ol' days, eh?

      --
      Slow Down Cowboy! It's been 1 hour, 47 minutes since you last successfully posted a comment
  60. Re:Uh what? by Anonymous Coward · · Score: 0

    That's a strawman.

  61. Yeah well by Anonymous Coward · · Score: 0

    If self-documenting code is so important, then why do people not use Ada instead of C++?

    1. Re:Yeah well by Greyfox · · Score: 1
      it's probably because you can still easily revert back to plain old C in your C++ code. And it's easier to find people who can read C than people who can read Ada. As I recall, Ada's objects are limited compared to C++'s (It's been a couple decades since I looked at the language.) The old C standard library gives you full control of the system, at least on a UNIX system. For me at least this is a big selling point. Between boost and the C++11 update to the standard (Which more or less copied a lot of things I use regularly from boost into the language,) it's become a really nice language to use. The level of control it gives you over object lifetimes alone makes it well worth another look.

      The only thing I really miss in it right now is C++ integration of some of the old language constructs. Most notably, I'd like to be able to create a stream from a file descriptor or a FILE pointer. That's pretty much how I do all my IPC. Currently I work around it with an object that contains GNU-specific code for that purpose, but it really seems like something that's missing from the language.

      --

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

  62. Re:You see "implementation-defined" a lot in C spe by tibit · · Score: 1

    Undefined behavior doesn't mean implementation-defined behavior!! Don't use them interchangeably!

    --
    A successful API design takes a mixture of software design and pedagogy.
  63. Re: C++ GC by Anonymous Coward · · Score: 0
    Stack allocation is fine if you plan on not using those objects one you leave scope, but you can't use stack allocated objects in other contexts or even in the parent scope without eventually trashing the data. GC brings stack style allocations to the heap.

    Most mm is just plain invisible in C++, since stuff is deallocated on scope exit. For everything else (nearly) there's reference counting. Reference counting doesn't work if you have general (i.e. cyclic) mutable graphs. I'm not sure I've ever had one of those.

    Many people say GCs free you from thinking about memory management, but it doesn't. It just makes it slightly simpler to handle your common case, but it also gives you a great tool to blow your foot off with when you're trying to figure out how your GC language is "leaking" memory. Another great example besides your circular references is referencing an object in the body of an anonymous method that is assigned to an event handler. += event handlers and adding more anonymous methods is a great way to keep objects referenced.

    Speaking about mm, I semi-recently got to work on a program that was allocating and deallocating about 3GB/s. They were doing a lot of string concatenation and not using string.builder or their own buffer. uhggg.

  64. Re: C++ GC by Anonymous Coward · · Score: 0

    I recall an old WCF program I wrote, I implemented IDispose correctly in the handler object, yet if anything thew an exception (which I wanted, to pass to the client as a SOAPFault) it wouldn't clean up the server-side state correctly, and the next call would contain a little bit (of logging state in my case) from the previous call. Bummer. Worse bummer - figuring out how to force the GC to correctly finalise my object when I wanted it done. Ended up having to manage all that object lifecycle manually. Manually! It ended up like coding C again and remembering where to put the delete() call.

    Sounds like you were not follow best practices. IDispose should never do anything that can cause exceptions and is meant to be used to allow managed code to interface with unmanaged, so it makes sense that it's a lot like C. While you can call IDispose directly, you can't always guarantee that IDispose will be called, if ever. The primary use case for IDispose is to let the GC decide when to call it, but you can call it directly if you want to speed up some of the process. The finaliser is not guarenteed to ever be called during the life time of the program, except during shutdown.

  65. Re: C++ GC by Anonymous Coward · · Score: 0

    Good library design requires that you at least think about ctor, dtor, copy-ctor, operator=,std::move, etc. for every class and mutability/const-correctness for every method

    No. Good library design means that you do not have to think about dtor, operator=, std::move etc. for 99.9% of your classes, because the compiler generated ones do the right thing. If they don't, unless it's a class specifically written for resource management, it just is a sign that there's something wrong with your class design.

    And any halfway competent C++ programmer doesn't generally need to think about const; it's almost always obvious where to put it. There are some very rare corner cases, and there's the problem of interfacing with libraries which are not const-correct (but the latter is just a matter of putting const_cast on the right places).

  66. Re: C++ GC by Anonymous Coward · · Score: 0

    Reference counting has a performance penalty over tracing GC. Modern GC implementations like C4, Collie and Immix are really, really fast although they still need up to twice the memory of the theoretical perfect allocation strategy. You can code around it by, e.g. using stack allocation but typical C++ does a lot of copies that would be unnecessary in a GC language. The biggest issues with GC are the reduction in locality of access (the GC threads need to walk the heap to find garbage) and the less predictable pause times. Overall it's program dependent and if you put enough time into it you can always do better than the machine.

  67. Re: C++ GC by Anonymous Coward · · Score: 0

    There's reference-counting garbage collection in the standard now. You're just not allowed to call it "garbage collection" around C++ weenies, because it offends their unearned sense of superiority. This leads to them making hilarious statements like "we don't need garbage collection because we have shared_ptr".

  68. Re: C++ GC by satuon · · Score: 1

    Well, that's not what I do. I never keep an application open after I'm done with it - mostly because it clutters my taskbar. Btw, are you talking about desktop applications, or server applications?

  69. Re: C++ GC by angel'o'sphere · · Score: 1

    Desktop in this case ...
    I have only a Jenkins as "server" on my laptop.
    I keep most apps pinned to the taskbar anyway, so it looks very similar regardless if the applications are running or not.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  70. Re: C++ GC by satuon · · Score: 1

    This is the link that inspired my comment btw - http://programmers.stackexchange.com/a/409/31462

  71. Re: C++ GC by angel'o'sphere · · Score: 1

    Yes, Java programs often have a slow start up.
    But often there is a reason, which is not Javas fault but the programmers.
    E.g. Eclipse, a wildly used Java IDE.
    The first thing eclipse does when started is opening a workspace, a directory holding lots of projects, opening those projects and figuring if "they are up to date".
    Other IDEs simply show the GUI and then use a background thread to "investigate" the projects.
    It is not Javas fault that reading gazilion of megabytes of source code slows down the start up of Eclipse.
    It is the braindead philosophy how Eclipse works. It would be similar slow in any other language.
    Imagine Microsoft Developer Studio would not start showing its GUI until it has compiled/built all projects. That would be nonsense, too.
    Hence, I rarely close my Eclipse. I just keep it running, after it started it is a well behaving citizen eating zero CPU.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  72. Re: C++ GC by Anonymous Coward · · Score: 0

    No searching for free space involved. It can also do background compaction while your program is running, and on different threads.

    For this to be possible, in any language, The language has to insert some kind of barrier before every dereference to block the thread if a reference is currently being compacted. This sort of thing is possible in C (if it's possible in Von Neumann, it's possible in C, if it's not, it's not possible in any language), but you need to have a very efficient way for eliding dereference barriers when a memory compaction is not in progress. I haven't seen such an efficient eliding barrier in any language or GC implementation, they usually just impose a penalty on EVERY access to a dynamic storage object, or, and this is far more common, they "stop the clock" and pause every other thread while the compaction is running.

  73. Re: C++ GC by satuon · · Score: 1

    Yes, I've wondered if part of the problem is that the Java community is taught that productivity trumps performance. I mean the language advertises that its goal is to make it easier to write code by not thinking about speed.

  74. Really competent programmers ... by krischik · · Score: 1

    ... will appreciate readable programming languages. Only pseudo competent programmes too full of them self to see there own weaknesses want to use unreadable languages. And those pseudo competent programmes are an even bigger disaster then then JAVA/.NET generation because they brought us all the buffer overruns malware uses to attack our computers.

    BTW: Java is not all that readable either.

  75. PL/1 by krischik · · Score: 1

    Has there even been a full featured PL/1 with all optional features in place? I don't think so. And most C / C++ are not full featured either.

  76. Re: C++ GC by angel'o'sphere · · Score: 1

    This is not something that is taught to "the Java community", it is in general taught to every CS student.
    The reason is simple:
    a) you can always optimize a finished solution, but if there is nothing finished you have nothing to work with
    b) development time is expensive
    c) hardware is cheap

    All this are no reasons to actively build inferior solutions.

    However:
    in the time a Java programmer has done his first window and its first menu a SmallTalk programmer already has a visual prototype and the C programmer is still fixing typos after his second "make run", Yeah, I'm exaggerating, but you get the idea :D

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.