C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
CIO Insight
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old February 2nd, 2002, 12:35 AM
Michael_Bray Michael_Bray is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Sydney, NSW, Australia
Posts: 40 Michael_Bray User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to Michael_Bray
C or C++

Hi,

I am a first year uni student. I can Program in Perl and PHP currently, however I would like to move into the area of

1) Developing windows applications in C or C++.
2) Developing CGI applications/Apache modules in C or C++.

I have not started to learn this languages yet, however I am not sure which one I should learn. My understanding is that they are both similar, but C++ allows object orientated programming.

Is C a good language to learn for the objectives I wrote above, or is C++ more suited to this? Any advice and/or reasons would be greatly appreciated. Thanks in advance.
__________________
Cheers,
Michael Bray

Reply With Quote
  #2  
Old February 2nd, 2002, 02:29 AM
Lord MJ Lord MJ is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Posts: 34 Lord MJ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 57 m 2 sec
Reputation Power: 7
Send a message via AIM to Lord MJ Send a message via Yahoo to Lord MJ
Learn C first. As everything that you know from C will be able to be used in C++. Have some experience with Java too, so learning C++'s OO will be an easier experience.

Reply With Quote
  #3  
Old February 2nd, 2002, 01:23 PM
jonsagara's Avatar
jonsagara jonsagara is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: USA
Posts: 286 jonsagara User rank is Private First Class (20 - 50 Reputation Level)jonsagara User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 m 23 sec
Reputation Power: 7
1) C++. Once you learn C++, you can use MFC to create windows apps. You can also use straight C to interact with the Windows API, but that's overkill. But as said before, you should learn C first. C++ is a superset of C.
2) Sorry, never done any of this.
__________________
Jon Sagara

"Me fail English? That's unpossible!"

Reply With Quote
  #4  
Old February 2nd, 2002, 03:17 PM
realnowhereman realnowhereman is offline
Not there when you need me
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Oct 2001
Location: Berlin, Germany
Posts: 1,438 realnowhereman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 46 sec
Reputation Power: 8
2) CGI: whatever language you want, so long as it can do input and output. Both C and C++ are OK, although I find C++ better for this (never done it myself, though). It's the difference between
Code:
printf( "Content-Type: text/html\n\n<html>..." );

and
Code:
cout << "Content-Type: text/html" << endl << endl << "<html>...";

(I'm not sure if that's correct at all.)

Apache mods: they seem to be C, but you'll want to take a look at the docs.

Reply With Quote
  #5  
Old February 3rd, 2002, 04:46 AM
Michael_Bray Michael_Bray is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Sydney, NSW, Australia
Posts: 40 Michael_Bray User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to Michael_Bray
Thanks for your advice. Just another quick question related to this topic, is C# a better pathway to take then C++ is after I have got my head around C?

I have to admit, C# seems to have come out of no where and now all of a sudden I am seeing it alot. I have no idea how it differs from other variants, so any info on that would be greatly appreciated as well.

Reply With Quote
  #6  
Old February 3rd, 2002, 05:04 AM
realnowhereman realnowhereman is offline
Not there when you need me
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Oct 2001
Location: Berlin, Germany
Posts: 1,438 realnowhereman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 46 sec
Reputation Power: 8
Not really better, C# is another language. One that may be more interesting for Basic programmers.

Definitely learn C++. It won't die out for at least a decade.

Reply With Quote
  #7  
Old February 3rd, 2002, 10:11 AM
jonsagara's Avatar
jonsagara jonsagara is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: USA
Posts: 286 jonsagara User rank is Private First Class (20 - 50 Reputation Level)jonsagara User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 m 23 sec
Reputation Power: 7
If performance matters, then go with C++. C# is slower.

Reply With Quote
  #8  
Old February 4th, 2002, 09:11 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,827 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 22 h 57 m 29 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
You should learn C first. It will build a strong foundation for the C++ along with other languages that you may learn later on.

1)If you are going to be doing only windows os operating system then learning C++ and MFC is the way to go. Especially if you are going to be using such things as database grids which is most definately best done with objects. The downside to MFC is that it can be overly complex at times and you can only use it on windoze.

