|
On November 09 2012 01:57 Ao wrote:Show nested quote +On November 09 2012 01:49 Recognizable wrote: I'm learning Javascript as my first coding language, but I see many here promoting Python, should I switch to Python? Depends what you want to make. Python is a great all around interpreted language. You can make basic games, library support is great. But if you're learning Javascript, you are probably interested in web, and for that I'd highly recommend Ruby / Ruby on Rails over python.
Are the languages very different? I'm just learning the very basics right now, are these the same for most languages?
|
On November 08 2012 22:15 Mirosuu wrote: Hah, what are the odds all these c++ topics come up as I'm picking up the language myself.
I've found that watching videos and just going "uh huh, i know that now. get on with the next topic!" to most of the videos of the concepts they're trying to teach you is the wrong approach to be looking at for programming.
My reasoning for this is that you're not actually doing ANYTHING about the knowledge they're telling you.
I'll tell you what my experience has been recently:
I've been picking up on c++ classes and how they differ from their java counterparts (I work as a Java dev). I knew already the structure of how c++ classes work, what they're supposed to look like syntactically, but semantically, I had no fucking clue.
When it came to instantiating said class, I was lost. I got confused greatly by the usage of header files, file management (when to use *.h files and when to use *.cpp files) and just general simple things like creating objects and having them linked correctly in the language.
After sitting down and trying out coding classes and having them instantiated in different files, I feel like I've learned a great deal MORE than the silly little tutorial on how to write a class. They don't ever tell you the little quirks like when to use headers vs when to use .cpp files or header guards, they just give you the raw data.
The only real way to really pick this up (this applies to anyone who wants to pick up any language, not just c++) is to just code something simple (my coding program I've worked on is a console, text-input based game of casino black jack) and use help when necessary. Once complete, submit your working program's code to a community that cares for code and have them critique your program to learn valuable insights into what you're doing right and what you're doing wrong, and use that knowledge for your next, and more expansive and more difficult program. Eventually you'll be able to competantly do the basics and even some of the advanced stuff without worrying about whether you're doing it right or wrong, because of all the valuable feedback, you know the best (or better) practices of how to do something.
It is usually a good thing to post your program onto multiple different communities that can help out, as some communities may not give as good advice as others, or they may frown upon a certain coding style etc etc. The more places you can get feedback for it, the better. There's countless "learn programming" communities on reddit for instance if you search for them. They would always be willing to critique. :D
Hope this helps.
I just want to state I do mess around with it. I don't just watch the video - copy the code and then go "yes I understand!" I write my own little programs with it and try things with it to make sure I understand it. Thanks for the advice though as its definitely a good approach ^_^.
As for tons of people telling me to go the easier route, it's not going to happen. I don't know why but I have always wanted to learn C++, it's just what I want to do, so that's what I am going to do. If for some reason it does happen that I can't teach myself this then I will switch languages, but for now I am just going to keep on trucking. In general I am a stubborn person, so when I want to learn c++ because it's always been the language that I have wanted to learn (I don't know why just always have), it's what I attempt to do at minimum.
I do have a book as well, as a reference and to read more detailed explanations (the book I have is Sams Teach yourself C++). I also google if I have a problem as well to better understand ^^.
On November 08 2012 20:58 Unshapely wrote: Let me persuade you to learn a language other than C++. It is not a language that will aide you in development of programmes as a "hobby", though it could help if you decide to take it as a profession.
Learn Python, and try to do some research on functional programming. LISP is a better language for a nearly pure functional programming approach that can be applied to real programmes as well.
Good luck. I would still ask you to change your opinion on C++ and switch to a different language.
Edit: If you do decide to further your knowledge in C++, or any language, I would be glad to help. Feel free to ask for support or assistance if you get stuck.
I may take you up on that offer for assistance haha :D.
|
I happen to be learning C++ right now too, pretty much just making a game with the help of this library: http://www.libsdl.org/
Previously I've made games with Python and Java, if you have an Android phone you might be interested to see what a fellow noob programmer has made: http://cambridgegamestudio.co.uk/
I'm learning C++ because it will be useful for what I want to do, but if I was just a hobbyist game maker I would probably stick to Python for PC games and Java for Android apps.
|
On November 09 2012 02:37 sundersoft wrote:+ Show Spoiler +IMO if you're going to learn C++, you should read The C++ Programming Language: http://www.stroustrup.com/3rd.htmlHowever that book isn't intended for people who have no programming experience, so you may want to learn a different language first and then read that book while learning C++. Also, there is a 4th edition coming out in 2013 which deals with C++11. Stroustrup also has a book intended for beginning programmers which uses C++, but I haven't read it: http://www.stroustrup.com/programming.htmlIt's easy to misuse C++ and wonder your program has memory leaks and crashes. In addition to that book, you should learn either Boost or the C++11 standard library. I'd recommend ignoring Boost for now and learning the C++11 features first after you have a good understanding of C++98. This is because many of the Boost libraries have been incorporated into the C++11 standard library. Right now there is little writing about C++11, but there should be more in the next few years. When learning C++11/Boost, you'll want to make sure you are using RAII where it is possible and that you are not reimplementing parts of the libraries unless you have a good reason to do so (so, use vector instead of allocating an array with new; any use of new should be in a class whose purpose is memory management). In addition to learning the language, you'll want to learn how your tools work and what the compiler, assembler, and linker actually do. This is important because using C++ effectively requires you to use 3rd party libraries, but doing so is unintuitive without a good understanding of how C++ code is compiled and linked. Having a good understanding of various types of libraries is also important. Designing code requires you to understand what good code is, and this understanding comes partially from using and evaulating libraries. Learning a library will also teach you about the problem the library solves, but to fully understand this it is also important to know how the library is implemented and which algorithms it uses. Finally, knowing many libraries will allow you write many types of programs quickly. It would probably take you a few years to learn enough C++ features to be competent at the language; it's difficult to write maintainable C++ code without having a full understanding of its standard library and features. C++ is also difficult for beginners to learn because it requires a good understanding of how computers work in order for you to reason about the performance and behavior of your program. In addition to learning C++, I would recommed learning a RISC assembly language such as ARM (I don't recommend x86 because it is difficult to reason about the performance of x86 assembly code) and the IEEE floating point standard and some basics about numerical computing. After learning the RISC assembly, you may also want to read about how x86 CPUs work and how caching and memory access is done. This can be ignored but it is difficult to write efficient code without a firm understanding of the architecture you are developing for, and many of the bugs that occur in C++ code are difficult to understand without knowing how stack frames are stored in memory or what a segmentation fault is.
This guy knows what he's talking about. I've bolded a few things I would look to go a bit more in depth with...
First off, while C++ is one of the fastest languages (the C++ tax is dieing very quickly), it is not a fast language to write with. If you are doing anything beyond a simple application, you will start to realize real quick how much code needs to be written. With a large volume of code comes a large surface area for bugs and mistakes. C++ teaches you patience and diligence.
Start using the standard library or Boost ASAP so you can get used to interfacing with the library. Learn just how much you can accomplish by only calling other peoples code. In all coding, this is an important skill, and is what engineering is all about. My suggestion: try rewriting a handful of older programs using the standard library to accomplish some of the tasks. Don't try to learn both the library and the lesson at the same time.
And yes, knowing more about stacks and processor architecture is important. Its impossible to understand why until you start debugging a more nefarious bug, then you'll learn real quick.
Good Luck with the learning endeavour! +1 for Stroustrup's books. He invented the language after all....
P.S.: A coworker of mine's favorite quote: "Not even Stroustrup knows C++, here, I found a bug in his book!"
|
Ok, so now I know why you haven't been streaming lol.
Best of luck and have fun dude . You have winter break right? You stream more then?
|
On November 09 2012 04:18 Qwyn wrote:Ok, so now I know why you haven't been streaming lol. Best of luck and have fun dude . You have winter break right? You stream more then?
It's not actually the reason I haven't been streaming. I just got kinda sick of sc2 due to zvp. I won it the most once I understood it but that's why I quit is I understood zvp which was turtle to corr/bl/infestor and I just can't handle having to do that to win, so I lost motivation and just don't have any real desire to touch sc2 for now. As long as zvp remains the way it is it'll be a long time before I can touch sc2 probably xD.
So in short no idea when I will play sc2 again .
On November 09 2012 04:13 RoyGBiv_13 wrote:Show nested quote +On November 09 2012 02:37 sundersoft wrote:+ Show Spoiler +IMO if you're going to learn C++, you should read The C++ Programming Language: http://www.stroustrup.com/3rd.htmlHowever that book isn't intended for people who have no programming experience, so you may want to learn a different language first and then read that book while learning C++. Also, there is a 4th edition coming out in 2013 which deals with C++11. Stroustrup also has a book intended for beginning programmers which uses C++, but I haven't read it: http://www.stroustrup.com/programming.htmlIt's easy to misuse C++ and wonder your program has memory leaks and crashes. In addition to that book, you should learn either Boost or the C++11 standard library. I'd recommend ignoring Boost for now and learning the C++11 features first after you have a good understanding of C++98. This is because many of the Boost libraries have been incorporated into the C++11 standard library. Right now there is little writing about C++11, but there should be more in the next few years. When learning C++11/Boost, you'll want to make sure you are using RAII where it is possible and that you are not reimplementing parts of the libraries unless you have a good reason to do so (so, use vector instead of allocating an array with new; any use of new should be in a class whose purpose is memory management). In addition to learning the language, you'll want to learn how your tools work and what the compiler, assembler, and linker actually do. This is important because using C++ effectively requires you to use 3rd party libraries, but doing so is unintuitive without a good understanding of how C++ code is compiled and linked. Having a good understanding of various types of libraries is also important. Designing code requires you to understand what good code is, and this understanding comes partially from using and evaulating libraries. Learning a library will also teach you about the problem the library solves, but to fully understand this it is also important to know how the library is implemented and which algorithms it uses. Finally, knowing many libraries will allow you write many types of programs quickly. It would probably take you a few years to learn enough C++ features to be competent at the language; it's difficult to write maintainable C++ code without having a full understanding of its standard library and features. C++ is also difficult for beginners to learn because it requires a good understanding of how computers work in order for you to reason about the performance and behavior of your program. In addition to learning C++, I would recommed learning a RISC assembly language such as ARM (I don't recommend x86 because it is difficult to reason about the performance of x86 assembly code) and the IEEE floating point standard and some basics about numerical computing. After learning the RISC assembly, you may also want to read about how x86 CPUs work and how caching and memory access is done. This can be ignored but it is difficult to write efficient code without a firm understanding of the architecture you are developing for, and many of the bugs that occur in C++ code are difficult to understand without knowing how stack frames are stored in memory or what a segmentation fault is. This guy knows what he's talking about. I've bolded a few things I would look to go a bit more in depth with... First off, while C++ is one of the fastest languages (the C++ tax is dieing very quickly), it is not a fast language to write with. If you are doing anything beyond a simple application, you will start to realize real quick how much code needs to be written. With a large volume of code comes a large surface area for bugs and mistakes. C++ teaches you patience and diligence. Start using the standard library or Boost ASAP so you can get used to interfacing with the library. Learn just how much you can accomplish by only calling other peoples code. In all coding, this is an important skill, and is what engineering is all about. My suggestion: try rewriting a handful of older programs using the standard library to accomplish some of the tasks. Don't try to learn both the library and the lesson at the same time. And yes, knowing more about stacks and processor architecture is important. Its impossible to understand why until you start debugging a more nefarious bug, then you'll learn real quick. Good Luck with the learning endeavour! +1 for Stroustrup's books. He invented the language after all.... P.S.: A coworker of mine's favorite quote: "Not even Stroustrup knows C++, here, I found a bug in his book!"
Thanks I plan on looking into that. I won't decline any help/advice that's for sure .
|
i agree with all statements in this thread saying you should not start with c++ if you want to get into programming for fun. there is more fun to be had in other languages than fiddling around with pointers and memory management.
|
On November 09 2012 02:44 Recognizable wrote:Show nested quote +On November 09 2012 01:57 Ao wrote:On November 09 2012 01:49 Recognizable wrote: I'm learning Javascript as my first coding language, but I see many here promoting Python, should I switch to Python? Depends what you want to make. Python is a great all around interpreted language. You can make basic games, library support is great. But if you're learning Javascript, you are probably interested in web, and for that I'd highly recommend Ruby / Ruby on Rails over python. Are the languages very different? I'm just learning the very basics right now, are these the same for most languages? The basic constructs (if statements, loops etc.) work the same for each language, but each language has its personal look and feel. For just learning pure basics, I would actually recommend Python since it doesn't have much overhead (braces etc.) and it forces nice looking code through indentation. Python was pretty much the only language I knew for a long time, and for my needs (writing small scripts for some calculations and computer stuff I didn't want to do myself) it's pretty much perfect. It doesn't have much web presence though, like Ao said, so if you want to develop things other people can interact with over the internet you will want to stick to Java/learn Ruby.
|
On November 08 2012 18:31 blade55555 wrote: Now for long term my goal would obviously be to program my own games which is obviously a long way off. I know this, while it would be awesome to start now I know this will take a long time before I can start doing that, but that's my long term goal. It's not all that hard You could make something simple pretty easily, with only an understanding of loops, functions and pointer/references.
|
On November 09 2012 04:49 KharadBanar wrote:Show nested quote +On November 09 2012 02:44 Recognizable wrote:On November 09 2012 01:57 Ao wrote:On November 09 2012 01:49 Recognizable wrote: I'm learning Javascript as my first coding language, but I see many here promoting Python, should I switch to Python? Depends what you want to make. Python is a great all around interpreted language. You can make basic games, library support is great. But if you're learning Javascript, you are probably interested in web, and for that I'd highly recommend Ruby / Ruby on Rails over python. Are the languages very different? I'm just learning the very basics right now, are these the same for most languages? The basic constructs (if statements, loops etc.) work the same for each language, but each language has its personal look and feel. For just learning pure basics, I would actually recommend Python since it doesn't have much overhead (braces etc.) and it forces nice looking code through indentation. Python was pretty much the only language I knew for a long time, and for my needs (writing small scripts for some calculations and computer stuff I didn't want to do myself) it's pretty much perfect. It doesn't have much web presence though, like Ao said, so if you want to develop things other people can interact with over the internet you will want to stick to Java/learn Ruby.
I have no particular interest in web related stuff, and seeing as how I'm just learning the basics, I'll switch to Python.
|
On November 09 2012 01:12 Otolia wrote:Show nested quote +On November 08 2012 22:00 Smancer wrote: Learning how to find what you need to solve a problem is what its all about in my opinion. Do I know C++? No. Could I write a program in C++ for a business task if asked by my employer? Yes.
Then you are probably a bad programmer and a even worse code maintainer. It's like saying you can create a professional software without knowing a modelling language. Everybody can but it's not about being good enough, it's about being efficient enough and not understanding the solution you copied from someone else is bad. BAD.
First, I'm pretty damn good. But based on your response you have no idea what I was talking about at all. You missed the entire point and focused on a hyperbole.
And I never said that you should just copy code, I don't know why you are putting words in my mouth.
|
On November 09 2012 04:59 Smancer wrote:Show nested quote +On November 09 2012 01:12 Otolia wrote:On November 08 2012 22:00 Smancer wrote: Learning how to find what you need to solve a problem is what its all about in my opinion. Do I know C++? No. Could I write a program in C++ for a business task if asked by my employer? Yes.
Then you are probably a bad programmer and a even worse code maintainer. It's like saying you can create a professional software without knowing a modelling language. Everybody can but it's not about being good enough, it's about being efficient enough and not understanding the solution you copied from someone else is bad. BAD. First, I'm pretty damn good. But based on your response you have no idea what I was talking about at all. You missed the entire point and focused on a hyperbole. And I never said that you should just copy code, I don't know why you are putting words in my mouth.
No but he has a point, if your constantly googling or using outside sources all the time then you probably arent understanding what your doing to begin with, I mostly see new recruits doing this. I know consultants are often shunted around into different platforms/languages, but if you have any sort of experience, it shouldnt take you too long to pick up a language after spending a day or two with a decent book, and you gain way more than by constantly searching. Also, often you might have to work in highly secure areas where the nearest net connection is 3 rooms away, and is often in use.
|
ok I lied I well end up posting a little program I made. Mainly I will just post the code and explain what it did (this took me a little bit to figure out after a little bit of messing around :D).
Very basic, nothing amazing just a guess a number that's already preset. If you guess wrong it'll keep saying incorrect and once you get it right it will give you a message saying it is correct.
So I ended up making a revision to make it shorter to. Here was my original code:
+ Show Spoiler +#include <iostream>
using namespace std;
int main() {
int yourage; cout << "How old is Morphine Lapunk (Made up name!)? \n"; cout << "Input the number (Hint it's between 1-20) \n"; cin >> yourage;
if(yourage == 20) {
cout << "That is correct! Morphine Lapunk is 20 years old! \n"; } else { while(yourage != 20){ cout << "That is incorrect, please put another number \n"; cin >> yourage; if(yourage ==20) { cout << "That is correct! Morphine Lapunk is 20 years old! "; } }
return 0; }
When looking at that it seems a bit repetitive so I decided to remove the first If and instead the code is only: + Show Spoiler +#include <iostream>
using namespace std;
int main() {
int yourage; cout << "How old is Morphine Lapunk (Made up name!)? \n"; cout << "Input the number (Hint it's between 1-20) \n"; cin >> yourage;
while(yourage != 20){ cout << "That is incorrect, please put another number \n"; cin >> yourage; if(yourage ==20) { cout << endl; cout << "That is correct! Morphine Lapunk is 20 years old! "; } }
return 0; }
Again very basic, but something I did today that I had to mess around a bit to finally get it the way I wanted .
|
^ you can refine it a bit more, you dont need the if. The while loop will be broken only if the age entered is 20 right? So...
int main() {
int yourage; cout << "How old is Morphine Lapunk (Made up name!)? \n"; cout << "Input the number (Hint it's between 1-20) \n"; cin >> yourage;
while(yourage != 20) { cout << "That is incorrect, please put another number \n"; cin >> yourage;
} cout << endl; cout << "That is correct! Morphine Lapunk is 20 years old! "; return 0; }
Also, with the older code, if you entered 20 on the first try, you would not get the confirmation message that the answer was right,because it would never go into the while loop.
|
Ah you are right. The if statement really is kinda pointless there lol. Thanks, should have tried that first :D.
Currently that's one of the few ideas I have had to do with the programming I know so far. I know how to put functions and use them, constructors I am just not sure when I would use them yet, but I imagine once I learn a little more I will see why as right now don't know enough to make anything worth using them yet.
Actually with that does anyone know any websites for c++ exercises or some kind of way to practice? I mean I come up with little things, but would like to be able to try something that is a problem or something as I feel that would be better practice.
|
Dont really have a site, but the big programming thread should have something in it, a lot of people who are learning post there,and I think there was a resources section too for various languages, might help.
Off the top of my head some of the basic problems that we did to get comfy with the basics of the language would be things like a basic text menu based calculator i.e. show a list of options (add,sub,exit etc) do the calculations and return to the menu, accept a string from the user and reverse it, check if a string is a palindrome, fibonacci series. Those would teach you about arrays, recursive functions, switch cases etc.
Then maybe you could try something like a text based tic tac toe game.
|
cplusplus.com is a good one. I used to post there often, especially in the UNIX section. I believe you should start from there.
Once you learn the basic syntactic language, the only other task is to choose a set of libraries to work with. Boost is a good one, it tries to be the "all rounder" rather than focusing on one specific strain.
|
Hm ok I am going to be honest. While I still want to do C++ I might bite the bullet and just do C#.
I'm not struggling in C++ (yet), but from googling and all that the one thing many people say is that you will regret it in 3-4 years. OK that is what got me thinking. When I read multiple people saying I will regret it in YEARS I decided I am going to be smart and do what everyone recommends to do. That is learning C#.
I figured if C++ did end up being wrong as a beginner I would regret it in a few months maybe, but didn't think a few years and then I would regret it. So from here on everything will be in C#.
Now for anyone who does C# programming, I will be honest one of my main things I want to do at some point is make an RTS just because I have loved RTS's since my first age of empires games and always wanted to make one. Obviously this is a long, long, long term goal. I know this, I am saying this so people don't tell me not to overshoot, I know I know .
I don't know much about C# as I have mainly focused on C++. So from here on blogs I make will be with C# progress. Any advice on this one would be great .
|
I am glad you changed your mind. A wise decision.
Designing an RTS might be a bit too far away right now, but let's start. Language is just a tool for you, once you learn any one language, you will be able to use every existing language with ease since all languages share the same structure.
C# is platform specific, and a bit harder compared to Python. C# is not the right choice for making an RTS game. You can see most real world programmers switching to Python and it has a similar library base to C++.
In my honest opinion, I would ask you to start with Python as it is perfect and not as limiting as the C# and C++. Most features are "natural" to a new person. There are also some good "toy" games based on Python you can examine. Because Python is so popular, you'll find help everywhere if you get stuck - because of the growth in this language. The library reference for the entire language is also well documented. There is a wonderful tutorial here.
Final goal: Once you're confident with programming and making toy games, you can move on to optimisation and choosing a gaming engine to work with. Learning another language will be easy once you've already learned one. Successful programmers need to know many of them. In my course of life I have come to know, Pascal, Ada, C++, Fortran 95, Fortran 2008, ISO C 1999, just to name a few.
Quite frankly, all popular gaming engines come in C++. But don't worry, you'll be ready to make games in any language once you fully learn a good language.
My Advise:
Learn an easy language (Python is easier and is now being used by corporate sector, including Microsoft and has been in use for POSIX systems as well). Then you're ready to make games with any language. C++ will be the choice for making RTS games.
|
C# is nice easy and a great language to begin with, and just in general a nice language.
You will be able to achieve your goals with it (long term,long term ). Much of what you've learnt till now will apply there aswell. Many games like bastion,fez etc were written in c# and xna.
the stuff you've learnt till now all apply. The loop constructs etc all still apply. Some differences do exist, for example structs and classes,how stuff is stored in memory, and everything is inside a always inside a class.
The first thing to do would be to get the express version of visual studio from the website(if you dont have it already), and try the stuff you've already done with it. Also...dont know what IDE you've been using till now, but intellisense(the dot prompter) is pretty sweet(the one for c++ in vs is not that great...I use an external tool).
Also, microsoft have a very nice reference site (MSDN) to learn things with tons of examples, for everything in c#..
|
|
|
|