Teaching C++ WTF.



  • @davedavenotdavemaybedave said:

    No, you're just so stuck on the elitist principles of obfuscation and mysticism that you can't imagine any middle-ground between sentient, self-programming computers and the rocks we're banging together at the moment.

    *sigh* There's no reason C++ code (or any other language) has to be shrouded in obfuscation and mysticism. Do you claim that CPAs are shrouding their field in obfuscation and mysticism merely because they require potential CPAs to prove they know what they're doing? Of course not; that's merely common sense. You don't have someone audit your company's finances if they have to look up every step; you hire someone that knows what they're doing instead.

    Of course, I haven't even mentioned the economic disaster you two seem intent on creating. Hint: there's a reason economies flourish when people are allowed to specialize. Go take Econ 101 at your local college. There is absolutely nothing wrong with ensuring that people who specialize in a field aren't going to do more harm than good.

    Let me try that again: there's no reason why programming can't become graphical and easy to understand, in much the same way that graphical desktop environments replaced the command prompt and enabled mass access to everyday functions of PCs.

    I'm not opposed to simpler programming languages. I'm opposed to flooding the software industry with even [i]more[/i] ignorant simpletons. No matter how "easy to use" you make a programming language (whatever form that takes), the average user will write sucky programs. That's the way it is.

    Syntax and vocabulary are unnecessary obstacles.

    No, you're just shifting the problem elsewhere. If it's a graphical language, you still have to understand which doodads make sense next to other doodads.

    @Heron said:
    They were only considered "physically impossible" because people didn't understand physics. You're only proving my point.
    I'm not following you. How does that prove your point, rather than proving your point wrong in the way I said it was when I said precisely that?

    Because if [i]everyone[/i] were ignorant of everything, as appears to be blakeyrat's goal (he stated that knowledge is better kept in a computer than in people's heads!), then we'd have people shouting "that's not possible" all the time about pretty much everything, because it doesn't fit with their worldview.

    I seriously cannot believe you're arguing that complete ignorance is a better ideal than complete knowledge.
    No-one's arguing that. You just made that bit up.

    Blakeyrat did; he quite explicitly stated that knowledge is better kept in a computer than in a person's head so as not to "waste" brain cells. (Of course, the opposite is true: a person who doesn't bother to learn anything, instead insisting that he can just look everything up, is the one [i]really[/i] wasting brain cells.)



  • @Heron said:

    @blakeyrat said:
    You're much better off creating programming languages that most people can use.

    I would argue that you're much better off getting those people to go into another profession. If they don't care enough to *really* learn programming, but still getting programming jobs, then they're lowering wages for those of us who do merely by continuing to compete with us in the job market. Making an easier-to-use language won't fix that... again we'll cite Visual Basic. It's better to get them to switch to something they will care about, and get them to stop competing for our jobs.

    There's a reason other professions have actual certifications and tests to pass before you can really work in their industries. You don't have to take the bar exam to be a lawyer because they like having an exclusive club, it's because they want to make sure you actually know what you're doing. You don't have to take the CPA exam to get a CPA certification and thus get the good accounting jobs just because CPAs like having an exclusive club, it's because they want to make sure that the people doing audits actually know what they're doing. Programmers need a similar program, because clearly universities aren't weeding out the crappy programmers well enough.

     

     Even the best of the best programmers make errors.  Quite often, in fact.  A language that can detect the most common types of errors is a lifesaver (sometimes literally).  It's not just a matter of people getting so good they never screw up -- nobody on Earth is THAT good.  It's all about designing to minimize errors.

     I write software for the medical industry.  Large portions of our code are decision support, partially because it can make it faster for physicians (e.g. a diabetic patient's office visit may recommend a glucose test and allow one-click ordering) but also because physicians sometimes make mistakes, and every allergic reaction or missed test or whatever that we catch before it's too late is one person who has a better outcome because of it.  It's not that we don't expect physicians to be intelligent, capable doctors -- of course we expect they are -- but even the best doctors miss things, and if we can catch them, we should bring it to their attention.

     So I'd say that language features to detect or prevent errors benefits everyone -- the good and bad alike.



  • @Heron said:

    @davedavenotdavemaybedave said:

    Blakey's absolutely spot on, in my opinion. In an ideal world, anyone who could tell you what a program should do would be able to write it.

    You're asking for a computer that understands English, with all its contextual meaning, as a programming language. Sure, that might be ideal, but that's completely unlike "programming" as we know it, so much so that I don't know that I'd call it "programming" at all, at least no more than a CEO is "programming" when he tells his dev team to "give me an action shooter based on Lord of the Rings".
    You may have read his reply wrong.  99.9% of people can't tell you precisely what a program should do in their native language.  For those 0.1% who can, programming shouldn't be a second hurdle.  Most people who have problems with programming have difficulty expressing their needs precisely, the syntax is usually the easy part.

    I've actually had experiences working with other programmers where the following exchange has taken place:

    <them>: My program won't work, it is giving me the wrong output.
    <me>: What this function supposed to do?
    <them>: Calculate the {insert business-specific metric here}.
    <me>: What's the algorithm?
    <them>: I don't know.

    I wouldn't fault anyone for not knowing an algorithm, but I do fault them for blaming the program for not working when they aren't even sure what it should do.  Too many programmers simply program by trial-and-error.  Simply keep tweaking the program until the sponsor says it's working properly.



  • @Cat said:

     So I'd say that language features to detect or prevent errors benefits everyone -- the good and bad alike.

    I agree... but that doesn't mean $LANGUAGE is always the wrong tool for the job ;)



  • @Jaime said:

    You may have read his reply wrong.  99.9% of people can't tell you precisely what a program should do in their native language.  For those 0.1% who can, programming shouldn't be a second hurdle.  Most people who have problems with programming have difficulty expressing their needs precisely, the syntax is usually the easy part.

    That's fair enough, but now my objection is this: if a person cannot express what he or she wants the program to do in his or her own native language, then no amount of user-friendliness on the part of a programming language is going to help them figure it out.

    I wouldn't fault anyone for not knowing an algorithm, but I do fault them for blaming the program for not working when they aren't even sure what it should do.

    I fully agree with you there...



  • @Cat said:

    Even the best of the best programmers make errors.  Quite often, in fact.  A language that can detect the most common types of errors is a lifesaver (sometimes literally).  It's not just a matter of people getting so good they never screw up -- nobody on Earth is THAT good.  It's all about designing to minimize errors.
    So do accountants, doctors and lawyers, what's your point? Heron's argument is that having an exam like the bar exam for lawyers would reduce the amount of shit that gets churned out.@Cat said:
    So I'd say that language features to detect or prevent errors benefits everyone -- the good and bad alike.

    Those languages exist. They are significantly slower than C and C++ and thus have different uses than those languages. C++ isn't supposed to be a high level language, it's an intermediate, stop comparing it to high-level languages.



  • @Heron said:

    No, I'm not talking about knowledge in general, I'm talking about field-specific knowledge. You're the one claiming that everything should be simple enough that everyone can do everything. I'm all for creating tools so that people don't have to know everything to get on with their lives; but if someone is going to make a living in a particular field, they had better understand the fundamentals of the field.

    Ok, we get it. You don't know what the word "ideal" means. You have absolutely zero imagination, and no ability at all to conceptualize a world different from the one we're currently in.

    I'm not going to bother to reply to you on this topic any more, since you just really are simply NOT GETTING THE CONCEPT here.

    @Heron said:

    You mean the part that disqualifies a file manager as "spatial" merely for possessing the capability of functioning in some other way?

    Where to fucking start. No, I don't mean that part.

    Look, here's the bullet points:

    @Wikipedia said:


    1. A single window represents each opened folder.

    2. Each window is unambiguously and irrevocably tied to a particular folder.

    3. Stability: files, folders, and windows go where the user moves them, stay where the user puts them ("preserve their spatial state"), and retain all their other "physical" characteristics (such as size, shape, color and location).

    4. The same item can only be viewed in one window at a time.

    Does Windows Explorer's "open each folder in a new window" mode meet criteria 1? No; you can easily open the same folder in multiple windows. Does it meet criteria 2? Actually... the answer on this one is "maybe." But it's iffy. Does it meet criteria 3? Not even close; Explorer doesn't preserve shit for state. Does it meet criteria 4? Nope; as I pointed out with criteria 1, you can open the same folder in multiple windows and thus view the same icon in multiple windows.

    Therefore, Windows Explorer has no spatial mode. Which is fine, because Microsoft has never *claimed* that "open each folder in a new window" was a spatial mode.

    @Heron said:

    Or perhaps the part of the definition which makes it extremely difficult to use with a hierarchical file system? (closed one of your two dozen folder windows by accident? good luck remembering which one it is, or the path to it so you can open it again.)

    First of all: I'm talking about file *browsers*, not file systems. You can use a spatial file browser with a hierarchical file system. (In fact, Mac Classic was exactly that.) I'll just assume when you say "hierarchical file system" you mean "browser-like file browser" (that is, a file browser with a back/forward/up button, where different folder contents fill the same window.)

    Secondly: you don't need to keep the entire history of folders open when you navigate to a specific one. In the old Mac Classic system, if you held down Option (IIRC, it's been a long time) when opening a new folder, the old folder closed. Additionally, you can (again, IIRC) Command-Click the title of the folder to see a breadcrumb list of parent folder, and open one by selecting it from the list.

    Thirdly, finding a parent folder is not a common task, and not one that needs to or should be optimized for.

    @Heron said:

    The mode I pointed out is effectively spatial mode, for most intents and purposes, but works better with hierarchical file systems.

    No, it's not. It maybe meets one of the 4 requirements. And again: Mac Classic, with it's beautiful spatial file browser, was build on top of a hierarchical file system.

    @Heron said:

    If you want to argue that hierarchical file systems need to disappear, then argue that, don't argue that people should continue to use and maintain a tool not meant to be used with hierarchical file systems.

    There's no reason the two file browsers can't co-exist in the same OS at the same time; or even on the same desktop at the same time. They just don't because the kind of geeks who program file browsers simply do not understand spatial memory, or how to take advantage of it. Why is that? Because geeks are a very, very small minority who are better at the rote memorization required to navigate a browser-type file browser. (Even that's not accurate; they're probably no worse at spatial than the average person, they just don't hate rote memorization like the average person does.)

    Anyway, I'm done here. It's obvious Heron has absolutely no idea what he's talking about on any level. Nor does he have the capacity of read and comprehend a post before replying. I give up.



  • @Lingerance said:

    Those languages exist. They are significantly slower than C and C++
     

     That's not necessarily true anymore; JIT-compiled languages have the potential to be comparable in speed to native code (~90% or more of the speed).  Plus, for more and more applications, speed is becoming less and less of an issue -- CPU cores have advanced far faster than the tasks we're asking them to perform.  The number of applications that actually have a CPU bottleneck these days is relatively small.



  • @Heron said:

    That sounds absurd applied to tons of other professions. Financial auditing should be easy enough that anyone can do it! (It's not.) Skyscraper architecture should be easy enough that anyone can do it! (Hah!) Cancer research should be easy enough to anyone can do it! (There's a reason we haven't cured cancer yet...)

    Seriously though, programming is not easy; there's a reason most programmers suck at it, and it has nothing to do with what language they're using. Designing nontrivial software is beyond the mental capacity of a large portion of the population... worse, designing trivial software is beyond the mental capacity of many.

     

    Funny you should mention sciences.  There's a famous story in physics that this argument reminds me of.  After quantum mechanics was initially developed in the ~'30s, and was being extended to quantum field theory in the '40s, there was one notoriously difficult formulation of the theory called "canonical quantization" which required some laborious algebraic (as in, abstract algebra algebraic, not high school algebraic) computation, which required quite a lot of experience and skill to get anything correct and meaningful from.  In the late '40s, Feynman came along with his path integral formulation of quantum field theory, which totally trivialized lots of the old, laborious calculations.  It was commented (not seriously) by one of the big names in the field at the time (I can't remember who offhand) that this development was unfortunate, because now any idiot could do quantum field theory!  Most theories and models, by the way, are now exclusively developed the "easy" way and this has caused an explosive growth in the cool things we can do with field theory--including applying it to condensed matter physics to get all the cool solid state technology we have now.

    The point of the story?  Quantum mechanics is so easy I learned it in high school. Quantum field theory (typically a graduate class) is so easy I taught it as an undergrad.  Is that because I'm brilliant?  Yes.  But the reason the people I taught it to could understand it is that someone else trivialized it.

    Making hard things easy makes really hard things only tedious, and impossible things only hard.  In the 1940s no one would have thought it possible that a kid would teach other kids quantum field theory, because it's so hard only a subfield of the smartest specialists can do it.  Now those kids can get a head start on the topic and spend their time solving interesting, new, problems with established tools. They could do this because the tools are now-a-days so easy anyone can do it.

    It's just stupid to argue that languages should not be made easier, and that hard languages should not be depreciated.  A physicist looking at a lot of older papers will find them very confusing, because old, outdated, bad, and overly complicated ideas are mercilessly removed (although sadly bad notation is often not... but the bad ideas are).  In fact, this happens in all of science, this is how it progresses.  If you don't believe me, pick up The Principa, and then pick up an intro textbook in physics: same topics, massive difference.

    Things need to be made as easy as possible so that the impossibly difficult things turn into possible things.  The only reason someone can legitimately say "C++ is the best choice" for a lot of projects is because it is the only choice.  That doesn't make it a good choice.  Until fairly recently, there were few alternatives for modern computers that could do what it could.  C++ will not "always" be the best choice for some topics, any more than a philosophical treatise on the vis viva's essence in terms of fluxions is ever the best way to think of any problem in physics.



  • @cfgauss said:

    @Heron said:

    That sounds absurd applied to tons of other professions. Financial auditing should be easy enough that anyone can do it! (It's not.) Skyscraper architecture should be easy enough that anyone can do it! (Hah!) Cancer research should be easy enough to anyone can do it! (There's a reason we haven't cured cancer yet...)

    Seriously though, programming is not easy; there's a reason most programmers suck at it, and it has nothing to do with what language they're using. Designing nontrivial software is beyond the mental capacity of a large portion of the population... worse, designing trivial software is beyond the mental capacity of many.

    (awesome stuff)

    cfgauss, post here more often.



  • @blakeyrat said:

    Ok, we get it. You don't know what the word "ideal" means. You have absolutely zero imagination, and no ability at all to conceptualize a world different from the one we're currently in.

    On the contrary, I just fundamentally disagree about what is ideal, because you don't seem to realize that what you call "ideal" is a fundamentally stagnant society. A world where nobody bothers to learn anything (instead always looking things up in a computer) will not advance at anywhere near the rate our current society progresses, [i]if it even progresses at all[/i]. I'm not the first person to point this out. Off the top of my head I can think of at least four Star Trek and Stargate episodes on this very subject.

    @Heron said:

    You mean the part that disqualifies a file manager as "spatial" merely for possessing the capability of functioning in some other way?

    Where to fucking start. No, I don't mean that part.

    Look, here's the bullet points:

    @Wikipedia said:


    1. A single window represents each opened folder.

    2. Each window is unambiguously and irrevocably tied to a particular folder.

    3. Stability: files, folders, and windows go where the user moves them, stay where the user puts them ("preserve their spatial state"), and retain all their other "physical" characteristics (such as size, shape, color and location).

    4. The same item can only be viewed in one window at a time.

    Does Windows Explorer's "open each folder in a new window" mode meet criteria 1? No; you can easily open the same folder in multiple windows. Does it meet criteria 2? Actually... the answer on this one is "maybe." But it's iffy. Does it meet criteria 3? Not even close; Explorer doesn't preserve shit for state. Does it meet criteria 4? Nope; as I pointed out with criteria 1, you can open the same folder in multiple windows and thus view the same icon in multiple windows.

    Therefore, Windows Explorer has no spatial mode. Which is fine, because Microsoft has never *claimed* that "open each folder in a new window" was a spatial mode.

    First of all: I'm talking about file *browsers*, not file systems. You can use a spatial file browser with a hierarchical file system.

    You can, but it will be suboptimal, [i]as I already pointed out[/i]. File browsers are inherently limited by the file system they represent; in this case, the potential depth of a hierarchical file system (i.e. every mainstream filesystem in use today) makes spatial file browsing problematic. Suppose you've opened a window six levels deep in the filesystem, and you accidentally close it; you now have to start over at the root (or maybe deeper, if you're lucky enough to have another window open along that path) and hope you remember the path. I'm not saying spatial file browsing is invalid; I'm merely saying it's suboptimal for hierarchical file systems.

    Thirdly, finding a parent folder is not a common task, and not one that needs to or should be optimized for.

    Oh? My wife does it all the time looking through all the photos she has taken. I do it all the time merely looking through my documents. I don't claim to be the model of common usage, but you shouldn't either. As I pointed out before, Microsoft didn't settle on their current file browser on a whim; they figured out what most users want, and did that. Do you have evidence to the contrary?

    Anyway, I'm done here. It's obvious Heron has absolutely no idea what he's talking about on any level. Nor does he have the capacity of read and comprehend a post before replying. I give up.

    You still haven't explained why you think people are better off choosing C for the core engine of a game. They're going to have to do the resource management manually in C, they have no choice; why are so insistent that they are better off [i]not[/i] using a language specifically capable of alleviating that pain point?



  • @Jaime said:

    99.9% of people can't tell you precisely what a program should do in their native language.  For those 0.1% who can, programming shouldn't be a second hurdle.
    You've got the point right, but I disagree on proportions. I'my pretty cynical about the general level of intelligence out there, but most people can work out the steps necessary to do something if they actually try.

    What's more, when Heron says:

    @Heron said:

    if a person cannot express what he or she wants the program to do in his or her own native language, then no amount of user-friendliness on the part of a programming language is going to help them figure it out.

    I entirely disagree. That's precisely what software wizards in other applications are designed to help with: to lead you through a set of choices that establish what it is you want, and configure the relevant settings - whether it's a search, a new document, whatever. I can't remember the proper terminology - assisted selection? - but the seeds are there. The whole point of what we're talking about here is that the ability to express yourself - whether in plain language, programming language, whatever - is an undesirable limitation, and one that, in an ideal world, we would have software to assist with.

    Consider the world of painting for a moment, instead. To become a painter, to produce art, one has to be able to wield a brush. That limitation has prevented some great artists from working for our benefit, because it's untenable to assume that great artistic ability and manual dexterity are linked. In the ideal world we're hypothesising, brushes would apply colour as you see it in your mind, and anyone could create the best painting they can imagine. That doesn't mean that everyone would be equally good at producing great paintings; just that they would no longer be limited by the difficulty of applying paint. Similarly, the best programmers would be those who were best at designing the methods used by the program, rather than those who were good at program design and had a body of unrelated esoteric knowledge that allowed them to turn design into code.



  • @cfgauss said:

    It's just stupid to argue that languages should not be made easier, and that hard languages should not be depreciated.

    You're right, but I'm not arguing that. I'm arguing that C++ is still relevant, or rather, that there are still cases where there is not a better option than C++.

    The only reason someone can legitimately say "C++ is the best choice" for a lot of projects is because it is the only choice.

    And your justification for this position is... arbitrary opinion?

    C++ will not "always" be the best choice for some topics

    Indeed not, but I didn't claim that either. I merely stated that it is absurd to claim that C++ is [i]never[/i] the right choice.



  • @davedavenotdavemaybedave said:

    @Heron said:
    if a person cannot express what he or she wants the program to do in his or her own native language, then no amount of user-friendliness on the part of a programming language is going to help them figure it out.

    I entirely disagree. That's precisely what software wizards in other applications are designed to help with: to lead you through a set of choices that establish what it is you want, and configure the relevant settings - whether it's a search, a new document, whatever. I can't remember the proper terminology - assisted selection?

    So now you're describing not just a friendly programming language, but a friendly AI that can ask you enough questions -- again, requiring native language processing -- that it can figure out what program you want and basically write it for you. Good luck with that pipe dream :P



  • @Heron said:

    Do you claim that CPAs are shrouding their field in obfuscation and mysticism merely because they require potential CPAs to prove they know what they're doing? Of course not; that's merely common sense. You don't have someone audit your company's finances if they have to look up every step; you hire someone that knows what they're doing instead.
    Most of the functions of a CPA can be duplicated by software, and home accounting packages have wizards that will take non-accountants through the steps necessary to do the basics. In the ideal world we're talking about, CPAs wouldn't exist. Their functions would be met entirely by software. It is non-trivial to take all the knowledge from the head of an expert accountant and turn it into logical processes, but we're not concerned with practicalities here. Any problem that has an objectively true answer is one that should be dealt with by computers. The higher functions of accountants require judgement, but those things aren't tested, as it happens - people just go on professional reputation.

    What we're dealing with here is the very first moments of computing's infancy. The changes in work patterns that we can see already are just beginning to reflect the way computers have changed the game. Where I think you're going wrong is that you seem to imagine this means people would know less. Just to check, I assume you program by flicking dip-switches to enter binary code. No? So do you know less about programming than someone a few decades ago who did have to work that way? As you can see, it's about using the space for more useful knowledge - you can leave the assembler to the compiler, and concentrate on program design. The next (plus a few) step is to leave the code to the programming engine, and concentrate solely on design.



  • @Heron said:

    So now you're describing not just a friendly programming language, but a friendly AI that can ask you enough questions -- again, requiring native language processing -- that it can figure out what program you want and basically write it for you. Good luck with that pipe dream :P

    Blakey nailed it.

    @blakeyrat said:

    Ok, we get it. You don't know what the word "ideal" means. You have absolutely zero imagination, and no ability at all to conceptualize a world different from the one we're currently in.

    I'm not going to bother to reply to you on this topic any more, since you just really are simply NOT GETTING THE CONCEPT here.

    Incidentally, spot on here, as well:

    @blakeyrat said:

    @cfgauss said:


    (awesome stuff)

    cfgauss, post here more often.



  • @davedavenotdavemaybedave said:

    In the ideal world we're talking about, CPAs wouldn't exist. Their functions would be met entirely by software. It is non-trivial to take all the knowledge from the head of an expert accountant and turn it into logical processes, but we're not concerned with practicalities here.

    I would argue that software which requires a domain expert to write also requires a domain expert to maintain. Oh, wait, in your imaginary "ideal", there's no such thing as software bugs.

    Getting rid of any and all domain experts is an absolutely terrible direction to move in. If something stops working, nobody will know how to fix it. If a meteor shower (or a plague of termites, or whatever other disaster one can conjure) destroys the computers housing your magical AI that writes programs based on English descriptions of requirements, then nobody will know how to write software.

    I understand that you guys think it would be "ideal". But you don't seem to understand that that situation would [i]not[/i] be ideal... [b]an ideal situation would allow for the chance that the system will fail -- even if only for reasons beyond the control of the system -- and need to be rebuilt.[/b] Yours does not. Your "ideal" society is doomed to extinction. Is [i]that[/i] what you consider "ideal"?

    Where I think you're going wrong is that you seem to imagine this means people would know less.

    You seem to be forgetting that that is exactly what blakeyrat said. His claim was that if the knowledge can be stored in a computer, it should not be stored in your brain. Correct me if I'm wrong, but there is very, very little knowledge that cannot be stored in a computer. If you disagree with that claim, then you need to realize you're not agreeing with blakeyrat as much as you think you are.

    If all anyone knows how to do is look information up in a giant database -- because they don't bother learning anything, because everything is stored in the computer -- how will they know how to apply that information? We have domain experts not because the common man can't learn or look up the raw information, but because different people are better at [i]applying[/i] information in different situations. Building an all-knowing Google would not magically make that irrelevant.



  • Heron you should write sci-fi. You could write a rambling adventure in the far future with marvelous new technologies that strain the limits of your imagination! Like... maybe a new kind of paperclip. Or maybe like an airplane, but it has four wings instead of two. Or a new breed of housecat...

    The possibilities are limitless in the world of Heron!



  • Wow, insults instead of responding to the argument. How... original.



  • @Heron said:

    I would argue that software which requires a domain expert to write also requires a domain expert to maintain. Oh, wait, in your imaginary "ideal", there's no such thing as software bugs.

    Getting rid of any and all domain experts is an absolutely terrible direction to move in. If something stops working, nobody will know how to fix it. If a meteor shower (or a plague of termites, or whatever other disaster one can conjure) destroys the computers housing your magical AI that writes programs based on English descriptions of requirements, then nobody will know how to write software.

    I understand that you guys think it would be "ideal". But you don't seem to understand that that situation would not be ideal... an ideal situation would allow for the chance that the system will fail -- even if only for reasons beyond the control of the system -- and need to be rebuilt. Yours does not. Your "ideal" society is doomed to extinction. Is that what you consider "ideal"?

    You're not fully understanding their point here. It's not that _all_ programming will be done by people who don't understand the basics of it, it's that people who can't grasp the difference between deletion and a recycle bin can destroy their data in completely new ways without having to have someone else write a program to do that for them. It's about the masses having a choice. It's about a baker who wants to be able to just add all his sales and refunds together and get his profits, or use that to make graphs. It's about a plumber who wants to ... do something plumberly with computers. It doesn't matter, at one point or another people are going to be like "I wish there was a little program to do X", well now they'll have the ability to sort of do Y, Z and W, which when combined in odd ways will usually do sort of what X was supposed to.


  • Someone not so long ago pointed out that story to me... it might even be around here, I don't remember. Seems partially appropriate.



  • @heron said:

    Wow, insults instead of responding to the argument. How... original.

    I said I wasn't going to reply to that line of discussion anymore, and I ain't. Given the rest of this thread, I'm not surprised you failed to read and/or comprehend that.

    @bannedfromcoding said:

    Someone not so long ago pointed out that story to me... it might even be around here, I don't remember. Seems partially appropriate.

    Man, Asimov wrote some stinkers. I can't even imagine what kind of thinking, even in the 50s, would lead someone to believe that humans could do multiplication in their heads faster than a computer... I mean, in Dune it kind of made sense a little bit, since in that society computer AIs were illegal, and the mentats were like specially bred over hundreds of generations to have computer-like brains.

    He also had a story where the kid learned the "secret code" (known to us as written language), see, because nobody could read in the future because everything was voice activated. oooOOOoooOOOooo. Except that story gives the opposite message, since there literally is no use for writing in their society except as a pig-latin-esque kid's plaything, even after the kid rediscovers it, it's not like he goes on to take over the world or anything.


  • Discourse touched me in a no-no place

    @Cbuttius said:

    What I mean is I write professional C++
    uh-huh...



    @Cbuttius said:
    and don't recall ever using std::cin in my code anywhere. 
    So how do you, for example, get your programs to chain together with pipes?



  • @PJH said:

    So how do you, for example, get your programs to chain together with pipes?
    Since when do daemons and services need that, ever?


  • Discourse touched me in a no-no place

    @Lingerance said:

    @PJH said:
    So how do you, for example, get your programs to chain together with pipes?
    Since when do daemons and services need that, ever?
    daemons and services don't tend to be command line utilities, so they don't.



  • I have not comprehended where or why blakeyrat thinks C might be a better choice of language than C++. The only thing I do agree with on that regard is that a C library interface can be better because it is easier to integrate in with other languages.

    One of the main problems I have found with C++ is that it is very badly taught. And there seems to be too much emphasis on iostream, which is one of the weakest parts of the language anyway, although I have found this to be a weakness with other languages as well, in particular it is worse with Java where you are stuck with an intrusive string representation of any type, including for integers where it is a decimal string.

    What you should be teaching C++ students in particular are:

    1. Memory and Resource management.

    - The two ways of creating objects, automatic and allocated. Automatic objects are automatically deleted when they lose scope, allocated objects must be deleted "manually".

    - You can wrap an allocated object in an automatic one to delete it for you. shared_ptr is one such allocated object that uses reference-counting.

    - Use of destructors as a "finally".

    Notice that it is resource management, not just memory. You use the same technique to close file handles, mutex locks. etc.

    2. Polymorphism.

    Of all the OO techniques this is the primary one that a student needs to learn and understand. Inherit to be reused, not to reuse.

    Of course you will also teach language features and templates. Using templates in a basic way, like shared_ptr and std::vector should be taught at a very early stage.

     



  • @PJH said:

    So how do you, for example, get your programs to chain together with pipes?
     

    Rare that you write such programs because that assumes your programs are communicating with each other with iostream and they probably would not. Where I work now they communicate with DBus and you use a DBus library as middleware.

    In the past I have used CORBA and other sockets-based programming.

    POSIX-specifics like pipes are also often best handled with the POSIX API (i.e. C), often wrapped in C++ classes, although boost and other open-source libraries will often provide these wrappers for you already. There are a few such libraries for DBus.

     

     



  • @PJH said:

    So how do you, for example, get your programs to chain together with pipes?
     

    And furthermore, the number of jobs I didn't get because I was tested on UNIX and instead of testing me on the basics they give me all geeky question type stuff like how to list your directory or your processes with all the right switches, piping it through sed and getting the output in some weird way, possibly through a few others commands too.....

    I program in C++. I write standard code using standard libraries and some common 3rd party ones like boost, and possibly have to use other 3rd party ones when necessary (most of which are written rather badly and are not const-correct). The code I write runs on UNIX platforms. I am not a UNIX geek though. And I don't use the vi editor. I prefer the keys on my keyboard to do what is printed on them, and to be able to copy and paste text the way I'm used to.

    I currently use Linux Fedora 10 with eclipse-helios as my code editor and gedit as my general text editor.


     

     



  • @Cbuttius said:

    @PJH said:

    So how do you, for example, get your programs to chain together with pipes?
     

    And furthermore, the number of jobs I didn't get because I was tested on UNIX and instead of testing me on the basics they give me all geeky question type stuff like how to list your directory or your processes with all the right switches, piping it through sed and getting the output in some weird way, possibly through a few others commands too.....

    I program in C++. I write standard code using standard libraries and some common 3rd party ones like boost, and possibly have to use other 3rd party ones when necessary (most of which are written rather badly and are not const-correct). The code I write runs on UNIX platforms. I am not a UNIX geek though. And I don't use the vi editor. I prefer the keys on my keyboard to do what is printed on them, and to be able to copy and paste text the way I'm used to.

    I currently use Linux Fedora 10 with eclipse-helios as my code editor and gedit as my general text editor.

    I have programmers that can do nothing other than write code.  Every time a new dev environment needs to be set up, they need someone else to do it.  Every time the database needs to be refreshed, they need someone else to do it.  Every time a remote debugger needs to be set up, they just give up and brute-force the problem.  They also tend to build bad versions of things that already exist, because they don't know what already exists.

    I ask those questions in interviews and I don't want any more "write code only" programmers.  My team only has room for a few of these guys and those spots are full.



  • @Jaime said:

    I ask those questions in interviews and I don't want any more "write code only" programmers.  My team only has room for a few of these guys and those spots are full.
    I'm surprised that's not a false economy. I don't know what your programmers are paid, but a junior unix sysadmin is presumably paid a small enough fraction of that amount that even if s/he has just a few man-weeks work a year to do, it would make sense to keep a full-time badly paid sysadmin so your well-paid programmers can get on with programming. The reason you don't get the programmers to clean the office is that they're paid far more than cleaners. Does the same not apply to sysadmin-ing?



  • @Jaime said:

    I have programmers that can do nothing other than write code.  Every time a new dev environment needs to be set up, they need someone else to do it.  Every time the database needs to be refreshed, they need someone else to do it.  Every time a remote debugger needs to be set up, they just give up and brute-force the problem.  They also tend to build bad versions of things that already exist, because they don't know what already exists.

    I ask those questions in interviews and I don't want any more "write code only" programmers.  My team only has room for a few of these guys and those spots are full.

     

    So you build your team up properly. You have a need for someone who can do those things and you presumably advertise for that in your job spec, rather than filling it with experts in one domain.

    However top C++ programmers also have their place. That doesn't mean I can't write scripts, I just do it with one hand on the manual, probably take longer than an experienced script writer and probably take a few more goes than they do to get it right, may end up with parts copy-pasted off some website somewhere, and after making a few possibly spectacular-looking failure attempts first, And then even when it works, it's possibly slightly WTF-y to an experienced script-writer.

    Of course if I spent nearly as much time writing these as I spend writing C++ I would pick up the expertise, I just don't.

     

     



  • @davedavenotdavemaybedave said:

    @Jaime said:
    I ask those questions in interviews and I don't want any more "write code only" programmers.  My team only has room for a few of these guys and those spots are full.
    I'm surprised that's not a false economy. I don't know what your programmers are paid, but a junior unix sysadmin is presumably paid a small enough fraction of that amount that even if s/he has just a few man-weeks work a year to do, it would make sense to keep a full-time badly paid sysadmin so your well-paid programmers can get on with programming. The reason you don't get the programmers to clean the office is that they're paid far more than cleaners. Does the same not apply to sysadmin-ing?
    Team's too small, organization's too big.  I can't hire a sysadmin, because we have a whole department for that.  Engaging them incurs a lot of overhead.  Cross-charge is $55 per hour, regardless of salary of employee.

    Besides, I have yet to meet a top-notch programmer who can't figure out how to get the stuff he writes up and running, including OS if necessary.  All of my "write code only" programmers are at the bottom of the ladder, not the top.  We try to make sure that programmers don't set up servers all day, but it happens.



  • @Jaime said:

    Team's too small, organization's too big.  I can't hire a sysadmin, because we have a whole department for that.  Engaging them incurs a lot of overhead.  Cross-charge is $55 per hour, regardless of salary of employee.

    Makes some sense, then. It's a false economy forced on you by corporate structure.

    @Jaime said:

    Besides, I have yet to meet a top-notch programmer who can't figure out how to get the stuff he writes up and running, including OS if necessary.  All of my "write code only" programmers are at the bottom of the ladder, not the top.  We try to make sure that programmers don't set up servers all day, but it happens.

    Wouldn't argue that decent coders should be able to get to grips with that kind of thing. But they shouldn't have to. Can you not just employ someone with a job title of 'junior programmer' but a role of sysadmin?



  • @davedavenotdavemaybedave said:

    @Jaime said:
    Besides, I have yet to meet a top-notch programmer who can't figure out how to get the stuff he writes up and running, including OS if necessary.  All of my "write code only" programmers are at the bottom of the ladder, not the top.  We try to make sure that programmers don't set up servers all day, but it happens.
    Wouldn't argue that decent coders should be able to get to grips with that kind of thing. But they shouldn't have to. Can you not just employ someone with a job title of 'junior programmer' but a role of sysadmin?
    The problem is that all those people that can only code and do nothing else, end up in the role of junior programmer by default.  They are hired as juniors and they never seem to progress up in the ranks.  The people who are really good, and they are usually the ones who are more versatile, progress to senior.  Unfortunately, the juniors never seem to quit, but the seniors get better jobs occasionally, so I'm always hiring at the top.

    As for messing with the system and hiring a sysadmin and calling him a programmer, I don't need to.  I simply hire programmers that can do what needs to be done.  The same person who can set up a test environment that replicates a client's bug is also the same person who will update the build environment when it collects too much cruft, or be the first to use a new unit testing tool, or set up the latest nightly build on a laptop to show at an offsite presentation.  Besides, what junior sysadmin who is willing to take a job with no promotion path would be able to replicate a client bug found in custom software?



  • @Jaime said:

    Besides, what junior sysadmin who is willing to take a job with no promotion path would be able to replicate a client bug found in custom software?
    One who wants to become a programmer :)

    @Jaime said:

    The problem is that all those people that can only code and do nothing else, end up in the role of junior programmer by default.  They are hired as juniors and they never seem to progress up in the ranks.  The people who are really good, and they are usually the ones who are more versatile, progress to senior.  Unfortunately, the juniors never seem to quit, but the seniors get better jobs occasionally, so I'm always hiring at the top.

    Are you restricted in your ability to get rid of the juniors? I'd have thought if someone wasn't progressing, there's no point keeping them on.

    Please understand, I'm not trying to tell you you're wrong - just to understand how it all fits together because I've never worked in an environment like that.



  • @Lingerance said:

    It's about the masses having a choice. It's about a baker who wants to be able to just add all his sales and refunds together and get his profits, or use that to make graphs. It's about a plumber who wants to ... do something plumberly with computers. It doesn't matter, at one point or another people are going to be like "I wish there was a little program to do X", well now they'll have the ability to sort of do Y, Z and W, which when combined in odd ways will usually do sort of what X was supposed to.
     

    Much of this thread seems to be the argument of "if computers were easier/more intuitive to program then non-programmers would be able to develop their own useful programs" versus "even if computers were easier/more intuitive to program then non-programmers would produce crap".  My feeling for this latter is more likely to be true. 

    When a person has input into the programming tool (be it writing code or explaining requirements to the programming AI-bot), the quality of this input will determine the quality of the end product.  Who here has not gathered requirements from an expert user, developed what was specified and then been told by the user that this is not what they want?  (A question: will further iterations eventually get us to the required goal?)

    As the tools improve and become more widespread they will undoubtedly give more people the opportunity to produce the things they want but I think there will always be people who have more aptitude than others, regardless of the tools available.



  • @RTapeLoadingError said:

    "even if computers were easier/more intuitive to program then non-programmers would produce crap"
     

    Just because people can do something, doesn't mean they will.

    Making programming easily accessible to Joe Fuckhead doesn't mean Joe Fuckhead is actually going to do any programming.

    The article on Quantum Chromodynamics is freely available on Wikipedia. Everyone can see it. But not everyone is reading it, or is interested in reading even when they are told it exists.

    Same for many other things. Many domains can be made totally easy but that doesn't mean everyone's going to flock to it. They're not going to care. They don't give a shit. Meanwhile, all the interested people who were previously unable to scale the learning curve can now do lots of excellent, creative stuff. Sure, there will be raving lunatics among them, but that didn't stop them when the domain was hard to learn, so no loss there.



  • @dhromed said:

    Just because people can do something, doesn't mean they will.

    Making programming easily accessible to Joe Fuckhead doesn't mean Joe Fuckhead is actually going to do any programming.

     

    You're dead right and I was hinting at that when I said...

    @RTapeLoadingError said:

    As the tools improve and become more widespread they will undoubtedly give more people the opportunity to produce the things they want but I think there will always be people who have more aptitude than others, regardless of the tools available.
     

    I mentioned the aptitude aspect and you the inclination.



  • I was reading the current SpectateSwamp thread today, and thinking that he's a perfect example of what we're talking about. Yes, he's a loony, but he might have been a visionary. Far more often than not, people like him will be the loonies, particularly if no sane person would imagine that they could write code to implement their idea, but, equally, the easier it is to write a program, the less loony you have to be to try.



  • @RTapeLoadingError said:

    @dhromed said:

    Just because people can do something, doesn't mean they will.

    Making programming easily accessible to Joe Fuckhead doesn't mean Joe Fuckhead is actually going to do any programming.

     

    You're dead right and I was hinting at that when I said...

    @RTapeLoadingError said:

    As the tools improve and become more widespread they will undoubtedly give more people the opportunity to produce the things they want but I think there will always be people who have more aptitude than others, regardless of the tools available.
     

    I mentioned the aptitude aspect and you the inclination.

     

    True, true.



  • @davedavenotdavemaybedave said:

    Yes, he's a loony, but he might have been a visionary. Far more often than not, people like him will be the loonies, particularly if no sane person would imagine that they could write code to implement their idea,
     

    Moreover, he is harmless, despite being a total loon.



  • @blakeyrat said:

    BTW, you bring up an interesting point: this is one area that an open source, standardized, dynamic memory-managed C-like language could really excel. Open source programmers already have some good IDEs, and easy royalty-free, politics-free portability would be a huge selling point for application companies. There was some hope that Java would be taken over as a more agile open source project, able to compete with C# on features (finally), but ... then it turned out Sun is a bunch of assholes. I mean, think of what open source did for web browsers and apply that to a modern computer language. It could be amazing.

    Of course they're too fucking busy writing 46 new sound libraries every month to focus on something like that.

     

    If they open-sourced the JVM, what language do you think it would be written in?

     



  • @Cbuttius said:

    If they open-sourced the JVM, what language do you think it would be written in?

    Well, it *should* be Java.

    Self-hosting languages FTW.



  • @bannedfromcoding said:

    @Cbuttius said:

    If they open-sourced the JVM, what language do you think it would be written in?

    Well, it *should* be Java.

    Self-hosting languages FTW.

    Yah, ditto. Java.

    I suppose you were looking for the answer: "C++ OH MY GOD YOU'VE SHOWN ME THE ERROR OF MY WAYS AND I AM ASHAMED!". But... I'm going with Java.



  •  If the JVM is written in Java it will compile to byte code and will need a JVM to run on. So you will have a JVM running on a JVM.

    Unless you create a "compile to machine code" option for Java. I would actually welcome that option, along with a cleaner interface with other languages, as well as being able to have C or C++ code calling Java code (well not directly, but calling into compiled objects written in Java), not just the other way.

    If that were done it would actually be a huge benefit and I would certainly consider switching.

     



  • @Cbuttius said:

    If the JVM is written in Java it will compile to byte code and will need a JVM to run on.

    You could just compile it to native code. Compilers for that already exist.

    @Cbuttius said:

    So you will have a JVM running on a JVM.

    How does that follow? Even if you couldn't currently compile Java to native code, you could write a compiler in Java that did-- it's Turing-complete, right?

    @Cbuttius said:

    Unless you create a "compile to machine code" option for Java.

    Pretty sure it's had this option since it was invented back in the mid-90s. When I was in college, I'm 95% sure our Java courses compiled to native code... not 100%, but 95%. And that was a long time ago, about 1997 or 1998.



  • Aren't there already a bunch of open source JVMs?  I'm pretty sure JNI would allow you to write a mostly Java JVM with only the lowest level stuff written in C or C++ or whatever.



  • @Cbuttius said:

    being able to have C or C++ code calling Java code (well not directly, but calling into compiled objects written in Java), not just the other way

    That's already possible, it just involves some painpatience: [url]http://download-llnw.oracle.com/javase/6/docs/technotes/guides/jni/spec/invocation.html[/url].



  • Interesting debate. I'd just like to add one thing.@Cbuttius said:

    What I mean is I write professional C++ and don't recall ever using std::cin in my code anywhere. 

    For this particular problem which is to take a parameter, perform a function on it, print the output and exit, you should use argv[1] to hold the parameter which you should convert from a string to a float or double.

    For this, check first that argc is at least [b]2[/b] (or exactly that if you prefer) and put a std::cerr << "Usage " << argc[0] << " [parameter]" << std::endl;

    FTFY



  • @Cat said:

    2. Variable initialization -- I'm kind of iffy on this.  Sometimes it's nice to make sure that you have some default value, but I don't do it every time.  I always do it for pointers, though, because that can lead to incredibly hard-to-find errors otherwise.

    Declaring variables without initializing them is silly. Instead of 

     

    int a;

    // ...

    a = someFunction();

    Why not do it the right way and just go 

    int a = someFunction();


Log in to reply