As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I have been developing using c# now since the first release of .NET. I have never really spent time on C or C++ and thought it would be a good idea to get a little more awareness. Does anyone have any recommendations for sites that would provide a good learning/tutorial for someone that has c# experience to venture into C++ a little?
Thanks
Warning: C++ is not C and the following is related only with C++.
If you are already a c# developer I think you should work in three different directions:
1) copy semantic, memory management and const keyword, these are the main differences between c# and c++.
Make yourself familiar with copy constructor, destructor and assignment operator. Learn how to use RAII idiom.
Study the differences between passing a variable by: value, reference and pointer.
I will suggest Effective C++ http://www.amazon.com/Effective-Specific-Improve-Programs-Designs/dp/0321334876 also guru of the week it is a great source.
In More Effective C++ there is a nice chapter on the difference between pointer and reference.
2) you need to make yourself familiar with the standard library, in my opinion this is a really good book http://www.amazon.co.uk/Standard-Library-Tutorial-Reference/dp/0201379260/ref=sr_1_4?ie=UTF8&qid=1314957062&sr=8-4
3) the standard library is great but not enough, you will soon need boost.
I am reading this book at the moment http://www.amazon.co.uk/Beyond-Standard-Library-Introduction-Boost/dp/0321133544/ref=sr_1_1?ie=UTF8&qid=1314957541&sr=8-1
I haven't finished it yet, but it looks good so far.
Keep practise, you are going to love coding in c++.
You've already been given several good suggestions, but the wealth of information available on StackOverflow alone may be a bit overwhelming, so I'll give you a very specific bit of advice.
Rather than look for a tutorial on the web get a good book such as "C++ Primer" by Lippman, Lajoie & Moo. It is useful both as a tutorial and as a reference and is currently the most modern among the good, thorough books about C++.
This tutorial is good Teach Yourself C++ in 21 days.
21 Days is an overstatement by the way, you can breeze through that tutorial a lot faster, but it's comprehensive and easily understandable, and I recommend it.
Good luck!
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am looking to make a Mud as a way of learning programming and enjoying it. Part of this is obviously working out a server client connection via the various clients muds use to connect. This uses Telnet for those who aren't aware. I was going to try to learn to do this myself but my father who is a professional programmer said its not that big of a deal to learn and using a library would allow me to move faster through it.
So my question is, first is using a library a better option here, and is there a good free one I can make use of that either uses C++/CLI .Net(preffered) or C# .Net(Was told this one is faster, but is less precise, so I would prefer to learn C++ for the precision, and I was told learning C++ is basically learning C# anyway)?
If using a library is not the best option, is there any good sites or books for finding a simple description on how to make one from scratch?
Most networking libraries will work with C and any variants thereupon.
C# will allow you to implement something (relatively) quickly and easily, but insulate you from programming issues that arrise from using less "safe" languages.
.Net is in fact a library, and it provides both C++ and C# interfaces.
Using a library is deffinately the best option, as it would be required unless you want to get down to the hardware level in every respect. For example the function printf() comes from the C/POSIX library, it actually fills up a buffer on a character device, which then get pushed to a real terminal over a serial interface, or far more likely a virtual terminal and then to your drawing library. Wether you know it or not everytime you use an #import or #include you are linking against an interface to a library. In the case of these simple libraries the compiler already knows where they are so you don't have to tell it about them.
In short C# will let you do things in an abstract and fluffy manner that may soften your learning in the begining, but will ultimatey prevent you from understanding what happened under the hood(and for many people that's ok). C++ will make your life more difficult, and it's compiler may give more cryptic errors, and it won't try to protect you from yourself, but you will probably learn a whole lot more. .Net is just the library your dad advises you use, as it provides a whole lot of functionality, without having a ton of dependencies.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
When I first became interested in programming, I took a class that introduced me briefly to C++ for a semester (this class mostly focused on topics like "what is a variable", so I know very little about what C++ is capable of). Up next was a year of AP Computer Science, where I learned Java. Don't get me wrong, I love Java, but I feel like I have become so dependent on it. I am pretty good at programming in Java, and I like the extensive packages like Swing and io that give a great degree of power to even a new learner.
I have exhausted my school's (extremely) limited supply of Computer Science classes and am looking at Internet tutorials or books to learn on my own. However, I don't want to start learning a language only to realize that it isn't "right" for me.
I guess what I am looking for is a widely used, well-known, powerful language that will not only be good for controlling a computer but also for opening doors later in my life.
I am specifically looking at C# or C++, although I don't know why. If you think some other language would be better, please suggest it and why. Hopefully this is enough information for someone to answer. If not, please ask me to clarify because I really would like a specific good answer.
There's no right answer to this question. It depends on what you want to do. I suggest doing some research as to each language and decide from there. If you have more specific things that you would like to achieve, then maybe we can help point you in the right direction.
Good luck.
I think you should go for c# or Java. Both these languages are good enough to cater to any kind of computation needs, whether its web, mobile, embedded or just a standalone app.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I realize that this is the sort of question that tends to result in arguments, but because I never learn, I'll ask it anyways:
I'm a Computer Science student with a couple years of experience who is currently looking into doing more serious work with game development. Thus far I have about half a year's knowledge of C++ and Java and a year and a half of C#. I've worked a lot with the XNA framework, but in looking around for advice, I've found a lot of people suggesting that C++ or Java is a better place to start for building games.
So my question is this: Given that I already am comfortable with XNA, what are the major disadvantages inherent in the format that would be avoided by instead using C++/Java?
When answering with regards to optimization and such, please consider my current lack of experience. Telling me that an optimized C++ program is faster than an optimized C# program is meaningless to me if that optimization requires an expert programmer to implement.
Edit: Allow me to rephrase: My question is not "Why should I use C++?", it's "Why should I not use XNA?" I'm aware that C++ will give me more options, but my question was whether or not those options are useful enough in amateur game design to be worth seeking out C++ immediately.
The advantage of using C++ is that you can do literally whatever you want.
Another advantage is that the C++ might be faster, in tight loops where you are doing a lot of math where the C# equivalent is using a lot of little structs.
The disadvantage of using C++ is that you will be programming in C++. This means memory management woes, pointer dereferencing bugs, and all kinds of unmanaged problems that you don't get in .NET.
Another disadvantage is that you don't get support for XBox or Windows Phone that you would get with XNA.
Okay, so let's completely ignore the argument which one is better. Let's go with the assumption you wish to pursue a career in game development.
I am going to be straight forward and say that 90% of games, if not more, are developed using some portion of C++ (either the complete thing, a framework, libraries, etc) so learning C++ would be essential to any game developer.
If you are doing it purely for a hobby XNA is a fast way to get in the door without learning the other programming elements (such as 3D graphics, file management, etc). However that being said, learning that stuff is also key.
So, to sum up, my suggestion is to learn C++. There is no reason not to. If you know C++ you can learn C# in half a second (well not really, but fairly quickly). Once you have an understanding of the basics (3D programming, physics, etc) you can do pretty much anything.
Good luck.
yes use Xna if you want fast results. i just started with c++ but i have to said that xna is quite easy. you just have to know OOP(object orientated programming) with C# and youll make good games with xna too.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
I and some buddies have an argument here -
in which langauge is it safer by terms of writing a code that cannot be hacked?
by hacked I mean that after the code is encrypted, or turned into executable , it can be reversed enginered into some kind of intermidate code (like java byte code) , or even the real high level program code itself .
This agruments aruse in general because one of us is about to start a big software project,but he's afraid that his competitors will steal some of his very-efficient algorithams.
It would be nice if any of you could present some pros and cons for each langauge .
thanks.
I don't really get to work with Java so I'm more familiar with C#.
In C# (or other .net languages) you can use easy and free tools like Reflector to see ALL of the code written inside an executable or dll.
You can always try obfuscating the code with the most advanced tools, so this won't be revealed easily, but I'm pretty sure that if the code is worth enough for someone to hack/reverse-engineer, It WILL be, and it's just a matter of time till that happens!
Even with lower level languages like C/C++, if the code is worth it, the people interested will find out how it works.
Bottom line : EVERYTHING IS HACKABLE/REVERSE-ENGINEERABLE!
:)
Both Java and C# can be decompiled to (mostly) your original source code. In .Net you have Reflector, in Java you have DJ's Decompiler. It works both ways.
In the end, it doesn't really matter. If someone is determined, they can always dis-assemble your code and still get the "efficient algorithms". Any code readable by the CPU is readable by a human.
Since by "security" you seem to mean protection against reverse-engineering, your best bet is probably native code like C/C++... most interpreted languages are much easier to decompile than native code, although you can obfuscate them to make it harder.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I often read that one of the best ways to continue learning how to programme is to study great opensource projects out there in the wild. Can somewhere recommend a good open source C# project that they learned a lot from. I've been coding a couple of years, both windows and web apps, pretty standard stuff, sql server, asp .net. I'm particulary interested in improving my skills in building well architectured n tier apps
Thanks,
Brendan
Microsoft's own ASP.Net MVC project is open source. It's under their own license, which is probably pretty restrictive about what you can actually do with the code. But it's a pretty large project and interesting to look at.
Have you looked at Codeplex? There are over 800 open source C# projects there.
At the general level, I've found that standard library code is often good to learn from. Reading the source to application code is certainly useful. However, reading the code to STL, or D's std.algorithm or something that is similar, teaches you how to think on a higher level, and to create generic, reusable code. In contrast, application code is often more ad-hoc and heavier on boilerplate, and therefore not as educational.
For your specific case, I'd read the code to the libraries/frameworks you're using. It's interesting in and of itself to know how these things work instead of taking them as magic, and they're written by top-tier programmers and probably much higher quality and much more dense in terms of significant programming concepts per line than most application code.
MediaPortal. Some of it is fabulous, some of it is bad. However, if there is anything you want to do, its in there somewhere.
How about the OpenJDK (the open source version of the
Java Development Kit)?
Here is OpenJDK 6
Here is OpenJDK 7 (release planned for 2010 or so)
Have a look at the NHibernate code its fantastic
their repository is here