• Beginning with C++
    64 replies, posted
[QUOTE=acpm;39761012]I think C and C++ is for cool kids, and if you like to get stuff done, then you use C#.[/QUOTE] This is said a lot, but I feel it's all bullshit. You're the most productive in the language you're comfortable in. Whether this is C++, C#, D or any other letter of the alphabet; as long as you're efficient with it, you'll get stuff done with it.
[QUOTE=Natrox;39782406]This is said a lot, but I feel it's all bullshit. You're the most productive in the language you're comfortable in. Whether this is C++, C#, D or any other letter of the alphabet; as long as you're efficient with it, you'll get stuff done with it.[/QUOTE] Yeah but objectively speaking, C# is faster when you want to write something quick. You can be proficient in C and make something faster than a C# programmer and vice versa, but a C# programmer will do it faster than a C programmer if they are equally proficient.
[QUOTE=Natrox;39782406]This is said a lot, but I feel it's all bullshit. You're the most productive in the language you're comfortable in. Whether this is C++, C#, D or any other letter of the alphabet; as long as you're efficient with it, you'll get stuff done with it.[/QUOTE] Well that is true to an extent. Like Darwin226 said if you take equally competent programmers one language can be faster to develop in than another. A lot of things are handled for you in other languages. In C++ when you are trying to get garbage collection or write a GUI you have to manage all the memory yourself and all of that fun stuff. In C# you can throw some buttons on a screen and write a few functions and it will be a working product. It takes care of a lot of things for you if you want it to.
Dealing with memory and/or the absence of garbage collection is not that hard. It's not that much work either. You 'new' something? Just 'delete' it when you're done with it.
[QUOTE=Natrox;39797593]Dealing with memory and/or the absence of garbage collection is not that hard. It's not that much work either. You 'new' something? Just 'delete' it when you're done with it.[/QUOTE] Or you new it and then don't have to delete it. It's twice as much work to do it manually. I exaggerate of course but the point is that C# does stuff for you, big and small.
Not to mention for most cases you don't even have to delete your pointers in C++, there exist such things as smart pointers in the standard library that handle that stuff for you.
Discussing the pros and cons of garbage collection and the preference of languages with it is a new and exciting topic.
[QUOTE=Natrox;39797593]Dealing with memory and/or the absence of garbage collection is not that hard. It's not that much work either. You 'new' something? Just 'delete' it when you're done with it.[/QUOTE] Gets a little more complicated once you start throwing threads in the mix.
Most of the strength of high-level platforms like Java and .NET is the libraries, not the language. You get stuff done more quickly in C# or Java because the standard library includes a wealth of classes for things like HTTP and XML parsing and audio and cryptography and whatever else you need. And if the standard library isn't enough, there are tons of good free additional libraries that are easy to download and use. As a language, C++ is more expressive than Java, and roughly on par with C# (IMO). But its standard library is much smaller — just the essentials, really — and using additional libraries introduces portability concerns. That means there's a higher barrier to entry for projects that depend on lots of library functionality. For some types of projects (such as games), the additional degree of control (e.g. over memory management) is worth the extra effort, but for others (such as the backend of most webapps), it usually isn't.
The way I started with C++ was with these videos: [url]http://www.3dbuzz.com/training/view/c-plus-plus-complete/intro-to-game-dev[/url] They're a not the best, but I think they gave me a good introduction to C++, and they're somewhat funny. When I first learned C++ I already worked as a programmer working with C# - so naturally it's a lot easier to learn than when you're completely new to programming. But just take it slow and enjoy learning new stuff.
[QUOTE=Persecution;39707444]Howdy folks I've been wanting to get into C++ programming for a good while now, so much so that I was planning on majoring in Computer Science in college. Though after reading up on the programming language, following a few dozen tutorials and walk-throughs, and eventually just face-rolling my keyboard in shame, I've come to terms with the fact that I have absolutely no idea where to begin here. I'm at a loss, though I followed one walkthrough to a T and managed to get the.. the "program".. if you can call it that, to go through debug mode without any [b][i]WARNING CATASTROPHIC MELTDOWN IMMINENT. YOU DONE FUCKED UP NOW[/i][/b] errors appearing, but then I was stuck at.. well "What now?" I'd love to try to code for games, make mods, and all that wonderful stuff, but I'm blocked off at my own ignorance of the subject. Can anyone get me any pointers on where to.. well, even begin here?[/QUOTE] posted these in another thread, but here is a few things i've learned about C++, still VERY new to it though. hope these help a little bit, and get you going in the right direction. [b]- learn how pointers work - learn what 'manual memory management' means - learn how RAII works - smart pointers are your friend - STL is your friend - allocate most shit from stack, not from heap (ie. avoid using new and delete) -> safer code and better performance[/b]
[QUOTE=Natrox;39782406]This is said a lot, but I feel it's all bullshit. You're the most productive in the language you're comfortable in. Whether this is C++, C#, D or any other letter of the alphabet; as long as you're efficient with it, you'll get stuff done with it.[/QUOTE] I have confidence that if you take any range of competent developers here who are comfortable in both C++ and C# and actually know about the available libraries for both you'd see completion of something sooner in C# than in C++. C# is so much more convenient off .NET alone, you'd have to be blind to not see that. When you get down to the hard facts, some languages take longer to create something than others just off availability of code. It's not solely based on efficiency. You can't get around the fact that one language will have built in networking functionality and another one wont, and the difference between writing the same objective goal is an import/require and one or two lines of code vs. obtaining and linking an external library, managing memory for the abstractions introduced, and cleaning things up yourself.
[QUOTE=acpm;39820466][B]I have confidence that if[/B] you take any range of competent developers here who are comfortable in both C++ and C# and actually know about the available libraries for both you'd see completion of something sooner in C# than in C++. C# is so much more convenient off .NET alone, [B]you'd have to be blind to not see that.[/B] [B]When you get down to the hard facts, [/B].....[/QUOTE] How can you even type what I bolded and not notice that it's a fallacy in itself? Why doesn't anyone test it instead of acting like we actually know the truth? "If you disagree with me, you're blind!!!!" isn't very convincing.
Don't mind me, just sipping on some Java here.
[QUOTE=gparent;39823116]How can you even type what I bolded and not notice that it's a fallacy in itself? Why doesn't anyone test it instead of acting like we actually know the truth? "If you disagree with me, you're blind!!!!" isn't very convincing.[/QUOTE] Have fun downloading a package and hooking it up to your project while someone else writes two lines of code to do something basic? I don't know why you're trying to put languages all on an even playing field. Go write an ASCII image dump program in brainfuck and then go do it in Java and come back and tell me they're equally as easy to write as long as you know the language fluently.
[QUOTE=acpm;39828396]Have fun downloading a package and hooking it up to your project while someone else writes two lines of code to do something basic?[/QUOTE] Because the .NET standard library can do anything. Literally anything. There will never be a time where you'll want to get another library for C#. [editline]7th March 2013[/editline] this is sarcasm
[QUOTE=dajoh;39829243]Because the .NET standard library can do anything. Literally anything. There will never be a time where you'll want to get another library for C#.[/QUOTE] And if you do, you just use Nuget which can get you almost any .NET library you want (including its dependencies).
Arguing about languages is like arguing about religion, some asshole is going to insult everyone's language but their own. C/C++, C#, Java, and Python, etc are all [b]ESTABLISHED[/b] languages which means they work pretty well. Use what's best for [b]YOU[/b]. If it does what you want it to, why would you care what everyone else uses?
[QUOTE=acpm;39828396]Have fun downloading a package and hooking it up to your project while someone else writes two lines of code to do something basic?[/QUOTE] Are you serious? C++ has libraries too, and any programmer worth a fuck won't take more than one minute to get it included and linked. Especially if they're using an OS that is well suited for development. Plus, you're missing the big picture: the time you'll spend downloading and setting up libraries is completely meaningless compared to the time you'll spend programming the software in the first place. Whether the C++ or C# programmer would finish first would depend on what the task at hand is and how well the language they use is suited for it. If installing a library or copying a block of memory makes the C++ developer so slow he can't be a match to the C# one, he's terribly incompetent.
[QUOTE=gparent;39831205]Are you serious? C++ has libraries too, and any programmer worth a fuck won't take more than one minute to get it included and linked. Especially if they're using an OS that is well suited for development. Plus, you're missing the big picture: the time you'll spend downloading and setting up libraries is completely meaningless compared to the time you'll spend programming the software in the first place. Whether the C++ or C# programmer would finish first would depend on what the task at hand is and how well the language they use is suited for it. If installing a library or copying a block of memory makes the C++ developer so slow he can't be a match to the C# one, he's terribly incompetent.[/QUOTE] Does C++, as a language, actually offer ANY benefits that would make it faster to write than C#? Because if it doesn't, you can just say that C# does GC and that's enough to objectively say it's a faster language to write code in.
This is C++ thread guys. But I agree, adding library to C++ program is really trivial task.
C# is a beautiful language. It's too bad it doesn't have the platform independence that C or C++ has. Anyway, C++ isn't that much harder to develop with unless you're some sort of caveman who hates having to manually do things like link libraries. Yeah, C# has more ready-to-use libraries, but it's not like my C++ development is dramatically impeded by having to install libraries and shit or implementing stuff that C# readily implements. That's just silliness. Development for C# is easier and quicker than C++, but the gap isn't large enough that its something to phone home about. Unless we're talking about C#'s ability to create forms out of thin-air. That's practically bordering on wizardry.
I kinda miss pointers from C++ but I think it's better on C# way because debugger actually tells you error instead of plain crash. I might be wrong because didn't tested Visual C++ extensively.
[QUOTE=Darwin226;39831523]Does C++, as a language, actually offer ANY benefits that would make it faster to write than C#?[/QUOTE] They're both entirely different languages. It will depend on the task at hand. Any competent programmer shouldn't be slowed down by the fact that there's no GC in C++ because they're been used to doing memory management manually for years, just like a good C# programmer should know when the GC can hurt rather than help (and is able to work around the issues when they occur).
All the pointless arguing aside, what would be the best book to learn c++ from? I have experience with some other programming languages like Python and Java so I don't need anything [I]really[/I] basic
[QUOTE=superstepa;39840549]All the pointless arguing aside, what would be the best book to learn c++ from? I have experience with some other programming languages like Python and Java so I don't need anything [I]really[/I] basic[/QUOTE] I don't have that much experience with C++ books, but I've heard [url=http://www.amazon.com/dp/020170353X/?tag=stackoverfl08-20]Accelerated C++[/url] is a very good book, especially for people with knowledge in previous languages.
[QUOTE=Bumrang;39840593]I don't have that much experience with C++ books, but I've heard [url=http://www.amazon.com/dp/020170353X/?tag=stackoverfl08-20]Accelerated C++[/url] is a very good book, especially for people with knowledge in previous languages.[/QUOTE] Yeah gonna go with that one too. It's great.
It's funny how nobody dare mention VB while speaking of .NET, it's like a forbidden topic.
[QUOTE=cody8295;39861246]It's funny how nobody dare mention VB while speaking of .NET, it's like a forbidden topic.[/QUOTE] There's basically zero need to use it over C# when working with .NET, so why mention it?
[QUOTE=cody8295;39861246]It's funny how nobody dare mention VB while speaking of .NET, it's like a forbidden topic.[/QUOTE] A lot of VB developers moved on to better languages.
Sorry, you need to Log In to post a reply to this thread.