Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: Flichtschein on November 24, 2005, 10:08:35 pm

Title: Code::Blocks or Dev-C++ in C Language courses
Post by: Flichtschein on November 24, 2005, 10:08:35 pm
I am using Dev-C++ to teach C language programming course, as an introduction to an applied C programming course for microcontrollers.

I would like to share experience with others who are embarked in similar extraordinary enterprises.

Jokes apart, my aim is to get the students started on C fundamentals. The graphic environment of Windows is sometimes too tempting and the students want to draw images instead of focusing on logic and structure. I would like to shares syllabuses, methods and exercises with fellow teachers.

Best regards,

Fernando Lichtschein
lich@fibertel.com.ar
Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: takeshimiya on November 24, 2005, 10:51:38 pm
Hi! I remember like 2 years ago when I was in high school, learning the C language using plain old good Borland in DOS and learning Assembler for microcontrollers (Motorola JK1 :)).
I never learned C for microcontrollers though.

If you're using Dev-C++ I'll recommend you replacing it with Code::Blocks (so much better).

But perhaps the good old blue Borland is better when teaching, because the interface is fullscreened and you have only text (nothing distracting).

I remember that in the C programming class where we used Borland, all students were more concentrated and even the most lazy one was programming.
But in the ASM programming class where we used some IDE in windows for programming the microcontroller, everyone was a lot more distracted.

Anyways, Code::Blocks include a FullScreen mode where perhaps your students willn't be too tempted to open Paint, I hope :D.

By the way, I'm received from the Otto Krause school.
Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: rickg22 on November 24, 2005, 11:43:03 pm
Dear Fernando:

Since you're teaching the structure, start with the typical "hello world" examples.

Teach about arrays, pointers, and algorithms. Data structures like linked lists.

You could compare various sorting algorithms in C (like bubblesort, shellsort, quicksort) in some demonstrations. Ask your students to write "simple" programs.

Fibonnaci series is a good example of algorithms. Seeing the program run and produce the numbers is a good way to get them to understand how an algorithm works.


Using codeblocks would be good, because it has syntax highlighting, and code folding. For long algorithms students can compact their loops / if's, and understand more what programming is about.

I don't use the debugger very often, but if you can get to use it, this would also teach the students how stepping by in a program can help understand an algorithm, too.

You could put them to solve problems, like... getting out of a simple maze, or something.

If your students want to draw images, ask them to draw LOGIC DIAGRAMS :lol:
and then turn them into a C program.

Also, make use of students' natural curiousity. Invite them to "hack" away their grades, give them extra points if they can make a program to solve certain problem... first N students who get to solve it, get the point.

Make it fun... ask them to form teams, but then put them to compete against each other. A good idea is to put them to work in combinatorial problems. (Like the star of david.  Put numbers from 1 to 12 in the star's edges and crossings so the sums are the same. The student whose program / algorithm solves it in the least time or with the least iterations, wins).

Do the competitions in an inverse pyramid: The first to solve the problem before his competitor, gets away from the competition, and the loser goes to the next round. The last "round" is between the worst students. The worst student gets double homework  :lol:, or the students who win the first time get an extra credit. (Or how about the students who win the first time, get 2 credits. The ones who win the second time, only get a credit, and so on).

For normal classes, kick the geniuses out. Only give them homeworks and let them use up their time as they wish (outside the classroom, of course). They probably don't need the courses anyway, unless it's processor-specific.

Remember that programming is nothing but solving puzzles, or hacking your way like "neo". If there's no challenge, it'll be boring.

Hope that helps.
Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: takeshimiya on November 25, 2005, 12:04:57 am
OMG!! My C programming class had exactly all of what rick says! :shock:

Hello world, bubblesort, quicksort, fibonnaci, debug, problems, first N students who get to solve a problem, teams, algorithms for calculating PI, etc...
I can assure that the C classes wasn't boring at all.

I was amazed to see my classmates (the ones who rarely touched a pc) doing crazy things like implementing an entire GUI in the graphic libraries of Borland, or developing games with graphics.
Note that nothing of this was teached in the classes, they learned themselves at the college (looking at the documentation Borland comes).

Everyone was so motivated to program and solve the problems, and in the spare time programming games or other things.


But all of this makes for a C programming class, programming a microcontroller is a very different matter. If you don't introduce something of the things rick said (like problems, algorithms, challenges, teams, ...) your students will lost interest.
The key is to have dynamic classes.
Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: Flichtschein on November 25, 2005, 03:27:48 pm
Hi! I remember like 2 years ago when I was in high school, learning the C language using plain old good Borland in DOS and learning Assembler for microcontrollers (Motorola JK1 :)).
I never learned C for microcontrollers though.

If you're using Dev-C++ I'll recommend you replacing it with Code::Blocks (so much better).

But perhaps the good old blue Borland is better when teaching, because the interface is fullscreened and you have only text (nothing distracting).

I remember that in the C programming class where we used Borland, all students were more concentrated and even the most lazy one was programming.
But in the ASM programming class where we used some IDE in windows for programming the microcontroller, everyone was a lot more distracted.

Anyways, Code::Blocks include a FullScreen mode where perhaps your students willn't be too tempted to open Paint, I hope :D.

By the way, I'm received from the Otto Krause school.

¡Del Otto Krause! Yo soy de la otra cuadra, de la facultad de Ingeniería... Ahora doy clase en el terciario de ORT.

Saludos!
Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: sethjackson on November 25, 2005, 03:38:29 pm
Hi! I remember like 2 years ago when I was in high school, learning the C language using plain old good Borland in DOS and learning Assembler for microcontrollers (Motorola JK1 :)).
I never learned C for microcontrollers though.

If you're using Dev-C++ I'll recommend you replacing it with Code::Blocks (so much better).

But perhaps the good old blue Borland is better when teaching, because the interface is fullscreened and you have only text (nothing distracting).

I remember that in the C programming class where we used Borland, all students were more concentrated and even the most lazy one was programming.
But in the ASM programming class where we used some IDE in windows for programming the microcontroller, everyone was a lot more distracted.

Anyways, Code::Blocks include a FullScreen mode where perhaps your students willn't be too tempted to open Paint, I hope :D.

By the way, I'm received from the Otto Krause school.

¡Del Otto Krause! Yo soy de la otra cuadra, de la facultad de Ingeniería... Ahora doy clase en el terciario de ORT.

Saludos!

If my Spanish was better I could reply. :) It seems you went to Otto Krause too? Like I said my Spanish is pretty bad (I'm in Spanish 1). :)
Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: Michael on November 25, 2005, 04:50:59 pm
Wow rickg22,

If my C teacher had followed your advices, I would probably be today a better programmer :).

My suggestion, Fernando, is instead to teach pure C, to teach the C subset of C++ (see http://www.research.att.com/~bs/bs_faq.html#prerequisite). IMHO this would be better and also give the student an intro of C++.

Best wishes,
Michael
Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: rickg22 on November 25, 2005, 06:06:04 pm
Wow rickg22,

If my C teacher had followed your advices, I would probably be today a better programmer :).

Actually I got the competition idea (loser advances to the next round) from an anime :P. And some of the ideas for the contest, because I went to an ACM programming contest (which sucked btw). But I bet that in a classroom in a controlled environment, a competition would be much better.
Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: yop on November 25, 2005, 07:05:05 pm
[offtopic]
You had programming classes in high school ?!? :shock: I took my first official programming class in the university, in highschool we didn't even have computer labs... I used to beg a cousin of mine to let me use (errrr destroy) his computer. Those were the times...
[/offtopic]
Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: takeshimiya on November 25, 2005, 08:06:54 pm
¡Del Otto Krause! Yo soy de la otra cuadra, de la facultad de Ingeniería... Ahora doy clase en el terciario de ORT.

