Qbasicnews.com
August 19, 2019, 02:24:08 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1] 2 3 4
  Print  
Author Topic: C/C++, which one first  (Read 17624 times)
Nixon
Member
*
Posts: 41



WWW
« on: May 29, 2006, 07:36:51 AM »

I need to learn C/C++ by the end of this year for my course next year, enough to pass a 3 hour test. I was wondering which I should learn first, or doen't it matter. Also does anyone know of any 'from BASIC to C/C++ tutorials'
Logged
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #1 on: May 29, 2006, 07:45:26 AM »

Rule #1: When learning a new language, forget everything about other languages. Just keep algorithmics on mind.

I'd go for C, then C++, as C++ is just C with added junk. You understand C, you'll understand the add-ons.

Learning C will help with your fB coding as well, as mastering the simple concept of pointers and dynamic memory management will open lots of doors Tongue
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
stylin
Ancient QBer
****
Posts: 445


« Reply #2 on: May 29, 2006, 08:16:41 AM »

I'd say learn C++. It's been one of the more predominant languages right now - especially for games - so there is a vast wealth of information available to you.

C is very different from C++. Good/practical techniques in one are not necessarily good in the other. C++ is not just "C with classes", it's a multi-paradigm language that supports different kinds of programming than C (which is procedural). When you're learning C++ the "right way", imo, you'll find that the only similarities to C are some syntax.

Also, I would say that to get started in either language, the learning curve is not as high in C++ (it's alot easier to create a safe dynamic array in C++ than it is in C. plus, you'll be using already tested implementations with your C++ standard library).

Additionally, learning C++ - as opposed to C -  will make it easier to migrate to languages like Java, or C#.
Logged

stylin:
Nixon
Member
*
Posts: 41



WWW
« Reply #3 on: May 31, 2006, 08:19:29 AM »

Well I have begun to learn C. I know enough to make games now, crapy games at that cause I can't get conio working which is a major pain in the butt.

Anyone know of a small (smaller than 10mb) C compilier and IDE, one that can use conio preferably.

Also are there any good libraries I could use for graphical 2d game creation, or any that would be helpful.

One more thing, what is the point in having pointers, apart from pointing to memory locations and linking with variables, whats the use really?
Logged
Peter
Member
*
Posts: 29


« Reply #4 on: May 31, 2006, 08:25:58 AM »

I would suggest C on the fact that most C++ code I've seen is really just C code with some OO tacked on that could have been replicated using other data structures.

Unless you are really gung-ho on OO C++ is kind of a bother.
$0.02
Logged

i]The short answer is 'Yes.' The long answer is 'No.'[/i]
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #5 on: May 31, 2006, 12:02:15 PM »

Quote from: "Peter"
most C++ code I've seen is really just C code with some OO tacked on that could have been replicated using other data structures.


Yay! You're on my team! Cheesy
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
stylin
Ancient QBer
****
Posts: 445


« Reply #6 on: May 31, 2006, 07:20:10 PM »

Hmm, you two need to see more C++ code ...
Logged

stylin:
Peter
Member
*
Posts: 29


« Reply #7 on: May 31, 2006, 08:04:31 PM »

I deal with C++ all the time, I understand the whole different paridigm of programming idea.  It's completely valid, but from the code that I have work with it seems to me that many of the people who work with C++ don't, hence they use those different tools (OO in particular) when they don't have to.

It's all an issue of elegence.  Just because you can use a tool doesn't mean you need to.  Most people don't get thier heads completely around C++ and so that becomes a liability to thier coding.  C has less tricks about it and lets people mong cleaner code.
Logged

i]The short answer is 'Yes.' The long answer is 'No.'[/i]
Anonymous
Guest
« Reply #8 on: May 31, 2006, 09:30:28 PM »

i can tell you after working on a medium sized project (LL, 20k lines without comments/whitespace) that OOP would be invaluable in FB.

OOP is necessary like a chisel is necessary. sure, you could use a flatheaded screwdriver, and it will get the job done (with more effort, more chances to f*** up), but the "chisel" is made for the job.

OOP is made for organizing, encapsulating, genericizing (not a real word), but of course not 100% blaze efficency in every case. You want that? Code in ASM. And then cry when the code you make has to be rewritten all the time to suit special needs when things like templates or function overloading would've reduced the amount of work by a magnitude of 5 or 10 or 20.

