LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-28-2005, 06:55 PM   #1
servnov
Member
 
Registered: Sep 2004
Distribution: Slackware 10.2
Posts: 276

Rep: Reputation: 30
thoughts on C/C++ vs. Python for personal programming


I am tring to decide on what to concentrate my efforts on as a programming language. I want to do both command line and wxwidgets stuff for GUI. It seems if I want to do this I must know C++ over C...What are your ideas on learning Python 'instead'?

I just want different thoughts on postivies and negatives of C/C++ vs. Python. I have heard Python is kinda limited for Object oriented stuff, is this true?

Thanks.
 
Old 02-28-2005, 07:05 PM   #2
RodimusProblem
Member
 
Registered: Dec 2004
Distribution: Knoppix 3.6
Posts: 135

Rep: Reputation: 15
If you're making stuff for your own use, Python has the advantage with it's easier syntax.

The easier it is to write, the quicker personal stuff can be dealt with.

Also, OOP might be overkill for many programs, including those with widgets and such.
 
Old 02-28-2005, 08:43 PM   #3
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
I think Python is much easier to get started with, especially for beginning GUI development. Python uses untyped variables, which generally means fewer compilation/execution errors, but it can also lead to problems with maintaining your code; you have to keep in mind what data type all of your variables are, because Python doesn't remind you.

Learning C/C++, on the other hand, would probably give you a better foundation in programming concepts, and better equip you to deal with problems. C++ is more strongly typed than C (meaning the compiler will usually complain if you try to use an int in place of a char), but overall both are pretty weakly typed, which can be both a blessing and curse.

If efficiency is a concern, C/C++ might be a better route, but I would guess for most small- to moderate-sized projects (GUI included), Python would be fast enough.

I'm biased towards OOP, but I know many programmers dislike it (especially C++'s implementation of it). It can be a hindrance to experienced programmers, but I think OOP concepts are easier to learn and apply than strictly functional concepts.

In short, I'd recommend a little of both: learn some of the basics in C/C++ first, to give you a better understanding, then move to Python. Learning Python is a breeze once you know C++, but doing it the other way around might be confusing.
 
Old 02-28-2005, 10:25 PM   #4
coolman0stress
Member
 
Registered: Jun 2003
Location: Toronto, Ontario, Canada
Posts: 288

Rep: Reputation: 30
Hi servnov, I was in a similar situation while in college. I was learning all these languages and frameworks and wanted to do some coding on the side for fun. To keep a long story short, almost all of the code I've written in the past month or so has been in Python.

Python is a great language, it has a clean syntax, lots of great libraries and is just fun to program with. For me the main decision in picking Python for my own projects comes down to productivity. I've tried a ton of languages, including C and C++ and while I love both of the later for their own reasons, I found Python to have the shortest "idea to code" transition.

It' simple, I've got an idea, I start up Python and within minutes I've got something going. To me that transition is everything and Python has allowed me to concentrate on the actual coding challenge rather than struggle with the actual language or framework.

Anyway, if you want more info let me know. If you haven't done so, I recommend going through a few tutorials and see if you like Python hands on.

Quote:
I have heard Python is kinda limited for Object oriented stuff, is this true?
Like C++, Python is a multi paradagm programming language. Meaning you can program in many different styles. OOP is just one of the options you have in Python, but if you don't need it (or like it/want it) then you don't have to use it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help in python programming... dirty_bastard Programming 1 08-14-2005 02:00 PM
General thoughts on programming IDEs? Gurduloo Linux - General 4 06-03-2005 11:23 AM
Programming Thoughts Matir Programming 5 01-25-2005 03:19 PM
Programming in Python? Gerardoj Programming 1 09-25-2003 04:55 PM
Programming with python Relfx Linux - Newbie 1 08-22-2001 08:16 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration