Question:
I dont understand programming languages (c++ python) Any help?
anonymous
1970-01-01 00:00:00 UTC
I dont understand programming languages (c++ python) Any help?
Eight answers:
green meklar
2010-11-11 08:00:27 UTC
First, if you are having trouble with C++ as a language, then stop worrying about what strings are. Strings are actually somewhat advanced in C++. Until you have the basic stuff in your head properly, worry about that instead. Work from the ground up.



Second, it might not be a good idea to start with Python or C++. Something like Java (or even Javascript) may be easier for you to wrap your head around at this point, and then later you can apply that knowledge to more advanced languages.



Third, personally I have never found books a good way to learn programming. They can be good for reference, but these days we have the Web for reference, and unlike books, you can search the Web automatically and you can copy+paste stuff from it. So screw the books. Screw tutorials as well, except perhaps the VERY simplest ones. It's better to practice in creating your own programs.
?
2016-04-22 15:42:03 UTC
I don't know why everyone is talking about game programming. The question was "Which is the all-around better programming language". My opinion for this question is Java. You don't have to get dirty with memory management, syntax is mostly intuitive, speed is comparable (Java is slower, because it is partially interpreted, but I doubt you will ever find yourself in a situation where you will notice this difference), Java's structure implements good conventions. There are only a few things I dislike about Java, it's exceptions are irritating, you can't overload operators, there are some irritating syntax things, like new Object() should be Object.new() in my opinion, and I hate how methods with no parameters still require parentheses, and some places a method will have the same name as a variable, so "abc".length() requires parentheses but [1,2,3].length does not (gets really irritating when you are dealing with arrays of strings. But these are little irritants, c++ will have many many more, and I have yet to find a compiler for a Windows machine that I was satisfied with. I use Bloodshed, it's the best I've come across, but it still sucks next to even a basic text editor and command line on Linux. Visual C++ is a cruel joke, and you don't want to try compiling on a Windows machine without an IDE, the hoops you will have to jump through will make you cry. So I suggest get yourself a good Java IDE (I use JCreator on Windows, some swear by Eclipse), and I think you will honestly be happier with it.
Namibnat
2010-11-11 21:27:12 UTC
The others have given you some good advice already, but I just want to chip in for Python.



I learned Python as a beginner (okay, I did learn BASIC in the dark ages, but that hardly counts). Now I use Python on a daily basis for all sorts of things, including building websites with something called Django (written in Python).



I find Python very easy and intuitive, and you can start doing stuff right away.



By far the most important thing is actually doing the stuff on your computer. At first you may not understand why a loop that adds a number can be of any use, but as you progress, so long as you could actually do the stuff, it starts to make sense.



I agree with the guy who said you should learn from web sources, but most importantly, I would say, is start asking questions on forums. I love Daniweb as a good place to start learning - they are very geared towards helping beginners out.
puffor
2010-11-11 04:42:25 UTC
You need to start small. It's like trying to understand how to speak English or Spanish without ever learning the alphabet, how things are said, and not even bothering to learn the basics of grammar.



A string is simply the holder and the representation of a specific text.



So in C++, you might assign: myString = "this is my text in a string";



So an example of using this:



#include

#include



^^--these two things above are important because they include information for basic programming



your function -> int main() {

//below is mostly your code

//the string foo = "hi"

//bar = "there"

//== comparison

std::string foo = "hi";

using std::string;

// Now we can just say "string".

string bar = "there";

if (foo == bar) { // operator== compares string contents for equality

std::cout << "The strings are the same"<
}

std::cout << foo + bar << std::endl; // Prints "hithere" (without quotes) by creating a temporary object



return 0;

}





So basically, *if* this string = that string *then* return some line of code *else* do this.



That's what programming is basically all about. If this then that. If not this, then that.



Gave you an extremely dumbed down version. But you need to start small. Don't expect to be making huge programs or games in a week. I taught myself how to program when I was 12 and stopped around 18 or 19 years old. I just simply got bored. But C++ was the only thing I never really got into. Though, in college, instead of taking a Math class, I took Python and understood it immediately. If it's similar to C++ than it really isn't that bad. I got an A. Just takes time to understand what you're doing.



If you don't understand, don't give up. Start slowly. Read a few lines or try a few lines at a time. Let it process.



When I was 11, I would just look at the code and I wanted to make programs so bad. I was so frustrated that things weren't working. And I wanted it so bad.. one night, I went to sleep and dreamed.. not about the finished product, but the lines of code. I couldn't believe I was actually dreaming about code. I woke up and began to understand the source codes I was reading. And I began having some more dreams about coding. It was all I thought about. But .... little did I know, several years later, I'd end up hating it and doing something completely different. Doesn't mean I forgot! Just means it's not something I didn't want to do for a living.
anonymous
2010-11-11 04:39:09 UTC
i thought C and Java worthing a try
pkjm17
2010-11-11 08:43:20 UTC
Learn Perl....You don't even have to declare variables in Perl. It's sweeeet!
sparky_dy
2010-11-11 04:34:12 UTC
Try a different language!



C++ is a bit advanced, and Python is just horrible.
ItsJareds
2010-11-14 08:39:45 UTC
I kind of chose a different course to start programming. I was only 10 when I began learning so I just began doing what I felt like doing, which at the time was making websites. So I learned HTML first in and out. However, CSS is a major part of HTML so I was forced to learn CSS as well. These are both not programming languages but markup languages, which means that they just tell the web browser where to place things and what the things should do.



Once I learned HTML and CSS, the next logical step was to learn Javascript. This language has a simplified syntax (grammar) than most real programming languages, so it was relatively simple for me to learn. Javascript doesn't have more advanced features which I think makes it perfect for a starting language. I suggest learning Javascript on W3Schools.com(1), but it's not required.



If you find that learning programming languages through just reading books pointless and not very helpful, I promise that it's much more helpful to find an example program off the Internet and just reverse engineer it. By this I mean look through the source and try to understand what the author was trying to do with the program, and look up information as necessary.



Once you feel like you've gotten enough practice reading other people's programs, you may feel it's time to start your own. Start small (this is important) and try to build something simple such as a Javascript that reports the time on your computer, or that says a message when you click a button. Then you can start to move onto bigger projects such as building real forms.



The best way to learn programming is to practice it.



After I had a firm grasp on Javascript, I moved to PHP. It's a language most commonly used in servers to create web pages that are dynamic, meaning they can change depending on different variables. PHP was a very small step after Javascript because it uses a lot of the same syntax -- most languages have similar syntax to Javascript because Javascript is modeled after Java.



PHP is a bit more advanced and it is an actual programming language, albeit a little simplified. Go through the same steps to learn and practice PHP that you did for Javascript.



After you've done all this, learning any other programming language is fairly simple. I picked up C++ and Java very quickly over the last year or two and going the course that I went set the right learning base to understand programming correctly.



In flow chart format, here is my suggestion to you:



Learn programming languages in this order:



HTML -> CSS -> JavaScript -> PHP -> C++/Java -> anything



Good luck, and I hope you figure it out :)


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...