Keep in mind, I don't routinely program in c++, FB is my language of choice, but I've learned about the paradigm, and it's really a shame that it hasn't been embraced yet.* Finally web coding seems to be with things like XML. Dividing the data from the code. Encapsulation. Just like seperate objects.

When FB gets OOP I'll show you. ;P

*By many BASIC programmers? ;P
Logged
stylin
Ancient QBer
****
Posts: 445


« Reply #9 on: May 31, 2006, 11:55:28 PM »

Quote from: "Peter"
...from the code that I have work with it seems to me that many of the people who work with C++ don't [fully understand it], hence they use those different tools (OO in particular) when they don't have to.

The way certain people program in a language doesn't have anything to do with the usefullness of that language. I've seen alot of crappy, wasteful and unsafe C code in my time, also; doesn't mean C is all those things.

Quote
It's all an issue of elegence.  Just because you can use a tool doesn't mean you need to.  Most people don't get thier heads completely around C++ and so that becomes a liability to thier coding.  C has less tricks about it and lets people mong cleaner code.

Again, I think it's wrong to say that a language is a bother just because there may be some people that don't know how to use it properly. I would give the OP the benefit of the doubt.

I don't know what you mean by tricks (or "mong", for that matter), but to do some of the more basic and elegant things in C++ - like polymorphism, for example - requires a level of knowledge of C that is much greater than either a beginner or intermediate programmer. C++ takes much of the work involved in memory management and does it for you, unlike C where memory management is always a top-level concern.
Logged

stylin:
TheAdventMaster
Ancient Guru
****
Posts: 671


« Reply #10 on: June 01, 2006, 03:49:42 AM »

Quote
When FB gets OOP I'll show you. ;P
I can't wait.
Logged
Peter
Member
*
Posts: 29


« Reply #11 on: June 01, 2006, 08:33:01 AM »

Quote
Again, I think it's wrong to say that a language is a bother just because there may be some people that don't know how to use it properly. I would give the OP the benefit of the doubt.

I should have as well :oops: I'm just a cranky old man sometimes.

I don't know what you mean by tricks (or "mong", for that matter), but to do some of the more basic and elegant things in C++ - like polymorphism, for example - requires a level of knowledge of C that is much greater than either a beginner or intermediate programmer. C++ takes much of the work involved in memory management and does it for you, unlike C where memory management is always a top-level concern.[/quote]

'Mong' is a really old word for making things or selling things
It's why a person who sells fish is called a Fishmonger.

I like to think of programmers as codemongers, with the internet as code markets (like fish markets) where coders get together and comment on and trade code.  Sometimes my analogies get ahead of me :oops:

In anycase I still go against C++ because of the habits those who program in it poorly tend to get in, namely using OO where you could use a list or even a simple array.  Complexity for Complexities' sake.  I'm not saying OO is bad, OO is a great thing when used correctly, I'm just against people using it where it is innapropriate to do so and I see this quite a lot in C++ code.

I'm actually quite excited about OO coming to FB myself as well. Cheesy
Logged

i]The short answer is 'Yes.' The long answer is 'No.'[/i]
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #12 on: June 01, 2006, 09:01:12 AM »

#1 flaw of C++: it allows for non-OO stuff. As a language, in the purity of the word, it has that incredible flaw. I prefer the cleanness of Java, for instance.

@Cha0s: everything you say about OOP, you can do with procedural languages. It's all just a matter of syntax shortcuts and macros.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
yetifoot
Ancient Guru
****
Posts: 575



« Reply #13 on: June 01, 2006, 09:06:56 AM »

Mong here (England) now means a retard, or at best a very slow, dim-witted person.  ('Special Needs' for the polically correct).  Its a common insult.
Logged

EVEN MEN OF STEEL RUST.
Peter
Member
*
Posts: 29


« Reply #14 on: June 01, 2006, 09:30:12 AM »

Quote
Mong here (England) now means a retard, or at best a very slow, dim-witted person. ('Special Needs' for the polically correct). Its a common insult.

England! What would England know about english! Tongue
Logged

i]The short answer is 'Yes.' The long answer is 'No.'[/i]
Pages: [1] 2 3 4
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!