Jump to content

  • Log In with Google      Sign In   
  • Create Account

Mercury Filter

Member Since 24 Oct 2013
Offline Last Active Apr 25 2016 11:08 AM

#5109228 How Languages Compare?

Posted by on 14 November 2013 - 12:48 PM

I don't want to tell you to stop using C, but when your code starts to have 1 000 000 lines I think you will have a hard time to manage around.

I understand what you are saying there (not really, as I lack the experience of writing large programs to claim understanding). I imagine managing any large programming project is not trivial, but I am curious about what it is that makes managing the larger programs in C++ easier? I have heard the quick answer of "classes", and perhaps this is another question that I need to experience as opposed to hear an answer to, as the quick answer does not really feel like it enhances my understanding (I often take this as a sign that I am missing some fundamental understanding that would make the quick answer more complete, if I had the knowledge). I assume that what Winfield said above is a  Edit::workable good::Edit option, so I guess I am wondering if there is something else that I am not familiar with in C++ that makes it easier to manage code for bigger projects, or if perhaps I need to write more C++ before I will really see the benefits?

Sorry if some of these questions are kind of silly (perhaps). I presume the wonderous shield of 'newb', which should be obvious from said questions, should afford me some pity, assuming that I manage to improve....eventually.


Edit::I felt like "workable" may have been communicating a negative or perhaps diminished appraisal of the option that I did not intend.

#5109219 How Languages Compare?

Posted by on 14 November 2013 - 12:20 PM

I'm developing almost exclusively in C nowadays

This is interesting for me to see. I am sure that there are people developing in all kinds of languages that I would not expect, but I usually see people insisting that you cannot use C, and you need to use C++. I would assume that it is a "toolbox" issue, and nothing is actually quantifiably superior in all ways, with the selection being a matter of choosing which benefits are most important. I am currently kind of a fan of C, but that is probably due to familiarity, since I have spent the most time using it at this point.

Thank you, by the way, for warning me about asking this kind of question. I will either be a lot more careful with how I approach such matters, or I will avoid asking potentially inflamatory questions in the future.

#5109215 How Languages Compare?

Posted by on 14 November 2013 - 12:02 PM

C allows functions without arguments. This is possible in C and C++, and I think all languages support that.

I am sorry if I did not make it more clear what I was saying. I am aware that C allows functions without arguments, I was trying to say that I was doing something with C++ where I would have needed arguments in C, or (if I understand correctly) I would have needed to be using global variables in C.

#5109212 How Languages Compare?

Posted by on 14 November 2013 - 11:58 AM

I apologize if I have asked something that can be the cause of a legendary holy war. That was certainly not my intent.

Perhaps I was not clear. I was not asking for whether one or the other is better. I wanted to know (if such a response is even possible with reasonable effort) if anyone had any high-level explanations regarding benefits in writing code in one or the other. Not really a better thing, but more specifically if there are certain things that are a bit easier in one language versus the other.

My question was meant to try and obtain objective responses, but I did use the dirty word "opinions" in my original post. Probably bad form when seeking an objective response. Perhaps the nature of my question can not easily be answered objectively. I mainly just want to try and determine if there are things here and there that may be easier in one language versus the other.

I play with both of them (which occasionally leads to me trying to do riduculous things in one because I forget I am not using the other), and just wanted to know a bit more about usage of the languages in general.

#5109197 How Languages Compare?

Posted by on 14 November 2013 - 10:46 AM

I have been wondering about how the practice of coding in C and C++ compare, in terms of a high-level view since I doubt at this point I would really benefit from a lot of the technical detail. I am not asking this for the purpose of "choosing a language", or anything like that. I just felt curious about opinions on benefits and drawbacks if comparing the two.

Most of what I have done to this point has been in either C, C++, or Java, with dabbling in various other areas. (Haskell and Prolog were pretty fun I thought, but I never got very far with them...no reason really, they were a sidetrack themselves, or just for fun)

I became familiar with C mostly from a course in computational physics that I took. I had used it prior, but most of my (occasional) effort had been directed at C++ up to that point. The thing that that use of C highlighted to me was that it seemed like C was a great deal more...hmm, not sure how to put this. Direct, maybe? When comparing the two, it feels quicker to write stuff in C. I would add that I have yet to write anything sizable. Even the final project for the course was not very big in terms of code. I am aware of statements regarding C++ code being organized in ways that makes it convienient for large projects, but I am not really familiar with the specifics of why that is. (Okay, maybe I could come up with an acceptable answer to that, but I would not be very confident in it, having not seen such things for myself.)


In writing some C++ code today, I saw that there were member functions of classes that could, due to the nature of classes, be written in a way that no arguments were needed to the function. I realized that if I were to write the same thing in C, there would be arguments required. I admit that I wrote some code in the above mentioned course that had some painfully large amounts of arguments. The flip side to the nice (at least I felt) no arguments benefit was that I had to write the class were in C I would have written two funtions alone. Perhaps this is a concept with importance of either greater, or lesser magnitude than I realize. I don't know how this type of thing (included as an example to hopefully clarify the nature of my question) would scale when you are talking about major projects, as opposed to something small, which is pretty much what I have written to date.


Or maybe I am horribly misunderstanding all kinds of things, lol. ["lol" is included in my typing language as a provisional inclusion, and I am not sure if it will make the cut for the standard]