Poll: C++ or Python?
You do not have permission to vote in this poll.
Python
28.57%
8 28.57%
C++
71.43%
20 71.43%
Total 28 vote(s) 100%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C++ Vs Python?
#11
(11-09-2009, 08:38 PM)nevets04 Wrote: That would be silly to type std:: before every line...

Exactly, but you do what fits the situation; In this case, a Hello World program doesn't need to preload everything in the std library. It's quicker/smaller to pick-and-choose. Generally, though, it's better to say "using namespace std;"
Reply
#12
(11-03-2009, 02:02 AM)Fail Ninja Wrote: I think python be because it is a lot easier and the syntax is easier than C++, but python is almost as powerful ( This is just my opinion as a beginner in python and some who tried C++ and quit).

Another reason is here is the hello world for Python -
Code:
Print " Hello World! "

And here is Hello World for C++ -
Code:
#include <iostream>
using namespace std;
void main()
{
  cout << "Hello World!" << endl;    
}

I also think that if you start with C++ you will get frustrated quickly and quit programming quickly.

Just my Opinion.

Lol agreed
Reply
#13
(11-09-2009, 06:31 PM)J4P4NM4N Wrote: Btw, I thought the main() function had to be of return type "int" as I wrote?
It should, yes.

(11-09-2009, 08:38 PM)nevets04 Wrote: That would be silly to type std:: before every line...
It's only before the actual use of STL, not every line as such. I rarely do "using namespace" for third-party libraries, also you should never used a "using namespace" inside a header file because of namespace pollution.

(11-09-2009, 09:46 PM)J4P4NM4N Wrote: Exactly, but you do what fits the situation; In this case, a Hello World program doesn't need to preload everything in the std library.
Pre-load? I think you're confusing what "using namespace" actually does, it promotes a namespace to a global scope (essentially dissolving the namespace), there is no "pre-loading" going on since you would still only be able to access code that you have included.

(11-09-2009, 09:46 PM)J4P4NM4N Wrote: It's quicker/smaller to pick-and-choose.
Well, you do generally tend to include the headers for the classes you need and not everything since that would increase compilation time. Still, "using namespace" has nothing to do with compile time.

(11-09-2009, 09:46 PM)J4P4NM4N Wrote: Generally, though, it's better to say "using namespace std;"
Once again, watch out for this in header files due to namespace pollution.
[Image: sig.php]
The little boat gently drifted across the pond exactly the way a bowling ball wouldn't.
Reply
#14
C++,if you master it that's it all the other languages are piece of cake.
Reply
#15
I'll have to agree with bsdpunk on this one, you can't really compare them. :/

(11-09-2009, 09:46 PM)J4P4NM4N Wrote: Generally, though, it's better to say "using namespace std;"

Do try avoid using that in a large project. I usually just "use what I need" in larger projects. (using cout; for example.)
<Aoi-chan> everyone's first vi session. ^C^C^X^X^X^XquitqQ!qdammit[esc]qwertyuiopasdfghjkl;:xwhat
Reply
#16
C++ is the best of programming fundamental...

[Image: ubuntu_5.11.jpg]
Reply
#17
i prefer c++... very powerful programming language.
Reply
#18
C++ seem winning now Big Grin
I voted for c++
Reply
#19
> Btw, I thought the main() function had to be of return type "int" as I wrote?

Returning 0 tells the program it's done, but it isn't needed.

I want to say Python, because of it's easy of use, but I'm going to say C++ because of it's power.
GamerCraft

Visit it, and tell me what you think. Tongue
Reply
#20
c++ Because python is basic and should be the first programming language you learn but it is really hard...But i suggest c++
[Image: OGForumsbanner.png]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  C++, C , Python Equinøx 17 3,026 04-06-2010, 12:25 AM
Last Post: Detective RooTz

Forum Jump:


Users browsing this thread: 15 Guest(s)