gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

OffTopic > Teaching Programming Languages

#138527 - The_Perfection - Sat Aug 25, 2007 3:08 am

Hello. I am teaching a few people programming. I plan to teach them C/C++ to start off with because it doesn't hide things (like pointer work) like Visual Basic or Java which are their target languages.

While I am teaching them C/C++, I need to learn the names for the common things in VB and Java like the names for the equivalants of functions, classes, and the like. Any help with that as well such as structure and syntax would be greatly appreciated.

As a secondary question, do any of you have tips for teaching C/C++? I have a basic outline of what to do, but if anyone has suggestions, I'm listening.


As a random question, what is the kind of curve that Flash uses? (The kind that stay under the mouse when you drag them.)

#138534 - seoushi - Sat Aug 25, 2007 6:05 am

Personally I wouldn't use such a low level language for teaching programing. Teaching ideas and programming concepts without having to learn much syntax is a much better approach for an introduction to programming class. Once the ideas are learned then you can teach lower level languages and the students will have a much easier time picking it up. If you were to teach something as complex as C/C++ to people who do not know how to program to begin with then it will be a lot tougher for them to learn proper practices. Many good universities use some form of lisp/scheme to teach introduction to programming classes, having been in one of these classes myself (years ago) I feel it's a good approach. I recommend Dr Scheme as a good teaching language.

C/C++ are quite different for normal programs, I would chose one or the other (preferably C++).

#138548 - keldon - Sat Aug 25, 2007 11:03 am

Knowing about learning itself is far more important than knowing the equivalents in Java. Pm me with your email address and I can send you my text on learning; also follow the link at the bottom to a paper from Connexions about learning (it has a page that details the learning styles).

One of the biggest problems people have is selecting a style that doesn't suit the way people learn. Some people are fine with the theory, gist and practicality of it, while others like to perform a task using it and learn after the reflection of the activity.

If you are aware of why someone is not understanding what you are "teaching" then you can better "teach" to them.

#138559 - The_Perfection - Sat Aug 25, 2007 5:40 pm

seoushi wrote:
Teaching ideas and programming concepts without having to learn much syntax is a much better approach for an introduction to programming class.

Ah, I see. Best to teach pseudo-code and the basics of structured programming before going into an actual language. I skipped that part (I learned it as I went,) but it's probably better to learn it early on. (It would also gives me a bit of time to install compilers.)

seoushi wrote:
If you were to teach something as complex as C/C++ to people who do not know how to program to begin with then it will be a lot tougher for them to learn proper practices.

I think it would be easier to teach good programming practices as we discuss the areas where they occur. (Things like indentation and not including data or code need to be there practically from the start though.)

seoushi wrote:
Many good universities use some form of lisp/scheme to teach introduction to programming classes, having been in one of these classes myself (years ago) I feel it's a good approach. I recommend Dr Scheme as a good teaching language.

Okay, I may take this approach, though it means a third programming language to learn. Would you please point me to a good compiler and a few good tutorials?

seoushi wrote:
C/C++ are quite different for normal programs, I would chose one or the other (preferably C++).

Yes, I intended to focus more on C++ as output is a fair bit simpler and it is more closely related to VB and Java.

keldon wrote:
Knowing about learning itself is far more important than knowing the equivalents in Java.

True, because no teaching is taking place if no-one is learning. There would be no purpose for knowing Java equivalents if it I don't understand how to teach it to different kinds of learners. (Knowing isn't enough, it's much better to understand.)

keldon wrote:
One of the biggest problems people have is selecting a style that doesn't suit the way people learn. Some people are fine with the theory, gist and practicality of it, while others like to perform a task using it and learn after the reflection of the activity.

Yes. Yes. I've come across a few teachers like that. I hope I don't become one of them. Since it's a small group, it shouldn't be terribly difficult to teach it in a way that everyone understands. I know these people and have taught them a few things before and found out that they learn pretty similarly to the way I do. This is the general gist of it: learn the how (by experimentation or use) and the why (by explanation).


I feel really quotey today.

Thanks for your feedback! I appreciate it.

#138561 - tepples - Sat Aug 25, 2007 7:18 pm

The_Perfection wrote:
seoushi wrote:
Teaching ideas and programming concepts without having to learn much syntax is a much better approach for an introduction to programming class.

Ah, I see. Best to teach pseudo-code and the basics of structured programming before going into an actual language.

I use Python at work (my choice; they had been using Excel and VB). I showed my boss the function that computes the price of an item. The response: "Is that pseudocode?"

For a beginner, I would recommend Python over Scheme. I'm guessing that the parenthesized prefix syntax of a Lisp derivative may put off beginners, especially if you have to teach them to use a special editor. My Scheme teacher had us using GNU Emacs, even on Windows. Python, on the other hand, uses indentation to denote code blocks, and people who have studied outlines in natural language class (e.g. English class) should already be familiar with this use of indentation. The standard Python installation at least for Windows comes with the IDLE editor, which is a joy to use.

Quote:
Yes, I intended to focus more on C++ as output is a fair bit simpler and it is more closely related to VB and Java.

Output with <cstdio> in C++ is just like output with <stdio.h> in C. Output with <iostream> has its own drawbacks, especially once you get to the GBA or DS module of your course, and especially if you are using stock GNU libstdc++.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#138582 - The_Perfection - Sun Aug 26, 2007 1:45 am