2)This is just a prefence to me. I really haven't found many cases where C++ was needed over C when doing CGI applications. If you don't need C++ it is sometimes easier to use C. It compiles faster and uses less code (for most cases).

jonsagara:
How is using the windows api overkill? It is definately good practice to know how to use them. Even if there are covered by MFC in C++, for years all that you could do was use the API and it is a good thing to know how to use them, even if it is something just as simple as using sleep. This helps more now when doing VB.

Reply With Quote
  #9  
Old February 4th, 2002, 09:17 AM
realnowhereman realnowhereman is offline
Not there when you need me
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Oct 2001
Location: Berlin, Germany
Posts: 1,438 realnowhereman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 46 sec
Reputation Power: 8
Onslaught: using the API for drawing complete windows and making apps is overkill. Of course, using an API function here and there to do stuff is not. After all, what are the reference books and the MSDN for? If you need to do something below MFC level, you just look it up when needed.

Reply With Quote
  #10  
Old February 4th, 2002, 09:27 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,827 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 22 h 57 m 29 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
Ok, I guess I missread his post. I wasn't talking about using the api just for writting a window in C++, that is pointless when there are better tools for the job. It just sounded to me that he was saying there was no need to know the api, when they still have plenty of purpose even with the tools that MFC provides.

Reply With Quote
  #11  
Old February 4th, 2002, 10:42 AM
jonsagara's Avatar
jonsagara jonsagara is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: USA
Posts: 286 jonsagara User rank is Private First Class (20 - 50 Reputation Level)jonsagara User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 m 23 sec
Reputation Power: 7
Onslaught:
I should have been more clear. Like realnowhereman said, I feel it is a tremendous waste to try to build Windows applications from scratch when libraries like MFC and WTL are available. I also agree that understanding the underlying API really helps you to understand MFC. Like any aspect of programming, each tool has its use. It's up to you and me to figure out the appropriate time to use each tool.

Reply With Quote
  #12  
Old February 4th, 2002, 11:21 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,827 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 22 h 57 m 29 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
Now that statement I totaly agree with.

Now I have a question? Has anyone tried using wxWindows? I have started playing around with it a little for making cross-os applications. Wish it was a little more stable.

Reply With Quote
  #13  
Old February 4th, 2002, 11:23 AM
realnowhereman realnowhereman is offline
Not there when you need me
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Oct 2001
Location: Berlin, Germany
Posts: 1,438 realnowhereman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 46 sec
Reputation Power: 8
I haven't tried it, just would like to say that it looks imho ugly. Try GTK - it's quite easy (at least for those who can C (I can't)) and you can do cross-platform stuff with it.

Reply With Quote
  #14  
Old February 4th, 2002, 11:34 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,827 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 22 h 57 m 29 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
Thanks, I will have to check that out.

Reply With Quote
  #15  
Old February 5th, 2002, 07:15 AM
Taradino Taradino is offline
Python Prophet
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Amersfoort, The Netherlands
Posts: 45 Taradino User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Quote:
Originally posted by Onslaught
Now that statement I totaly agree with.

Now I have a question? Has anyone tried using wxWindows? I have started playing around with it a little for making cross-os applications. Wish it was a little more stable.
Yep, I do. I'm using it for a mail/news client in Python with the Python bindings for wxWindows. Although I don't know about the framework that is provided for developing cross-os apps, as this is already provided by Python, I think the GUI library is one of the best on for cross-os development. I don't know if you've ever used QT, but they're quite alike, except for the fact that wxWindows is really free(LGPL).

Quote:
Originally posted by realnowheremon
I haven't tried it, just would like to say that it looks imho ugly. Try GTK - it's quite easy (at least for those who can C (I can't)) and you can do cross-platform stuff with it.
Ugly? wxWindows uses native libraries for every platform, GTK+ or Motif for Unix, and the standard API's for Win32 and MacOS. So probably you think one of these is ugly, probably Motif, but instead of Motif you can also use GTK+, which you recommended yourself.
__________________
Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. - Jamie Zawinski, in comp.lang.emacs

Reply With Quote