Sí, pasé miles de veces por la facultad de Ingeniería de Paseo Colón. :D
El terciario de la ORT es el que está en frente del Nichia Gakuin o ese es el secundario?
Yo estudié Electrónica en el Krause, y ahora estoy estudiando para Ciencias de la Computación en la UBA.

My suggestion, Fernando, is instead to teach pure C, to teach the C subset of C++ (see http://www.research.att.com/~bs/bs_faq.html#prerequisite). IMHO this would be better and also give the student an intro of C++.

C++ is not used for programming microcontrollers (for the first courses) because it's more abstract than C.
C is more low-level and closer to Assembly, which is better when you have to interface hardware directly.

You had programming classes in high school ?!? :shock: I took my first official programming class in the university, in highschool we didn't even have computer labs...

Yep, I had C and Assembly programming classes in high school, but because my high school degree/career was Electronics. :D
Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: sethjackson on November 25, 2005, 08:32:34 pm
[offtopic]
You had programming classes in high school ?!? :shock: I took my first official programming class in the university, in highschool we didn't even have computer labs... I used to beg a cousin of mine to let me use (errrr destroy) his computer. Those were the times...
[/offtopic]

I don't think this was intended for me but I reply anyways. :) No I don't have programming in high-school, but I am teaching myself how. :) Started when I was 13 or so.:)
Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: Flichtschein on November 27, 2005, 08:32:59 pm
¡Del Otto Krause! Yo soy de la otra cuadra, de la facultad de Ingeniería... Ahora doy clase en el terciario de ORT.

Sí, pasé miles de veces por la facultad de Ingeniería de Paseo Colón. :D
El terciario de la ORT es el que está en frente del Nichia Gakuin o ese es el secundario?
Yo estudié Electrónica en el Krause, y ahora estoy estudiando para Ciencias de la Computación en la UBA.

That is the one. El terciario uses at night the same building that the secondary school uses during the day.

My suggestion, Fernando, is instead to teach pure C, to teach the C subset of C++ (see http://www.research.att.com/~bs/bs_faq.html#prerequisite). IMHO this would be better and also give the student an intro of C++.

C++ is not used for programming microcontrollers (for the first courses) because it's more abstract than C.
C is more low-level and closer to Assembly, which is better when you have to interface hardware directly.

You had programming classes in high school ?!? :shock: I took my first official programming class in the university, in highschool we didn't even have computer labs...

Yep, I had C and Assembly programming classes in high school, but because my high school degree/career was Electronics. :D

Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: Flichtschein on November 27, 2005, 08:39:23 pm
This has grown to quite a thread. I appreciate all the recommendations I received and I will try to use them as far as it is practical during the next term.

I switched from Borland to Dev-C++ because the interface was more up to date and it resembles more the one from Keil C which is used during the following semester.

The "fun" part is hard to implement because for students it means animations, graphics, controlling devices, etc for which they haven't yet built the necessary skills.

I miss the help facility in Borland, but I guess I will find the way to do this in this forum.
I could also use better documentation regarding Win32 functions, or libraries with which I could turn bits in the parallel port on and off.

Best regards,

Fernando
Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: NeoHippo on November 27, 2005, 10:25:41 pm
Hi, everybody

If I may input my 2 cents worth ...

My schooling was pre-computer age and therefore I am still struggling with the subject of programming.
However, during a lengthy stint at a now defunct sawmill machinery manufacturer, I had to teach myself the programming aspects of 8080 assembly programming. The only way I could accomplish this task was by seeing (literally) what was happening as I wrote and ran some assembly routines. Book learning and the antiseptic environment of classroom training only, simply did not inspire me at all. So I hooked up my cpu-board to switches for inputs and all kinds of lights and motors for outputs. I guess, nowadays, one would call this approach goal oriented. Since then, I have found that this works well with the younger generation as well.

While there is no longer a record of my previous endeavours, I have come across this little  movie clip (http://www3.telus.net/NeoHippo/OTHER/WizardsofWinter-SM.wmv), which demonstrates well what the end result could be like. If one sets a particular goal, which everybody finds interesting, learning becomes so much more enjoyable.  :D
Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: takeshimiya on November 27, 2005, 11:22:29 pm
I miss the help facility in Borland, but I guess I will find the way to do this in this forum.
Documentation of what do you want? The C language? A library?

I could also use better documentation regarding Win32 functions, or libraries with which I could turn bits in the parallel port on and off.

It's not good to call Win32 functions directly to access the parallel port, because they are different between Win9X and Windows 2000/XP.
It is advised to use instead a library like inpout32.dll: http://www.logix4u.net/inpout32.htm

I don't know any multiplatform library to access the parallel port, so your students can write the exactly same code to access it regardless what OS is their favorite (Windows, Linux, Mac OS, etc). Anyone knows here?

But I do know a multiplatform library to access the serial port (in any case you need it), and it's easy to use. It's called wxCTB, you can find it here: https://sourceforge.net/project/showfiles.php?group_id=51305&package_id=45182&release_id=347488
Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: Flichtschein on November 28, 2005, 01:15:53 am
Hi, everybody

If I may input my 2 cents worth ...

My schooling was pre-computer age and therefore I am still struggling with the subject of programming.
However, during a lengthy stint at a now defunct sawmill machinery manufacturer, I had to teach myself the programming aspects of 8080 assembly programming. The only way I could accomplish this task was by seeing (literally) what was happening as I wrote and ran some assembly routines. Book learning and the antiseptic environment of classroom training only, simply did not inspire me at all. So I hooked up my cpu-board to switches for inputs and all kinds of lights and motors for outputs. I guess, nowadays, one would call this approach goal oriented. Since then, I have found that this works well with the younger generation as well.

While there is no longer a record of my previous endeavours, I have come across this little  movie clip (http://www3.telus.net/NeoHippo/OTHER/WizardsofWinter-SM.wmv), which demonstrates well what the end result could be like. If one sets a particular goal, which everybody finds interesting, learning becomes so much more enjoyable.  :D


Wow! You do that kind of programming? That really looks like fun. Timing is a problem, though, but I get the idea.

Regards,

Fernando
Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: Flichtschein on November 28, 2005, 01:18:07 am
I miss the help facility in Borland, but I guess I will find the way to do this in this forum.
Documentation of what do you want? The C language? A library?

Both, the C languange functions and the standard library, as the help (was it F1 or <ctl>F1) in the Borland compiler.
The glibc documentation is overwhelming for a newbie. A Spanish version would help.

I could also use better documentation regarding Win32 functions, or libraries with which I could turn bits in the parallel port on and off.

It's not good to call Win32 functions directly to access the parallel port, because they are different between Win9X and Windows 2000/XP.
It is advised to use instead a library like inpout32.dll: http://www.logix4u.net/inpout32.htm

I don't know any multiplatform library to access the parallel port, so your students can write the exactly same code to access it regardless what OS is their favorite (Windows, Linux, Mac OS, etc). Anyone knows here?

But I do know a multiplatform library to access the serial port (in any case you need it), and it's easy to use. It's called wxCTB, you can find it here: https://sourceforge.net/project/showfiles.php?group_id=51305&package_id=45182&release_id=347488

Title: Re: Code::Blocks or Dev-C++ in C Language courses
Post by: Michael on November 29, 2005, 11:39:08 am
My suggestion, Fernando, is instead to teach pure C, to teach the C subset of C++ (see http://www.research.att.com/~bs/bs_faq.html#prerequisite). IMHO this would be better and also give the student an intro of C++.
C++ is not used for programming microcontrollers (for the first courses) because it's more abstract than C.
C is more low-level and closer to Assembly, which is better when you have to interface hardware directly.
Hello,

Sorry for the late reply, but you can not do in C subset of C++ what you can do in C? I have always understood that you can use C subset of C++ whererever you use C.
Anyway, I am not sure that C subset of C++ is more abastract that C (C++ of course). But, may be, I am too much a C++ fan :).

Best wishes,
Michael