After looking a bit into both Lisp and Python, I think I may go with Python. As tepples said, the parentheses kinda put me off. (I looked at some of the basic Lisp code and saw 5+ parentheses for relatively simple statements. Not exactly appealing.) And I managed to download the Python stuff already (10M files take a while on dailup) and am looking into it. As an added bonus, I may actually learn how to use Blender, which is Python extendable.

tepples wrote:
Quote:
Yes, I intended to focus more on C++ as output is a fair bit simpler and it is more closely related to VB and Java.

Output with <cstdio> in C++ is just like output with <stdio.h> in C. Output with <iostream> has its own drawbacks, especially once you get to the GBA or DS module of your course, and especially if you are using stock GNU libstdc++.

I know that <cstdio> is the way to do C output in C++. Unfortunately, I never really learned how to use it, (I delved straight into C++ and the books I have don't cover <cstdio>,) but if there are a few tutorials on how to use it, I'll look into it. I've also read a few of your rants, including <cstdio> v. <iostream>. I understand the large bloat, but it also uses classes and operator overloading which are rather imoprtant for learning how powerful C++ can be. Plus, I don't really intend to introduce them to the GBA/DS unless they really want to do it (even though it would be pretty good for learning pointer work) because the languages they are going to branch to are Java and VB which (to my knowledge) are not supported on the GBA/DS.

#138585 - seoushi - Sun Aug 26, 2007 3:04 am

Python is a good teaching language as well, however it doesn't focus on abstract ideas as much as a function language does.

As for dr scheme you can get it here. One of the good things about dr scheme is that the compiler, ide and everything you need to use is bundled into one package so it's easier for the end user to install (unix, mac and windows). There are also some great learning sources out there for it linked from the main page (click the learning link), it even has some instructor materials for you to follow. Dr scheme was created for introduction to programming classes and it works very well, the parenthesis might turn you off at first but with the ide's auto-matching it's not that big of a deal.

#138588 - keldon - Sun Aug 26, 2007 3:43 am

Hmm, scheme seems like an interesting language; never really looked at it before. But like you said, it doesn't "look" nice - way too verbose to begin with.

One thing I picked up from being the pupil-but-tutor-for-everyone-who-didn't-get-it throughout college and uni is that things like indentation don't make sense to some people before they understand the concept of structure. We take all these constructs for granted; sometimes the simple nature of BASICA's line by line structure is easier to get people started into writing instructions. Plus you have gosub, and much much less to learn.

But in general you probably end up with 30% getting it straight away, 30% getting it but needing some confirmation on their understanding, 20% eager to find their own way through it and using your teaching as a guide and 20% needing extra attention and care -_- Overall a guaranteed success! Good luck!

#138658 - sgeos - Mon Aug 27, 2007 1:25 pm

GIMP script-fu is written in a variant of scheme. After having written ~10 script-fu scripts, I still don't see the charm in lisp (variants).

Ruby has become my favorite programming language. So far as I can tell, it is a functional object oriented rapid prototyping language. The downside is that it is interpreted and therefore slow- not a big deal when someone is first learning.

-Brendan

#138796 - ScottLininger - Wed Aug 29, 2007 5:10 am

For client-side stuff, I think that Ruby is sweet, but it's *very* different syntactically than most other languages. So be warned.

I think that C is fine... I learned in Basic, which I'm still a fan of.

-Scott
_________________
Some of my GBA projects

#138846 - Quirky - Wed Aug 29, 2007 7:43 pm

tepples wrote:
I use Python at work (my choice; they had been using Excel and VB). I showed my boss the function that computes the price of an item. The response: "Is that pseudocode?"


:-) Python is wonderful. The indentation-is-scope really forces you to keep the functions small, or else you lose track of where you are. This is definitely a Good Thing, seeing as how I regularly encounter mammoth 1000 line functions in other languages.

Quote:
The standard Python installation at least for Windows comes with the IDLE editor, which is a joy to use.


On Linux it doesn't come with IDLE by default, but Python's there from the kick off. One nice thing is that it comes with graphical libraries as standard, the Tk stuff, which may look pretty crap nowadays (especially in Gnome, less so on Windows) but it makes for some easy-peasy GUIs without having to download more libraries.

Quote:
Output with <cstdio> in C++ is just like output with <stdio.h> in C. Output with <iostream> has its own drawbacks, especially once you get to the GBA or DS module of your course, and especially if you are using stock GNU libstdc++.


I disagree with you... iostream is worse than you say! I had the misfortune recently to have to parse/output text files in C++. What a nightmare, especially compared to Python. The whole idea that formatting a stream alters the whole stream forever is most awkward, to say the least. Code ends up with so much boilerplate and save-my-flags-restore-my-flags that you inevitably throw up your hands and use *printf, even if it is "backwards".

I find it quite interesting that Java fairly recently added printf. So much for OO, eh? Turns out %02d was better all along. Python supports the 'Player %s has %d points'%(name, score) syntax too, so it must be good.

There's not much between Ruby and Python IME, Ruby has some cool features (3.times {} and all that) but I don't like its occasional "many ways to do something" approach. And its "puts" gives me TCL flashbacks. I prefer Python's (usually) one correct way to do it. I have less Ruby experience and discovered Python earlier, so that probably taints my opinion a fair deal.

#138849 - tepples - Wed Aug 29, 2007 8:25 pm

Quirky wrote:
I find it quite interesting that Java fairly recently added printf. So much for OO, eh?

Fans of <iostream> like to promote the extensibility of std::ostream, as anyone can overload its operator<< to work with a user-defined class and the result will show up on every ostream. But Java handles it differently by putting a String factory method called toString() in the interface of every Object.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.