Thread: Which language?

  1. #16
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by woody_294
    Ok, I've started up reading "Thinking in C++" and it's making a great deal of sense to me, am I likely to get confused soon or if I'm getting concepts should I plod on?
    Just plod on. Once you have acquired basic programming skills by becoming proficient in using one programming language, it becomes easier to learn new programming languages, even if they focus on different programming paradigms.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  2. #17
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    @MK47:
    Let's see if I can summarize what you mean to say.
    - Simply saying use C++ over C for big projects is misleading due to a number of factors. Essentially, you are trying to say that it depends on the project needs, and whatnot.
    - You are implying that I am implying that every non-C++ program was made by developers who were naive. That they really should have been using C++ because it's superior.

    Now, to correct those points.
    I am not going to go through all the trouble to emphasize in words when C++ probably is a better tool than C. I'm quite content to say that usually C++ is better suited for a task than C, especially for larger applications. Because C++ has been designed for more modern needs.
    For the second point, I am implying nothing of the sort. Programs have been designed in a specific language due to business specific factors. It's life. Could they have used a better language? Could they have made better choices? Does the program suffer because of those decisions to use a bad language (if they did pick a bad language)? Perhaps. Perhaps not. But I am in no way implying that the developers were stupid. Either they chose the language for a reason or were forced due by a number of factors. This is more likely than that they are stupid.

    And as for the hardware, I am not sure you get my point. We need a low-level language to handle those kind of platforms. There must be such a language.
    Often we see C usually because it's the easiest and cheapest way of making a compiler for a system. I find it a shame, seeing as C++ could fit that job, as well, and providing a richer development environment.

    But let's not start an argument over this here. It will only end up in a C vs C++ war, which none of us want, I'm sure. We both agree on the approach the OP should take, so let's keep it at that.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #18
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by Elysia View Post
    But let's not start an argument over this here. It will only end up in a C vs C++ war, which none of us want, I'm sure.
    Well, I won't, since I actually like OO and will probably pick up some C++ at some point because I'll like C with OO. But I don't think it is the be all and end all AND I think you are making it synonymous with "modern needs", which is a snake chasing it's own tail.

    As you say, I think generally a choice of languages is made for more pragmatic reasons than what is most ideal in an ideal sense (which that will probably come down to what you are most comfortable with). An example of a pragmatic reason would be that business will always favour compiled languages because they can be close sourced. This is despite the fact that on modern computers, they do not really have much advantage over interpreted languages, but interpreted languages will tend to have a lot of advantages over them WRT to "providing a richer development environment", pretty much because of their nature.

    Of course, those interpreted languages have to be written with a compiled one. Higher, and higher, and higher...once upon a time, C was at the top of that chain (not the bottom). We should not be down playing the value of doing of low level stuff (which is implicit in your assertion about "bigger" and "more modern": bigger in what sense? More modern in what sense? A monkey could write a million lines of code given the opportunity, though s/he might need a bureaucracy to help with this now massive undertaking, but so what? I don't buy the "50 000 goofs can't be wrong" bit. And all this stuff is concurrent, not consecutive.)
    Last edited by MK27; 02-07-2010 at 10:10 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  4. #19
    Registered User
    Join Date
    Feb 2010
    Posts
    11
    I am going to plod on!

    Ok, am I right in thinking, through reading these posts that there isn't a large difference between C and C++ other than in C++ you use objects, what do you use in C instead of objects? Is the whole thing in one "object"...

    I'll stop there, I may be making uneducated guesses into having mistaken preconceptions, lol.

  5. #20
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by MK27
    An example of a pragmatic reason would be that business will always favour compiled languages because they can be close sourced.
    If the software is provided as an online service, that reason would not be relevant.

    Quote Originally Posted by woody_294
    Ok, am I right in thinking, through reading these posts that there isn't a large difference between C and C++ other than in C++ you use objects, what do you use in C instead of objects? Is the whole thing in one "object"...

    I'll stop there, I may be making uneducated guesses into having mistaken preconceptions, lol.
    Yes, I think that you should ignore the differences between C and C++ until you are proficient in at least one of them. If you really want to know, then the answer is that objects are used in C as well, but the connotation of what an "object" really means may be different, or may actually be the same, depending on what you are talking about.
    Last edited by laserlight; 02-07-2010 at 10:18 AM.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #21
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by MK27 View Post
    Well, I won't, since I actually like OO and will probably pick up some C++ at some point because I'll like C with OO. But I don't think it is the be all and end all AND I think you are making it synonymous with "modern needs", which is a snake chasing it's own tail.
    I don't make it out to be the one-for-all solution.
    Likewise, I do not say it is perfect for all "modern" needs, only it has more tools that a modern developer might want, than say, C.
    This is all purely subjective on what you work with, of course, but I usually associate modern with big, complex applications. And I usually associate C++ having the entire subset of C, hence making it a valid replacement (that is, being able to replace, not should) for C, should such a thing arise.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #22
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by woody_294 View Post
    Ok, am I right in thinking, through reading these posts that there isn't a large difference between C and C++ other than in C++ you use objects, what do you use in C instead of objects?
    There are some OO type methodologies in C but for simplicities sake let's say there are not: the point is, objects and classes do not make the impossible possible -- they do not permit you to do anything that cannot be done another way.

    Doing it another way may be more awkward. On the other hand, OO is not by definition the best way to do something, and often going a more (supposedly awkward) route may be more optimal. OO is pretty great tho, and did revolutionize programming.

    Part of the reason OO lends itself so well to game programming is that there are many many different games which all share certain certain similarities, and these basically identical, but fairly complex, high level concerns are easily classed and generisized. As they say, it makes it easier to avoid having to ask people to re-invent the wheel.

    IMO, you might as well use OO for everything, because even when it is slightly less optimal, this difference is unlikely to have much real significance on modern computers. Which is also why I said if not for the business concerns, interpreted languages would be used a lot more than compiled ones, and as laserlight implies, they certainly are on the web, partially by necessity.

    Quote Originally Posted by Elysia View Post
    This is all purely subjective on what you work with, of course, but I usually associate modern with big, complex applications. And I usually associate C++ having the entire subset of C, hence making it a valid replacement (that is, being able to replace, not should) for C, should such a thing arise.
    I won't take issue with the second part beyond saying that at this point in time AFAICT reality has put a damper on C++'s portability, but (hopefully) that will resolve itself in time.

    Is a modern BIOS or kernel a big complex application? Your kernel and your BIOS are just as modern as your web browser.

    If you are just going to measure lines of code and people hours of work, a very low level project written in assembly could easily be as big as the web browser, and conversely, you could do a web browser in perl or python in less time with 1/10th the code base.

    If you are going to measure the executable size, it should be noted that smaller is actually better and the reason we can have such massive end user apps is due to the streamlined, maximally optimized foundations they run on. And thanks to modern hardware, fat bloated apps work just fine. But writing a "big" application in this sense is stupid thing to do for it's own sake, so if by modern you mean "conducive to lazy and mindless design", then terrific!

    Ie, this "big" thing basically sounds like a big phallic fallacy to me.

    A lot of people will look at a computer and say the most "modern" and "impressive" thing on it are the graphics and the interface or whatever. The truth is, all those impressive modern things have been enabled by HARDWARE CAPACITY and have nothing to do with a particular programming language. I doubt the programming has changed to become "more complex and modern" to accomplish these goals -- it is just you can do a much greater quantity of it without worrying about resources.

    IMO the most complex and modern applications (such as the web) involve a mixture of C (infrastructure), C++ (end user applications), and tons and tons of interpreted stuff (the glue and the content). Which interpreters are surely "big modern applications" and with a few exceptions (such as javascipt/spidermonkey) those are written in C. Why? I will guess it is a "Keep It Simple, Stupid" philosophy which might be ultra-important on very tight, high performance, incredibly dynamic applications like interpreters, which are completely different from games and interfaces in the sense they are much fewer in number, lean much less on external libraries, and probably highly idiosyncratic (as opposed to generic) in design.
    Last edited by MK27; 02-07-2010 at 11:04 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  8. #23
    Registered User
    Join Date
    Feb 2010
    Posts
    11
    I think maybe instead of thinking, I should have read about it, as I am doing now

    I'll try to keep my guess work to a minimum in future!

  9. #24
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by MK27 View Post
    IMO the most complex and modern applications (such as the web) involve a mixture of C (infrastructure), C++ (end user applications), and tons and tons of interpreted stuff (the glue and the content).
    What??

    These web applications aren't event 1/10th as complex to develop as your traditional wages program. And it's not because of choice of compiled languages over interpreted ones. But instead the often very complex business rules and the need for adaptation to new rules that makes these type of projects much more complex.

    Meanwhile game development is a lot more complex than web or even business applications. It takes years and large teams of programmers to develop something that is on par with today standards for a game release. And when it is finished, it's often full of bugs yet to be tackled or even discovered.

    Web applications are incredibly moronic applications to develop. It's Programming by Lego (tm) most of the time. And while there is no doubt newer technologies are bringing web development to the business reality of current desktop programming challenges, it will still take a few good years before this becomes the norm.
    Last edited by Mario F.; 02-07-2010 at 11:52 AM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  10. #25
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by Mario F. View Post
    What??
    These web applications aren't event 1/10th as complex to develop as your traditional wages program.
    By "web" I did not mean "page" I meant the internet considered as a sum of necessary parts -- servers, browsers, interpreters, user applications.

    Also it seems a little far fetched to say that a payroll program is by nature 10 times more complex than (eg) a contemporary web forum. Unless you are paying people in different flavours of sub-atomic particles or something. Of course, I have no doubt you can charge 10 times as much for them, which is good business.

    There are elements of games that are quite complicated, but overall I do not think they need to be understood as such simply because of their size, which is what takes the time and people power. Like, a movie trilogy probably takes more resources than a commercial, but they need not be any more complicated (and often aren't). Again, simply making a big fat mess is not impressive unless you are the government, even if you do manage to spend a quadrillion dollars on whoop de do.

    As for your absurdist snobbery about web-dev, well I would expect as much Mario Web-dev people have to work in multiple high level languages, some of them as complex as they come, and deal with a very heterogeneous and unstable realm as far as standards go. I'd would love to see you get started on the Google search engine (clearly a moronic assemblage of Lego) and make it work even 1/1000th as well. They deserve like a Nobel prize in data handling or something for that.
    Last edited by MK27; 02-07-2010 at 12:08 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  11. #26
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Geez, you really wish to continue this, don't you?
    Quote Originally Posted by MK27 View Post
    Is a modern BIOS or kernel a big complex application? Your kernel and your BIOS are just as modern as your web browser.
    Yes, they are, and probably even more complex. Therefore, it stands to figure that using a higher level language such as C++ (Java & co are probably not qualified here) would reduce the complexity and the time it takes to maintain and write the BIOS and kernel.
    You did a good job at hinting at it yourself:
    If you are just going to measure lines of code and people hours of work, a very low level project written in assembly could easily be as big as the web browser, and conversely, you could do a web browser in perl or python in less time with 1/10th the code base.
    In other words, the more tools a language provides that we can utilize in a good way, the less hours we have to put into creating and maintaining something.
    Put another way: you could give your secretary pen and paper. She could probably do her work, but then again, it would be faster and smoother if she had a computer, no? Because in this case, she could utilize the resources provided by the computer to do a better job in less time. The does, and will, hold true in case of software development.
    Let this be my point. For bigger, more complex software, it usually stands to reason that more tools to do your work--and that means tools designed for this kind of work--would make your work more efficient and faster.
    For this analogy, you can label the pen and paper C and the computer C++.
    Obviously, there are some things that a computer cannot do. For example, you wouldn't put a computer to recruit new people, would you? No, I thought not. In that case you might need something else. We could put labels to that, as well, such as Java or C.
    But I hope I do get my point across in that.
    I'm too lazy to type all that out in words in a casual reply, however.

    But writing a "big" application in this sense is stupid thing to do for it's own sake, so if by modern you mean "conducive to lazy and mindless design", then terrific!
    You know very well that's not what I mean.
    I hate bloated applications. I hate Microsoft's products a lot, usually because they are so big, bloated and slow!

    A lot of people will look at a computer and say the most "modern" and "impressive" thing on it are the graphics and the interface or whatever. The truth is, all those impressive modern things have been enabled by HARDWARE CAPACITY and have nothing to do with a particular programming language. I doubt the programming has changed to become "more complex and modern" to accomplish these goals -- it is just you can do a much greater quantity of it without worrying about resources.
    But at the same time, what an application needs to do in today's world is far greater and herein lies my point. Look at Office. It does a thousand things. Writing all that code have taken years. What would it have taken had it all been written in assembly, for example?
    So languages have evolved to meet modern challenges. That was also my point. And my point was also that C has not focused on this aspect. It has focused more on being the low-level language for dealing with hardware.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #27
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by MK27 View Post
    By "web" I did not mean "page" I meant the internet considered as a sum of necessary parts -- servers, browsers, interpreters, user applications.
    Ah. Did miss your point then.
    But I'm unsure as to how relevant that can be.

    Also it seems a little far fetched to say that a payroll program is by nature 10 times more complex than (eg) a contemporary web forum. Unless you are paying people in different flavours of sub-atomic particles or something.
    It's not far-fetched. Payroll programs are among the most complex business software applications. It may seem it's just a matter of calculating wages, but a quick perusal over the business requirements of such applications along with the Law that regulates the development of these applications and you WILL change your mind.

    And then this only for small to mid-size companies with rather simple organizations.

    As for your absurdist snobbery about web-dev, well I would expect as much Mario
    I literally have no place to put your opinions on my statements. My rubbish is your treasure.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  13. #28
    Registered User
    Join Date
    Feb 2010
    Posts
    11
    Good god do all posts end up like this?

  14. #29
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by woody_294
    Good god do all posts end up like this?
    All "which language?" threads end up like this, no matter where you go. Shall we debate the merits of English versus Latin?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  15. #30
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by Elysia View Post
    For this analogy, you can label the pen and paper C and the computer C++.
    Why would I stop there? I'd label the pen and paper C, an old electric typewriter C++ (which, thankfully, I never had to use), and the computer perl. I still think nothing beats pen and paper for some things, btw. Like composing on a typewriter (the more modern technology) is definitely not a desire most sane people possess. But this is a very crass analogy.

    So languages have evolved to meet modern challenges. That was also my point. And my point was also that C has not focused on this aspect. It has focused more on being the low-level language for dealing with hardware.
    It has been a focus of low level developers concerned with hardware, that is not "it's focus". C and C++ are the same thing in this regard anyway. It has also been a focus of many developers who write high level APIs. You are now using modern == high level, which is just dumb. There is a modern low level and a modern high level, high and low do not refer to a progressive evolution from one to the other.

    Even after a bunch of posts here (and previous threads) I still have not seen you define what you mean by "modern challanges", which is why I responded to this as simply meaning "is a standard OO interface available"? If you want to keep redefining it until the question is "Is it the programming language known and loved by Elysia? Is the language one Elysia is highly efficient, productive, and proficient at?" then I think I understand what those modern challanges are about (a tishload of expensive and stubborn developers ).

    My point about repeatedly bringing up countless examples of "big modern applications" written in C is not to prove that C is the best language in the world, it's just to demonstrate that many highly capable people besides Elysia have chosen in to work in C, and by some coincidence it is their work (and not somebody else's) which came to occupy that place. So while it may be more efficient and productive for many people (including Elysia) to work in C++, this is a subjective and not a universal truth. There is nothing about C which makes it "inappropriate" for big modern projects; plenty of very successful big modern projects are done using C.

    I suppose they are not done they way you would do them, but I don't need to think about the whys and wherefores of that.

    Quote Originally Posted by Mario F. View Post
    Payroll programs are among the most complex business software applications.
    This is like saying pumpkins are one of the biggest kind of squash.

    Quote Originally Posted by woody_294 View Post
    Good god do all posts end up like this?
    No, eventually the vBulletin database fails and we have to start again. Basically, the tradition is that (some) C++ people have some kind of hidden childhood trauma about the fact that C still exists. An Oedipus complex that failed, or something. Then they insist on screaming, "My Daddy is dead! My Daddy is dead!" while he's standing there in front of them.
    Last edited by MK27; 02-07-2010 at 12:57 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 01-21-2010, 04:40 PM
  2. What language did they make Java in?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 07-03-2005, 04:18 PM
  3. Strange loop
    By D@rk_force in forum C++ Programming
    Replies: 22
    Last Post: 12-18-2004, 02:40 PM
  4. Language of choice after C++
    By gandalf_bar in forum A Brief History of Cprogramming.com
    Replies: 47
    Last Post: 06-15-2004, 01:20 AM
  5. Language Script..
    By vasanth in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 03-30-2003, 06:48 AM