Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 15th, 2007, 12:41 AM   #11
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
I agree with bigK, learn Python. C or C++ syntax is just too difficult to read for a beginner that wants to learn on his/her own. Go to the Python.org website and download the latest version I think it is Python25 and install it. Python comes for a large number of different systems, like Windows, Linux, MacUnix, so download the right version. In the ".\Python25\Lib\idlelib\" folder you will find a file Idle.pyw, run that file, it is an IDE where you can write Python code in the editor and execute it as a program.
# this is typical Python code

print '-' * 50
for x in range(10): print x
print "Hey I can code in Python!"

You can also use the Idle Python Shell (has >>> prompt), where you can test short Python code one liners on the fly. Type something like 355/113.0 and it will give you pi once you press the enter key.

Compared to C++ Python is a very high level language with a large amount of modules, a nifty memory manager, and many elegant ways to solve a problem.

This short Python code will print the calendar for the month of March 2007:
import calendar

calendar.prmonth(2007, 3)

Want to know more, just ask in the Python forum here!
__________________
I looked it up on the Intergnats!

Last edited by Dietrich; Mar 15th, 2007 at 12:57 AM.
Dietrich is offline   Reply With Quote
Old Mar 15th, 2007, 2:26 AM   #12
bl00dninja
Programming Guru
 
bl00dninja's Avatar
 
Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 5 bl00dninja is on a distinguished road
"wat" you need to do is try harder or learn to search better or give up. it's NOT that hard. read the tutorial a million times if it takes that. oh yeah, and stop that 1337 spelling crap, you come off like an ignorant asshole.
__________________
i put on my robe and wizard hat...

Have you ever heard of Plato, Aristotle, Socrates?...Morons.
bl00dninja is offline   Reply With Quote
Old Mar 15th, 2007, 3:45 AM   #13
Soulstorm
Hobbyist Programmer
 
Soulstorm's Avatar
 
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 243
Rep Power: 3 Soulstorm is on a distinguished road
Quote:
Originally Posted by Duck
Seriously though I stated that as an opinion not a fact
Accepted. I also have my opinions. Besides, the way everyone learns a language is a personal matter.

Quote:
Originally Posted by Duck
I learnt C and C++ from 2 very good books by the author, Herbert Schildt, where the first version taught C and the second C++. And to start the C++ one the reader had to have read the C version (or know C by whatever means) first. For me it was a natural progression.
Allow me to disagree about Herbert here. He is the worst writer about programming books that I (and many other reviewers at accu.org) have ever seen. If that's your only resource, then allow me to suggest you buy yourself another book to see what those books make you miss.

Quote:
Originally Posted by Duck
I find this misleading, there are virtually no differences between C and C++, except that C++ is a subset of C. Therefore virtually everything that is C is C++.
I imagine you want to say that C is a subset of C++, not the other way around. I will therefore answer to the corrected statement.

I disagree with you on this one, too. This is the reason.

Quote:
Originally Posted by wikipedia
Nearly a superset of C, C++ now supports most of C, with a few relevant exceptions (mostly of stronger typing restriction; see Compatibility of C and C++ for an exhaustive list of differences).
I think that implies that some code written in C will not compile in C++. I am sure more experienced members in here will have some examples to give you. I don't because I have only gotten involved with C a little. You can also look here to see some incompatibilities.
__________________
Project::Soulstorm (personal homepage)
Soulstorm is offline   Reply With Quote
Old Mar 15th, 2007, 5:37 AM   #14
Duck
Programmer
 
Join Date: Jun 2006
Location: England London
Posts: 72
Rep Power: 3 Duck is on a distinguished road
Quote:
Originally Posted by Soulstorm View Post

I imagine you want to say that C is a subset of C++, not the other way around. I will therefore answer to the corrected statement.

I disagree with you on this one, too. This is the reason.

