| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| C/C++ Discussion | |
|---|---|
| Tweet Topic Started: Sep 17 2008, 09:05 PM (2,067 Views) | |
| Fission | Sep 20 2008, 11:15 PM Post #16 |
|
Uguu
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
C++ has a few extra features and minor differences from C, but syntactically they are the same. Also, Python is not better than C (in sheer speed and ability) and the person who said so should be beaten with a heavy club of some kind. |
![]() |
|
| FinalKiller0 | Sep 21 2008, 12:08 AM Post #17 |
![]()
OVER 1,000!!
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
C++ & related are the most powerful of them all. Java is not as powerful. Pyton is in between. It all depends on what you want to do and which one(s) you like to work with better. So far, by computer science teacher is boasting about how awesome Pyton is as he teaches his comp sci seminar class. |
![]() |
|
| Fission | Sep 21 2008, 12:14 AM Post #18 |
|
Uguu
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Actually, you'd be surprised how powerful Java is. One of a few major flaws is that its runtime environment is a bit heavy on computer resources. |
![]() |
|
| FinalKiller0 | Sep 21 2008, 12:20 AM Post #19 |
![]()
OVER 1,000!!
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Well, I dunno how powerful anything is as C++ is only my second language, and the fisrt one I learned was a beginner's language. That list is according to my comp sci teacher. |
![]() |
|
| Fission | Sep 21 2008, 12:25 AM Post #20 |
|
Uguu
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Anyway... Has anyone here ever experimented with integrating Lua scripting (or any scripting, for that matter) into a program? |
![]() |
|
| Dyegov | Sep 21 2008, 12:55 PM Post #21 |
![]()
D . r . e . a . m . i . n . g
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
So you suggest I learn C++ instead of Python since it's better? That person said that one of the advantages of Python was that I didn't have to compile it, but I don't even know if that's an advantage... Also, what is a good place to learn C++? (Internet wise, I mean) |
![]() |
|
| FinalKiller0 | Sep 21 2008, 01:29 PM Post #22 |
![]()
OVER 1,000!!
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
If you are talking to me, all I said was which ones are powerful and which ones are not. A language is better if you think it is better and if it is better for the type of work you are doing. For example: you may use BASIC for programming your calculator, but you won't use it to program the next big video game. You can't ask me which one is better as I am still learning how to program on my first widely-used language. |
![]() |
|
| Dyegov | Sep 21 2008, 09:03 PM Post #23 |
![]()
D . r . e . a . m . i . n . g
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I'm not referring to anyone in particular, since I don't even remember who said to me Python was better (It was actually more than one person in more than one board). I just want to know if C++ is worth it in the long run, and if it's suitable for a beginner (Though I got the basics of variables, if-else statements and all of that long ago). |
![]() |
|
| Fission | Sep 21 2008, 09:11 PM Post #24 |
|
Uguu
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
C++ is sort of easy to get the hang of if you know the basics of programming. "Hello world" example for C++, with comments:
If you want, I can make a simple tutorial on C++ basics in here, my blog on this board, or through PM. |
![]() |
|
| Dyegov | Sep 21 2008, 09:35 PM Post #25 |
![]()
D . r . e . a . m . i . n . g
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Well, that surely looks way more confusing to me than Python. I would appreciate an explanation of the basics, because I don't seem to get it with the comments. It doesn't resemble anything I have seen before :s |
![]() |
|
| FinalKiller0 | Sep 22 2008, 02:48 PM Post #26 |
![]()
OVER 1,000!!
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
This would Hello World IMO:
I used Pascal as my beginning language:
|
![]() |
|
| mcteeth | Sep 22 2008, 03:18 PM Post #27 |
|
Oh, Comely.
![]() ![]() ![]() ![]()
|
Take care though: iostream.h has been deprecated since < 1996 and main() returning void is considered harmful. Fission's example is correct, but I disagree that "[using namespace ...] should always be used" because it moves everything into the global namespace. I'm kind of iffy about system("PAUSE") as well...
The differences between C and C++ are actually kinda major when you consider more than syntax and features at face-value. C is renown for its compactness -- it's a very small language, and a lot of people consider it "syntactic sugar for assembly." C++ is pretty large in contrast and has several newer concepts and paradigms. More importantly, the way that you think in C is not the way you should be thinking in C++. It's important to remember that C++ isn't just "C with classes."
I disagree with your teacher. In the article "beating the averages," Paul Graham reasons that power doesn't come from the "brute force" that the language has or from requiring you to work out verbose details, but from the expressiveness of the language. I consider this true for two reasons:
You don't have to agree, but it's certainly something to think about. (By the way, everyone should give that article a go. It's a very good read! Edited by mcteeth, Sep 22 2008, 03:57 PM.
|
![]() |
|
| Fission | Sep 22 2008, 05:30 PM Post #28 |
|
Uguu
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Well, you could just do:
or, if you were really feeling crazy, this:
However, in some libraries (most notably SDL) cout, cerr, and cin (standard input and output streams defined in iostream) are redefined. In a non-SDL program written in C/C++, cout and cerr print to the screen (a DOS-like window) and cin gets input (via: cin >> var;) from data written by the user, but in SDL, cout and cerr print to stdout.txt and stderr.txt, while cin obtains values from stdin.txt, though it is rarely used. |
![]() |
|
| mcteeth | Sep 22 2008, 07:58 PM Post #29 |
|
Oh, Comely.
![]() ![]() ![]() ![]()
|
That doesn't compile.
|
![]() |
|
| Fission | Sep 22 2008, 08:10 PM Post #30 |
|
Uguu
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Fine then:
I'd rather just use "using namespace std" as it makes doing that a heck of a lot easier. Then again, I rarely have a need to deal with things like namespaces. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| Go to Next Page | |
| « Previous Topic · Technology Chat · Next Topic » |
| Track Topic · E-mail Topic |
3:15 PM Jul 11
|



![]](http://b1.ifrm.com/0/1/0/p601690/pipright.png)





3:15 PM Jul 11