#35959 - PD.v90 - Sun Feb 13, 2005 5:22 pm
From what i understand, it is not completly safe for the computer to program in C....And i am just 14 years old,maybe i should wait with learning C++ or what do you think?
_________________
You fool darkness will come to us all in the end.
A fox fought a fight against another fox in Philadelphia.
#35968 - zazery - Sun Feb 13, 2005 6:43 pm
I never found it too early to start programming, I learnt BASIC when I was around 10 and went on learning C on and off for the next few years. I believe there are some good resources in the FAQ in the beginners section.
I personally recommend that you start learning a bit of BASIC, but keep in mind that the code is entirely different from C or C++. I know some people will disagree with me and tell you to learn C directly.
So you are not confused, C++ is an extension of C and it's probably easier to learn C before C++.
QBASIC LINKS
#35972 - Abscissa - Sun Feb 13, 2005 7:22 pm
There's no reason to wait to learn C (or anything for that matter) unless it's just too hard at first. I was learning C when I was 12. You can screw up the computer with C, but only if you're trying to. The worst you could possibly do on accident is make the system need a reboot, and even that's become pretty rare thanks to Win2k/XP.
#35984 - sajiimori - Sun Feb 13, 2005 9:26 pm
Yeah, when people say C is "unsafe", they don't mean you're more likely to harm your computer. Loosely speaking, they're talking about how likely it is that you'll make a mistake that will cause your own program to crash. C++ is just as unsafe as C in that regard (along with some workarounds... and new ways to screw yourself, too).
I agree that learning BASIC first is a good idea. It's important to abandon BASIC before you try to write anything big (more than a few pages) because you'll start picking up some very bad habits that are hard to fix.
Also, spend some time with an assembly language before learning C, or you'll invariably come back asking what all this "pointer" nonsense is. ^_^
#35993 - Miked0801 - Sun Feb 13, 2005 10:21 pm
Lol. I was thinking why tell a newb to learn assembler first off until I remembered a conversation I had a few days ago where I compared just about all assembler languages to basic. Assembler being basic with a fixed number of "variables" with funky names :)
#35995 - MumblyJoe - Sun Feb 13, 2005 10:36 pm
I agree to a point, learning BASIC first gives you a good place to play around and pick up some procedural ideas, but in my opinion learn C++ after BASIC before stepping back to C as you will develop better habits and it will make you a more versatile coder in the future. And yeah, everyone should absolutely always learn at least some assembly language as it really expands your mind to the whole idea of coding.
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!
#35999 - sajiimori - Sun Feb 13, 2005 11:31 pm
MumblyJoe, I'm interested to know why you'd recommend a very simple language to start with, but not an incrementally more complex language following that (instead of an order-of-magnitude increase in complexity).
#36002 - tepples - Sun Feb 13, 2005 11:50 pm
Remember we're dealing with ARM, not x86. Assembly language on a simple architecture such as 6502 or ARM is conceptually very simple, as long as you don't immediately try to jump into 100% asm programs. I learned my first assembly language (6502 asm) while writing graphics and sound subroutines for my Apple II BASIC programs.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#36006 - poslundc - Mon Feb 14, 2005 1:36 am
I don't really have an opinion to venture forth on this topic, but I find it interesting nonetheless.
Speaking as someone who first learned to code in LOGO, then in BASIC (both on the Apple IIc), I had the advantage/disadvantage of working in languages that were very high-level, but probably in some ways much lower-level than modern languages... or at least more cumbersome.
Although I had some exposure to assembly code early on, I found it intimidating and didn't return to it, probably until I hit university. When I finally started programming MIPS then (and even lower-level stuff like VHDL), I found the low-level aspect of it filled a void I'd frankly been missing since my BASIC programming days.
Of course, back before compilers, everyone started out on assembly language. Nowadays, though, people start on stuff like Visual BASIC and JavaScript, and have OOP thrown at them from day one. It makes me wonder if modern programming languages are more useful to experienced programmers (who can make sagacious use of their features) than they are as learning tools beginners (who may become dependent on tools they don't really understand).
Dan.
#36008 - ecurtz - Mon Feb 14, 2005 2:34 am
Karel the Robot: A Gentle Introduction to Programming is available in a variety of versions similar to C, C++, or Java depending on what you think you'd like to learn. (C if you want to do GBA programming.)
#36009 - sajiimori - Mon Feb 14, 2005 2:57 am
Quote: |
It makes me wonder if modern programming languages are more useful to experienced programmers (who can make sagacious use of their features) than they are as learning tools beginners (who may become dependent on tools they don't really understand). |
Agreed, and I'd even go further by saying that many (most?) professional programmers are dependent on language features they don't understand. Recent "Computer Science" courses basically amount to Java certification.
#36013 - Abscissa - Mon Feb 14, 2005 5:13 am
poslundc wrote: |
Speaking as someone who first learned to code in LOGO, then in BASIC (both on the Apple IIc), |
Hey, that exactly where I started! Even down to the 'c' in the model name. :) Then I moved on to Apple II machine code (Yes, machine code, not asm. I didn't have an assember or even know what one was :) )
But that does remind me, LOGO (especially in command-line interpreted mode) is an excellent first-time-programmer language. You'll outgrow it very, very fast, but the instant graphical feedback is great for teaching the very basics of procedural code (And contrary to what many CS professors I've met believe, understanding procedural code is essential to grasp before OOP will make any sense.)
#36015 - Abscissa - Mon Feb 14, 2005 5:32 am
Also, I wouldn't worry too much about the order that you learn things. If it's too soon for you to learn something, then you just simply won't understand it; it's not like it's gonna screw you up or anything ;). Just make a note of whatever it was that didn't make sense. Then go learn whatever does make sense. That will eventually get you to the point where you'll be able to understand the things you couldn't before.
#36018 - gauauu - Mon Feb 14, 2005 6:32 am
Abscissa wrote: |
Then I moved on to Apple II machine code |
Wow...exactly what I did as well. It was sure a big pain in the butt doing the conversion from opcodes to hex values using a chart in my "inside the apple IIe" book, but dang was it interesting.
#36034 - MumblyJoe - Mon Feb 14, 2005 3:26 pm
sajiimori wrote: |
MumblyJoe, I'm interested to know why you'd recommend a very simple language to start with, but not an incrementally more complex language following that (instead of an order-of-magnitude increase in complexity). |
Because in my experience, C++ isn't what most people think. Most people treat it as an enhanced C, and I find that those people generally learnt C first and got used to the way C works. Besides that, I have seen people take classes to learn C, and the way they are forced into printf/scanf/#defines/structs etc almost seems cruel to an extent, and I ended up having to help a lot of them. C++ However I feel prepares you to step backwards (as I see it) to C when you need to (and you do need to sooner or later, C is too old to not be everywhere). So in summary, I feel that in all cases (and I mean all, not just some) that C++ is a far better place to start (after toying with something simple like QBASIC) because it is easier to learn and gives you more desirable skills.
This however, is true. It goes mostly against my previous remarks at the top of this post, that C++ is better to learn for you. I agree that C is a better choice if the GBA is your main goal. This is NOT because it is better suited to it (I use C++ with all the bells and whistles for GBA and anyone who says thats a bad idea just doesn't know how to do it just right). I say that C is better for a starting GBA programmer because it's what all the availiable tutorials and source code uses in nearly all cases, and this is greatly benificial.
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!
#36038 - dagamer34 - Mon Feb 14, 2005 3:41 pm
MumblyJoe wrote: |
sajiimori wrote: | MumblyJoe, I'm interested to know why you'd recommend a very simple language to start with, but not an incrementally more complex language following that (instead of an order-of-magnitude increase in complexity). |
Because in my experience, C++ isn't what most people think. Most people treat it as an enhanced C, and I find that those people generally learnt C first and got used to the way C works. Besides that, I have seen people take classes to learn C, and the way they are forced into printf/scanf/#defines/structs etc almost seems cruel to an extent, and I ended up having to help a lot of them. C++ However I feel prepares you to step backwards (as I see it) to C when you need to (and you do need to sooner or later, C is too old to not be everywhere). So in summary, I feel that in all cases (and I mean all, not just some) that C++ is a far better place to start (after toying with something simple like QBASIC) because it is easier to learn and gives you more desirable skills.
This however, is true. It goes mostly against my previous remarks at the top of this post, that C++ is better to learn for you. I agree that C is a better choice if the GBA is your main goal. This is NOT because it is better suited to it (I use C++ with all the bells and whistles for GBA and anyone who says thats a bad idea just doesn't know how to do it just right). I say that C is better for a starting GBA programmer because it's what all the availiable tutorials and source code uses in nearly all cases, and this is greatly benificial. |
More specifially, there is no C++ specific code in most of the tutorials available. And often you end up not really using C++ specific code until you are doing higher-level code such as general game design and such. If you make a library, C++ won't be everywhere because C-style code is more efficient.
_________________
Little kids and Playstation 2's don't mix. :(
#36050 - Abscissa - Mon Feb 14, 2005 5:51 pm
MumblyJoe wrote: |
Most people treat it as an enhanced C, and I find that those people generally learnt C first and got used to the way C works. Besides that, I have seen people take classes to learn C, and the way they are forced into printf/scanf/#defines/structs etc almost seems cruel to an extent, and I ended up having to help a lot of them. C++ However I feel prepares you to step backwards (as I see it) to C when you need to (and you do need to sooner or later, C is too old to not be everywhere). So in summary, I feel that in all cases (and I mean all, not just some) that C++ is a far better place to start (after toying with something simple like QBASIC) because it is easier to learn and gives you more desirable skills. |
I've seen it go the other way too though. I've seen a lot of people who started out on OOP-heavy Java pick up a bunch of inefficient and totally overkill habits, and then find it very difficult to learn how to do anything low-level or embedded.
#36060 - poslundc - Mon Feb 14, 2005 7:05 pm
I've given a little more thought to this topic, and again, I have yet to really formulate an opinion. But speaking as someone who has taught C programming in a university environment for a number of years (as a classroom instructor for first-year engineers primarily), I think it's easy to take for granted the notion that high-level == easier to learn.
For instance, I wonder if it would have been easier for some of my students (the ones who wanted to be civil or nuclear engineers, rather than software or computer engineers) to start in RISC assembly, and then "graduate" from that to C. Assembly may be ugly, but it's honest and there is no obfuscation between code and what the hardware does. They would need some kind of interpreter or GUI that lets them step through their programs and view the contents of the registers, and they wouldn't be able to do anything with standard input, and I wouldn't even go so far as attempting to do any string-related programming. But I think the people who found C difficult to grasp would probably find assembly much more straightforward. Then when they moved onto C they would be in a much better position to appreciate the advantages it affords them over assembly-level coding.
There were far too many times in class - such as when describing the ANSI console-library routines to them - that I would have to say things like "you aren't expected to understand how or why this works". And God help them if they had been expected to learn C++ I/O streaming.
What's convenient for an experienced programmer is useful because they are experienced enough to know why it's convenient. High level == quicker gratification, but it's kind of like the dark side of the force that way. :D
Dan.
#36066 - sajiimori - Mon Feb 14, 2005 8:27 pm
Quote: |
Because in my experience, C++ isn't what most people think. Most people treat it as an enhanced C, and I find that those people generally learnt C first and got used to the way C works. |
I find it self-evident that C++ is an enhanced C, and I find it just as obvious that understanding C++ requires knowing how C works, so there's not much for me to talk about here.
Quote: |
Besides that, I have seen people take classes to learn C, and the way they are forced into printf/scanf/#defines/structs etc almost seems cruel to an extent, and I ended up having to help a lot of them. |
Yeah, it takes work to learn things from the bottom up. The level of understanding achieved will be priceless.
Quote: |
Assembly may be ugly, but it's honest and there is no obfuscation between code and what the hardware does. |
That's a great word to describe a positive quality of assembly programming. I'd probably replace "obfuscation" with "abstraction" though. They both hide the way things work, but one makes things harder to understand and maintain, and the other... well, without it there wouldn't have been an information revolution.
Quote: |
High level == quicker gratification, but it's kind of like the dark side of the force that way. :D |
Only for a beginner -- or you can call me Darth Vader! :)
#36095 - MumblyJoe - Tue Feb 15, 2005 12:42 am
sajiimori wrote: |
I find it self-evident that C++ is an enhanced C, and I find it just as obvious that understanding C++ requires knowing how C works, so there's not much for me to talk about here.
|
I would say that understanding C++ needs no knowledge of C, but it helps some things. I mean really, if you understood C++ to a great enough extent, the only C features you wouldn't have been exposed to would be really crappy ways of declaring things and performing tasks, because C++ shares all of C's features (including the standard C library).
sajiimori wrote: |
Yeah, it takes work to learn things from the bottom up. The level of understanding achieved will be priceless.
|
I agree, I have personally become a far better coder (particularly for embedded work) since learning digital electronics through to assembly through to higher level languages through to technologies like .NET, but this process has taken quite some time as you can imagine. Learning everything you can always makes you a better coder. I entirely agree that learning C is absolutely priceless, because you will need to know it without a doubt, I just don't agree with the order most people feel about learning languages.
I have read books that say "You need to learn to walk before you learn to run" when discussing which language to learn first out of C/C++. I find that quote very true, C compared to C++ is like walking compared to running, but its walking backwards in clogs through knee deep syrup compared to running through a maze for a new coder. Thats why BASIC is important, it's a good enough grounding in procedural languages for anyone, then they can move on and learn a better way of programming, not just a cooler way of writing procedural code. Of course once again, with the GBA, beginners go for C without a doubt :P
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!
#36120 - poslundc - Tue Feb 15, 2005 4:26 am
MumblyJoe wrote: |
Thats why BASIC is important, it's a good enough grounding in procedural languages for anyone, then they can move on and learn a better way of programming, not just a cooler way of writing procedural code. |
Modern BASIC (by which I generally refer to MS's Visual BASIC, as that's the only modern version of BASIC I've really been exposed to) is so homogenized that I don't think it has an appreciably different learning curve from C. While C has a more rigid syntax, the complexity of syntax rules isn't what really affects the ease of learning, I find, since VB just makes all of the C syntax features available to you one way or another.
Give them line-number BASIC where they've got a reduced instruction set, the only primitive types are number, string and array, they're forced to use GOTOs and GOSUBs to branch around and PEEK and POKE for direct memory accesses. Then plonk them down in C a month later and watch them revel in its high-level sweetness... suddenly stuff like prototypes and macros and pointers seem a lot less daunting when you understand why they're there.
Nowadays, I'd say the only way BASIC makes a better starting point than C is if you can convince them to use the reduced subset of instructions and take advantage of features that originally made BASIC for Beginners. Sure, you can still just assign values to variables in VB and it will work, but I'll bet 90% of tutorials teach you to use "Dim <var> As <type>" instead. So what's the point?
Dan.
#36121 - MumblyJoe - Tue Feb 15, 2005 5:18 am
I mean't QBASIC, VisualBasic is created for the sole purpose of pissing me off. I'm serious, I asked someone at Microsoft and they said "Yes Joe, we created VisualBasic specifically to piss you off, we want you to watch all your coding newsgroups fill up with questions from dingbats about how to make tray icons flash and shit like that."
Regardless, I see your point, if stuck with VisualBasic I can see how it just dilutes the issue of a first language even more. Maybe a compromise then? How about the idea that a new coder should learn C, but has to compile it in C++ mode so they are forced to learn to be type safe and can slowly add new ideas such as templates/inheritance into code as they learn it?
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!
#36126 - tepples - Tue Feb 15, 2005 6:25 am
poslundc wrote: |
Modern BASIC (by which I generally refer to MS's Visual BASIC, as that's the only modern version of BASIC I've really been exposed to) is so homogenized that I don't think it has an appreciably different learning curve from C. |
Darn right. Microsoft's QBasic and Visual Basic, along with several of the minority BASIC environments, with names such as Liberty BASIC, Real BASIC, and True BASIC, are just as much ALGOL-clones as Pascal or C.
Quote: |
Give them line-number BASIC where they've got a reduced instruction set, the only primitive types are number, string and array, they're forced to use GOTOs and GOSUBs to branch around and PEEK and POKE for direct memory accesses. Then plonk them down in C a month later and watch them revel in its high-level sweetness... |
Or watch them just look up C's 'goto' instruction. I for one needed the ALGOL-clone sweetness of QBasic to get me in the habit of writing DO WHILE ... LOOP during my transition from Applesoft BASIC to C.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#36170 - poslundc - Tue Feb 15, 2005 5:39 pm
tepples wrote: |
Or watch them just look up C's 'goto' instruction. |
The difference: good luck finding a C tutorial or primer that mentions "goto"*. Heck, I was probably programming C for five years or so before I realized "goto" existed in C when I saw it in someone else's demo code. And my first thought? "This goto could be eliminated with a better-structured loop."
* - I realize some people are literal enough to take this as an actual challenge; I haven't bothered to see if any tutorials actually mention goto or not, but if they do it's most likely for completion's sake and not to actually advocate its use.
Dan.
#36174 - tepples - Tue Feb 15, 2005 6:17 pm
poslundc wrote: |
Heck, I was probably programming C for five years or so before I realized "goto" existed in C when I saw it in someone else's demo code. And my first thought? "This goto could be eliminated with a better-structured loop." |
I took your challenge and found this Python-C API reference, which advocates using goto to handle exceptions.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#36179 - poslundc - Tue Feb 15, 2005 7:01 pm
Mazeltov. :)
Dan.
#36183 - Miked0801 - Tue Feb 15, 2005 7:57 pm
My old C primer book acutally has a section on goto and when it may - may - be okay to use it. Think of a section fo code buried 3 or 4 levels deep in loops an difs and an I/O or other fatal error occurs. Either right a crap load of cehck error/break commands or a single goto to jump out.
#36184 - sajiimori - Tue Feb 15, 2005 7:59 pm
Quote: |
I mean really, if you understood C++ to a great enough extent, the only C features you wouldn't have been exposed to would be really crappy ways of declaring things and performing tasks, because C++ shares all of C's features (including the standard C library). |
If you knew the language well enough, you'd be exposed to those things too, exactly because C++ shares all of C's features.
Also, be careful throwing around terms like "really crappy". Try working with some higher order languages and then look back at the massive blob of incoherent features that constitute C++! :)
Quote: |
I find that quote very true, C compared to C++ is like walking compared to running, but its walking backwards in clogs through knee deep syrup compared to running through a maze for a new coder. |
I tend to think about the entire process, from BASIC to assembly to C and beyond, as a steady walk. Jumping to C++ seems like running on well-worn (and often suboptimal) paths and never looking to the side lest you confuse yourself with underlying concepts that you don't understand.
#36191 - MumblyJoe - Tue Feb 15, 2005 10:45 pm
sajiimori wrote: |
I tend to think about the entire process, from BASIC to assembly to C and beyond, as a steady walk. Jumping to C++ seems like running on well-worn (and often suboptimal) paths and never looking to the side lest you confuse yourself with underlying concepts that you don't understand. |
If you want suboptimal, think about a function which decides what types it is outputting to the console at run time based string of characters. Not trying to extend this off-topic C vs. C++ part of the thread any further than in relation to learners beginning, but had to point that out.
As for "underlying concepts you don't understand", sure that will happen if you read some lousy Teach Yourself Whatever in 24 Hours book then never ever read anything else, but if you go on to read some of the greats by Scott Myers, Bruce Eckel etc etc you will learn it all sooner or later.
Anyway, your arguments are swaying me over to the dark side a little, and I still think that learning C but compiled in C++ mode is a good compromise.
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!
#36197 - sajiimori - Tue Feb 15, 2005 11:26 pm
Quote: |
If you want suboptimal, think about a function which decides what types it is outputting to the console at run time based string of characters. |
There are several things wrong with that statement.
1. Many languages use format strings. C# and Common Lisp are two that I've used. You're picking a big fight.
2. The relative speeds of sprintf and ostream depend entirely on the case. Sometimes it's slower to repeatedly call and return from various output routines when using a long string of ostream calls.
3. The implementation of a string of ostream calls can be replicated in C by explicitly naming the output routines for each type. The need to do this is one reason I like ostream better than sprintf, but it is an issue of convenience and consistency, not efficiency.
4. Speaking of efficiency, text output is not a bottleneck for the vast majority of applications.
Quote: |
...you will learn it all sooner or later. |
That's probably the best argument for your position. I just don't like the whole "trust me, just memorize this now and it will make sense later." If a book tells me that often (or silently requires it of me), I usually put it down.
It may just be a personal thing, but doing the top-to-bottom-to-top learning routine is confusing to me. On my way down, I'm frantically trying to fix my views of the higher levels based on all the new information, and on the way back up I'm frantically trying to forget everything I learned the first time I was at the top.
Starting at the bottom gives me a clean slate, so I can simply add to it and not retrofit anything.
Quote: |
I still think that learning C but compiled in C++ mode is a good compromise. |
Whatever floats your boat. ;) I don't see much of a difference.
#36203 - Abscissa - Wed Feb 16, 2005 2:48 am
tepples wrote: |
Quote: | Give them line-number BASIC where they've got a reduced instruction set, the only primitive types are number, string and array, they're forced to use GOTOs and GOSUBs to branch around and PEEK and POKE for direct memory accesses. Then plonk them down in C a month later and watch them revel in its high-level sweetness... |
Or watch them just look up C's 'goto' instruction. I for one needed the ALGOL-clone sweetness of QBasic to get me in the habit of writing DO WHILE ... LOOP during my transition from Applesoft BASIC to C. |
I have to admit, when I started using C, it did take me awhile to completely break out of the habit of using the occasional goto.
#36209 - poslundc - Wed Feb 16, 2005 3:18 am
Abscissa wrote: |
I have to admit, when I started using C, it did take me awhile to completely break out of the habit of using the occasional goto. |
Interesting. Maybe goto is a bigger part of the C-learning experience than I thought it was.
Dan.
#36210 - sajiimori - Wed Feb 16, 2005 3:33 am
I spent way too much time with BASIC (due to lack of hardware and software resources to move beyond it). By the time I had the opportunity to write something in C, I was absolutely starving for the structure it offered and I rejected gotos out of spite. :)
#36212 - Abscissa - Wed Feb 16, 2005 3:51 am
poslundc wrote: |
Abscissa wrote: | I have to admit, when I started using C, it did take me awhile to completely break out of the habit of using the occasional goto. |
Interesting. Maybe goto is a bigger part of the C-learning experience than I thought it was. |
Well, for me it was probably just a matter of having used BASIC for so long. Every C book I read kept stressing that "although goto's are allowed, they should be avoided". It took a little while for all of the "correct" ways of utilizing block and nested loops and conditionals to fully sink in, so there were some situations where I would just fall-back to the old goto way of doing things.
#36222 - sgeos - Wed Feb 16, 2005 4:57 am
Abscissa wrote: |
Well, for me it was probably just a matter of having used BASIC for so long. Every C book I read kept stressing that "although goto's are allowed, they should be avoided". It took a little while for all of the "correct" ways of utilizing block and nested loops and conditionals to fully sink in, so there were some situations where I would just fall-back to the old goto way of doing things. |
Hence the argument that learning basic first can actually be damaging. When I first started learning C, my tutor told me to forget everything I had ever learned about basic.
-Brendan
#36225 - Abscissa - Wed Feb 16, 2005 7:15 am
sgeos wrote: |
Abscissa wrote: | Well, for me it was probably just a matter of having used BASIC for so long. Every C book I read kept stressing that "although goto's are allowed, they should be avoided". It took a little while for all of the "correct" ways of utilizing block and nested loops and conditionals to fully sink in, so there were some situations where I would just fall-back to the old goto way of doing things. |
Hence the argument that learning basic first can actually be damaging. When I first started learning C, my tutor told me to forget everything I had ever learned about basic. |
Well, it helps when learning Asm ;). But I still don't completely buy into the "BASIC is bad for beginners" argument.
For one, it could just be a matter of the moving on at the right time. I had been using BASIC extensively for at least 5 full years before I moved into C. So, at first I learned a lot about prodedural code, but then it was later on that I started getting accustomed to going the wrong direction with code organization.
Also, it depends on the flavor of BASIC. Any version that doesn't support block conditionals is definately going to be teaching bad habits very strongly right from the start. But something like QBASIC allows the beginner to avoid having to use many of those kludges without introducing any of the problems that come from starting on C/C++/Java/etc.
Come to think of it, I'd bet that if there was a version of BASIC that had the same set of loops and conditionals that C does, then it's users wouldn't need to use goto at all, thus eliminating the bad habits that other variants of BASIC can teach. (I'm going to have to go back to QBASIC sometime. Since it supports block conditionals and while loops, I'm starting to suspect that I may not have needed to use any goto's back when I used QBASIC.)
#36238 - MumblyJoe - Wed Feb 16, 2005 11:01 am
sajiimori wrote: |
1. Many languages use format strings. C# and Common Lisp are two that I've used. You're picking a big fight.
|
Then many languages are just as bad, and I like picking big fights. :) However in your defence I have written PHP code which uses my own code that takes format strings. I did this because it keeps the style for other people who use the code, and the code is intended for other people.
sajiimori wrote: |
Whatever floats your boat. ;) I don't see much of a difference. |
C compiled in C++ mode at least fixes the type dramas that new C users have. Although personally I think in 2005 we could do a little better than telling people to learn C (and I wouldn't even consider telling anyone to learn C over C++ if it wasn't in relation to embedded programming like the GBA, and even then I wouldn't if there wasn't so many C resources availiable that help a beginner so much, and then I wouldn't recommend embedded as a good absolute starting point for a developer).
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!
#36240 - sgeos - Wed Feb 16, 2005 12:14 pm
MumblyJoe wrote: |
I wouldn't recommend embedded as a good absolute starting point for a developer. |
Embedded is a horrible absolute starting place for just about anybody.
-Brendan
#36262 - poslundc - Wed Feb 16, 2005 6:05 pm
I think it's horrible only insofar as the tools available for embedded systems are not aimed at beginners, and that most beginners want the instant gratification of "making an RPG", not the instant gratification of successfully coding an insertion-sort algorithm.
Remember, a generation ago, embedded systems were the highest-level technology. Only they were much bigger and not embedded onto anything. :P
Dan.
#36263 - poslundc - Wed Feb 16, 2005 6:09 pm
Abscissa wrote: |
Well, for me it was probably just a matter of having used BASIC for so long. Every C book I read kept stressing that "although goto's are allowed, they should be avoided". |
Ah. Well, none of the C books I read even mentioned gotos, although I guess I was reading books like "Learn C on the Macintosh" and not the more voluminous and exhaustive "standards" that seem to line every other programmer's bookshelf. :/
Dan.
#36264 - tepples - Wed Feb 16, 2005 6:27 pm
Abscissa wrote: |
it depends on the flavor of BASIC. Any version that doesn't support block conditionals is definately going to be teaching bad habits very strongly right from the start. But something like QBASIC allows the beginner to avoid having to use many of those kludges without introducing any of the problems that come from starting on C/C++/Java/etc.
Come to think of it, I'd bet that if there was a version of BASIC that had the same set of loops and conditionals that C does, then it's users wouldn't need to use goto at all |
C has if...else, while, and switch. QBasic has IF...ELSE, DO WHILE, and SELECT CASE. However, both C and QBasic still recommend goto for exceptions.
MumblyJoe wrote: |
C compiled in C++ mode at least fixes the type dramas that new C users have. |
So does gcc -Wall, without the loss of automatic cast from (void *) that complicates use of embedded APIs such as GBFS.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#36275 - chrisrothery - Wed Feb 16, 2005 8:38 pm
I skipped page 2 of this so if I'm duplicating what someone's already said, forgive me :)
I started way back with basic & some assembler (on the good old speccy). It was still basic (Blitz) + assembler on the Amiga till I went to college where I learned pascal before being exposed to C, so if it's an interim language you're after could pascal be the answer? I never used it once I'd learned C, but IIRC it was much stricter and less 'dangerous' than C, so if you're starting out, and have got an idea of the programmer mindset (variables, subroutines etc) with BASIC, then pascal (or delphi which is descended - I think) from it might be worth a look.
It's so long ago now, that I'm sure there'll be a queue of people to flame this idea which is ok, it's freezing here tonight and the heating's not doing it's job, so flame away...
Chris (hopefully coming back to gba development soon just as soon as I can finish these last 2 'little' projects that have cropped up - not that I've ever released anything, I do still read the forums every day).
#36289 - sajiimori - Wed Feb 16, 2005 10:02 pm
No flames here. For programmers that care little about low-level details, moving up from BASIC to Pascal is appropriate. Good follow-ups would then include dynamic-procedural (Lua/Python), static-functional (ML/Haskell), and dynamic-universal (Lisp).
But for somebody aiming at game programming, knowing the low-level stuff is important, and I'd advise dropping straight to assembly as soon as you grasp the simple procedural concepts (which QBASIC can provide alone).
#36292 - MumblyJoe - Wed Feb 16, 2005 10:58 pm
Don't worry chrisrothery, if anyone was gonna get flamed it would be me and my C++ zealotry :) Regardless, this is one of the only forums around that deserves the name forum, as it's a forum of ideas instead of a bunch of flamers.
Regardless, I have been contemplating this beginner coding idea over my morning coffee and I was thinking... regardless of what makes a beginner a better programmer, what makes them a happier programmer? If they were to be able to get something to happen in code with no real challenge, and get something cool on the screen, wouldn't that thrill them and give them the insatiable appetite for coding that we have? Would they then drive themselves to learn as much as possible? I am willing to think about ideas for months and write up designs to do a project and decide on some issues for speed and simplicity etc, but you can't expect someone who just want's to write something to do this yet.
So opinions? What do beginners wan't? Just to get things happenning as soon as possible (BASIC etc). Be more commercially viable as soon as possible and learn something higher (C/C++/ASM whatever)?
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!
#36294 - poslundc - Wed Feb 16, 2005 11:19 pm
MumblyJoe wrote: |
If they were to be able to get something to happen in code with no real challenge, and get something cool on the screen, wouldn't that thrill them and give them the insatiable appetite for coding that we have? Would they then drive themselves to learn as much as possible? |
HAAAAAAAAAAAAAAAAAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA...
*wipes away tear*
Dan.
#36295 - sajiimori - Wed Feb 16, 2005 11:53 pm
There are game maker programs that let you get more than a little on screen for very little effort.
I can only think of 2 reasons to choose real game programming instead: Either you want to do things that those programs don't let you do, or you want a challenge.
In the first case, it will take any new programmer a lot of effort to achieve that goal, so there's no choice but to accept the challenge.
In the second case, making things easy is exactly the opposite of what will make them happy.
#36298 - Trey - Thu Feb 17, 2005 1:17 am
PD.v90 wrote: |
From what i understand, it is not completly safe for the computer to program in C....And i am just 14 years old,maybe i should wait with learning C++ or what do you think? |
what is it you want to do? that will help drive what language to use.
see if this helps. if the task is to go to the store and the language is like a car, then,
if you use basic, you'll call a cab and tell the driver to take you to the store. 3 hours later, you will arrive at a 7-11 in another city.
if you use fortran, all the women will laugh at your old car as you push it to the store.
if you use java, everytime you go to the store, you'll be following a parade.
if you use c, you'll travel at light speed and arrive at the bank.
if you use c++, you'll be behind a parade but both you and the parade will travel at the speed of sound. just before you get to the store, your car will explode.
bottom line: languages are like cars. if the driver is bad, then so will the driving. doesn't matter if the car is a yugo or a corvette.
#36300 - zazery - Thu Feb 17, 2005 1:27 am
Great analogy Trey, I'll keep that in mind for someday when I teach programming.
#36303 - sajiimori - Thu Feb 17, 2005 2:50 am
Screw the Yugo (BASIC) and the Corvette (C++) -- give me my Porche! (Lisp) ;)
#36333 - MumblyJoe - Thu Feb 17, 2005 3:20 pm
poslundc wrote: |
MumblyJoe wrote: | If they were to be able to get something to happen in code with no real challenge, and get something cool on the screen, wouldn't that thrill them and give them the insatiable appetite for coding that we have? Would they then drive themselves to learn as much as possible? |
HAAAAAAAAAAAAAAAAAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA...
*wipes away tear*
Dan. |
Hope that tear was caused by you getting kicked in the groin, and not at my comments :P
Im serious though, ignoring the whole language zealotry thing we have going here, I'm really interested in this. I think the way I started coding was substandard and would like to get a real opinion from you on how I could recommend other people go about it better.
Trey wrote: |
PD.v90 wrote: | From what i understand, it is not completly safe for the computer to program in C....And i am just 14 years old,maybe i should wait with learning C++ or what do you think? |
what is it you want to do? that will help drive what language to use.
see if this helps. if the task is to go to the store and the language is like a car, then,
if you use basic, you'll call a cab and tell the driver to take you to the store. 3 hours later, you will arrive at a 7-11 in another city.
if you use fortran, all the women will laugh at your old car as you push it to the store.
if you use java, everytime you go to the store, you'll be following a parade.
if you use c, you'll travel at light speed and arrive at the bank.
if you use c++, you'll be behind a parade but both you and the parade will travel at the speed of sound. just before you get to the store, your car will explode.
bottom line: languages are like cars. if the driver is bad, then so will the driving. doesn't matter if the car is a yugo or a corvette. |
Your analogy is bad and you should feel bad.
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!
#36334 - TheMikaus - Thu Feb 17, 2005 3:48 pm
It's not that it's bad. Just heavily biased towards a certain language.
But he's correct a language is a tool it's only "bad" if you use it wrong.
I mean. until recently if you wanted a way to design gui and fast it was all VB (now I recommend java or c#)
If you wanted power and speed most companies seemed to use c.
If you want easier to maintain code and better organization use c++.
If you want portability use java.
if programming for the gba use c or c++ (unless you want high opt. then use asm). and it wont be bad for your computer because you're not running it on your computer. You're running on an emulated gba. And anything stupid you would do in c, you would do in c++.
And again like it was said. It's only bad if you use it wrong.
Edit:
If you're trying to learn to program I would suggest c or basic. Although I highly recommend c. It's more to learn, but I think c has more applicable standards when it comes to learning other languages. most languages don't use control statements like basic does, where as most common languages seem to follow structure c does. (Note common. Excludes lisp and prolog.)
#36335 - Abscissa - Thu Feb 17, 2005 4:06 pm
MumblyJoe wrote: |
Regardless, I have been contemplating this beginner coding idea over my morning coffee and I was thinking... regardless of what makes a beginner a better programmer, what makes them a happier programmer? If they were to be able to get something to happen in code with no real challenge, and get something cool on the screen, wouldn't that thrill them and give them the insatiable appetite for coding that we have? Would they then drive themselves to learn as much as possible? |
I think that's a good point. While going through the computer science curriculum at a Univ, I saw a LOT of people who were turned off from programming because (as beginners) they found C/C++ to be so much work for so little payoff. And losing all interest in programming certainly isn't going to help anyone become a good coder anymore than bad habits would. I think this is one of the good points of LOGO, low effort, large tangible payoff.
#36338 - poslundc - Thu Feb 17, 2005 6:27 pm
MumblyJoe wrote: |
poslundc wrote: | MumblyJoe wrote: | If they were to be able to get something to happen in code with no real challenge, and get something cool on the screen, wouldn't that thrill them and give them the insatiable appetite for coding that we have? Would they then drive themselves to learn as much as possible? |
HAAAAAAAAAAAAAAAAAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA...
*wipes away tear*
Dan. |
Hope that tear was caused by you getting kicked in the groin, and not at my comments :P |
Oh relax. I'm not laughing at your comment because I think it's stupid or ill-conceived, just because I find it possesses a naive optimism.
Sajimori gives a good explanation of the paradox that prevents what you describe from occurring. My response was less based in logic, and just comes from years of experience and empirical observation, on the Internet, in the classroom and in life. In general, people either want to do things right or they want to do things easy, and there is very little you can do to persuade a leopard to change its spots.
Dan.
#36340 - sajiimori - Thu Feb 17, 2005 8:11 pm
Quote: |
And again like it was said. It's only bad if you use it wrong. |
Can you agree that some languages are inappropriate to apply to certain situations? If so, isn't that because a better language is available? If so, what do you call a language which has an alternative that is virtually always better? I'd call it a relatively bad language.
Quote: |
most common languages seem to follow structure c does. (Note common. Excludes lisp and prolog.) |
When I used Lisp, I added my favorite C iterative constructs (before I got the hang of map, fold, and reduce).
#36342 - Miked0801 - Thu Feb 17, 2005 8:18 pm
Agreed. The do it the right way people are the ones who want to learn to code. The do it quick people are the ones who will drop this whole make a game thing in a week or two.
#36345 - TheMikaus - Thu Feb 17, 2005 9:42 pm
sajiimori wrote: |
Quote: | And again like it was said. It's only bad if you use it wrong. | Can you agree that some languages are inappropriate to apply to certain situations? If so, isn't that because a better language is available? If so, what do you call a language which has an alternative that is virtually always better? I'd call it a relatively bad language.
Quote: | most common languages seem to follow structure c does. (Note common. Excludes lisp and prolog.) | When I used Lisp, I added my favorite C iterative constructs (before I got the hang of map, fold, and reduce). |
I agree for certain situations languages top other languages. Which was what the whole listing was for.
Like Lisp and prolog are known for being better with ai applications, although not limited to this.
I think that "virtually always better" is dependant.
For instance, pointers or references. Some programmers think that languages that support "real" pointers are better than references (java vs. c/c++). Even though they provide almost the same functionality.
What about pointer addition? is that a good thing or a bad thing? Is a language that prevents you from address hoping into someone else's program better or worse? I think it's all very subjective and dependant on the application.
And a language that has an alternative that's more practical just means it's old not really a bad language. I mean outside of console programming and electronic device programming (chips and such) asm is relatively impractical. Does that make it bad? no. Makes it a bad idea to try to program a windows program in asm, but the language itself is not bad and becomes useful in other applications.
Also define what you consider a part of the language. I mean is c++ better than c because of strings or stl? probably not and if it was you could implement them in c. ::shrug::
#36346 - sajiimori - Thu Feb 17, 2005 10:01 pm
Hmm... I don't think I'm gonna continue. This is a difference in personality, so the discussion wouldn't be particularly rational. Some people just like to say "it's all relative, man".
No offense though, I suppose that kind of thinking has its place.
#36347 - TheMikaus - Thu Feb 17, 2005 10:06 pm
I just agreed with your statement that some languages are better in certain applications.
I think it's always just an opinion thing :(
Someone will always think one language is better than another in general or completely. Which is cool.
By "rational" I hope that you mean the discussion (inclusive of both of us) and not just me, I'd hate to think you're being rude over something so subjective.
Edit:
I do give you this though. If a language was devoid of functions, variables or control statements (branch instructions or loop abilities). I'd call it a bad language or a poorly designed cpu architecture(if the architecture doesn't support it)
#36349 - sajiimori - Thu Feb 17, 2005 10:38 pm
Yeah, I mean the discussion. Everything can be considered relative, and preferring to treat things that way will prevent us from reaching any useful or interesting conclusions.
#36350 - TheMikaus - Thu Feb 17, 2005 10:45 pm
okey dokey.
Well, since I guess I didn't contribute anything, sorry for not helping.
good luck :)
#36356 - MumblyJoe - Fri Feb 18, 2005 12:33 am
poslundc wrote: |
Oh relax. I'm not laughing at your comment because I think it's stupid or ill-conceived, just because I find it possesses a naive optimism. |
Don't worry, all in good humour. I'm actually really enjoying this thread, makes me wanna write a book for beginners that analyzes all these ideas.
TheMikaus wrote: |
okey dokey.
Well, since I guess I didn't contribute anything, sorry for not helping.
good luck :) |
You contributed some very interesting observations, and this thread isn't over until I say so (even if whoever started it got bored and ran away long ago).
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!
#36357 - dagamer34 - Fri Feb 18, 2005 12:58 am
This thread is over. :)
_________________
Little kids and Playstation 2's don't mix. :(
#36360 - sajiimori - Fri Feb 18, 2005 1:31 am
Indeed! ;)