Quote:
Originally Posted by wikipedia
Nearly a superset of C, C++ now supports most of C, with a few relevant exceptions (mostly of stronger typing restriction; see Compatibility of C and C++ for an exhaustive list of differences).
I think that implies that some code written in C will not compile in C++. I am sure more experienced members in here will have some examples to give you. I don't because I have only gotten involved with C a little. You can also look here to see some incompatibilities.
Yes some code written in C will not compile in C++, I did not deny this. I just said the differences are few and minor, which the wikipedia article implys also.
Duck is offline   Reply With Quote
Old Mar 15th, 2007, 9:45 AM   #15
Seif
Hobbyist Programmer
 
Seif's Avatar
 
Join Date: Jan 2006
Location: UK
Posts: 215
Rep Power: 3 Seif is on a distinguished road
I can see no possible benefit you would get from learning C instead of C++ on the off. Just more work when you need to make the switch in my opinion.
Seif is offline   Reply With Quote
Old Mar 15th, 2007, 1:03 PM   #16
saut3r
Newbie
 
Join Date: Mar 2007
Posts: 8
Rep Power: 0 saut3r is an unknown quantity at this point
Thanks for all the posts.
And i never said i tried to learn both at the same time. I tried to learn C++ couldnt find a good program to run it on, so someone recommended me to learn python first.
saut3r is offline   Reply With Quote
Old Mar 15th, 2007, 6:37 PM   #17
bl00dninja
Programming Guru
 
bl00dninja's Avatar
 
Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 5 bl00dninja is on a distinguished road
probably the only major benefit would be in character strings and arrays...C forces you to deal with that issue. it just gives you a better understanding of what a char* actually is. although with new libraries, this is probably irrelevant.
__________________
i put on my robe and wizard hat...

Have you ever heard of Plato, Aristotle, Socrates?...Morons.
bl00dninja is offline   Reply With Quote
Old Mar 15th, 2007, 7:37 PM   #18
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
I tried to learn C++ couldnt find a good program to run it on,
What does that mean? Compiler? Pre-built program like "hello, world"???
Quote:
probably the only major benefit would be in character strings and arrays
You're joking. Or the Clydesdales have trampled you.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Mar 16th, 2007, 4:45 AM   #19
Soulstorm
Hobbyist Programmer
 
Soulstorm's Avatar
 
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 243
Rep Power: 3 Soulstorm is on a distinguished road
Quote:
it just gives you a better understanding of what a char* actually is.
A good book can give you a better understanding of what a char* is. Not a language.
__________________
Project::Soulstorm (personal homepage)
Soulstorm is offline   Reply With Quote
Old Mar 16th, 2007, 6:11 AM   #20
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,221
Rep Power: 5 grumpy is on a distinguished road
Quote:
Originally Posted by Duck View Post
Yes some code written in C will not compile in C++, I did not deny this. I just said the differences are few and minor, which the wikipedia article implys also.
One of the guiding principles of C++ was backward compatibility with the 1989 C standard, wherever possible.

There are some cases where code that will be accepted by a 1989-standard-compliant compiler will fail to compile, or compile with different results, when fed to a C++ compiler. Most of the code that won't compile uses features that are rarely used in C, or are generally considered poor practice in both C and C++. Annex C of the C++ standard describes the differences.

This situation changed with the 1999 C standard, which introduced several language and library features that are incompatible with C++ language and library features. Some of them are quite significant, to the extent that some features of C99 have the same name as some C++ features but different meaning. In fact, there is occasionally some speculation that some of the incompatibilities introduced in the 1999 C standard were deliberate (i.e. that some incompatibilities were introduced to increase incompatibilities with C++) because the specifications seem rather contrived eg relying on "compiler magic" -- something that the 1989 C standard went to some lengths to avoid -- or having a name that is the same as a C++ keyword but, in C99, is a macro which expands to a keyword with an underscore as a leading character. Since #define'ing keywords yields undefined behaviour in both languages, and names with leading underscores are reserved to implementations, this means there is no way of using those features in code without upsetting either a C or a C++ compiler. And some of the features (bool, true, false, complex) are the sort that programmers will often use.
grumpy is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:42 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC