Programming Courses ?

Having lasted 25 years as an electronic Tech, I am needing to expand to cope with the continued blurring of the line between when the electronics start and the Programming of PC's takes over. I already write assembler for microcontrollers (programming from 2K to 2 meg in assembler) and really should be using c for this, but have never took the time to learn it.I have however programed in both Portran (port-a Punch) and basic many years ago. Ancient history lesson ends I basically need to program PC's to set up/ colect data/ process data and probably via a graphical interface. so my question ... in 2 parts: 1. Is C still a viable language to learn to write programs for PC/MAC Ideally in Win MacOSX (cocoa looks nice) and Linux or should I be looking at C# / Mono / QT / ?? It seems that all later programming languages seem to be adding to C (extend .. embrace ??) so Would C be a good start place ? All opinions welcome.... and crystal ball gazing will be entertained. 2. Does anyone have experience with a good course / course provider that they would recommend to provide such training. I would prefer part time training, as my family like to eat, but this is flexible, as I can work nights/weekend is the course is not too long. Of course, then I could apply for the job that just hit my inbox too :-) Thanks in advance.

1. Is C still a viable language to learn to write programs for PC/MAC Ideally in Win MacOSX (cocoa looks nice) and Linux or should I be looking at C# / Mono / QT / ??
There's 2 programming languages you need to learn. C++ (Treating C as a subset of C++ here), and everything else. Once you've learnt C++, the "Everything Else" comes naturally and without much effort, except for godawful things like lisp and haskell, but those are rarely used outside of academia.
It seems that all later programming languages seem to be adding to C (extend .. embrace ??) so Would C be a good start place ?
No, do not just learn C, as a lot of 'next gen' languages are Object Oriented. If you only learn C, you won't learn about that, and be in for some strife if you do try and learn C#/Java/etc. Find a good C++ course, and get stuck into it. Having said that, I've no idea where you'd find such a thing. Teach yourself would be my advice.

On 28/04/2004, at 3:24 PM, Orion Edwards wrote:
1. Is C still a viable language to learn to write programs for PC/MAC Ideally in Win MacOSX (cocoa looks nice) and Linux or should I be looking at C# / Mono / QT / ??
There's 2 programming languages you need to learn. C++ (Treating C as a subset of C++ here), and everything else.
<snip>
No, do not just learn C, as a lot of 'next gen' languages are Object Oriented. If you only learn C, you won't learn about that, and be in for some strife if you do try and learn C#/Java/etc. Find a good C++ course, and get stuck into it.
I happen to disagree with that, for two reasons: 1) Object oriented programming is hugely overrated. 2) What C++/Java/C# etc compilers are there for microcontrollers? Having said that, I have to admit C is not a good teaching language as it allows the programmer to program very badly. Other languages impose constraints which force good programming practices, and for learning to program, they are to be preferred. But, as you say, you aim is to program microcontrollers effectively and efficiently. There is only one language (other than various assembly languages) you need to learn, and that is C. So ignore the computer scientists, who do not know what they are talking about - they have never programmed microcontrollers - and learn C. I think the best book is Kernighan and Ritchie. They wrote C and in their book they explain the justifications for why C is the way it is. Furthermore they write good C. The main problem is, the book is too expensive and I understand that they are not updating it for C99 (mind you, the second criticism may not be an issue for microcontroller compilers, since due to low sales, are not going to be in a hurry to update their compilers to the new standard). Having written the above I now see that your history was writing for microcontrollers and now you want to program PCs. Doh. Can't be stuffed rewriting this now.... Michael.

There's good stuff there anyway. I need to continue with micro's, and while I like assembler, (really efficient code.) and I can think in terms of registers. :-) the drive in the industry is have a C front end for the Micro-controller software. So I need to learn C. but that said, yes. I need to write the PC stuff now-days. as everyone wants to control the units we make from a PC, or manipulate the data they have collected. SO its looking like C++ for now, I'll phone around, someone must be teaching this, and Maybe I can squeeze a seat from a provider where this is just part of a larger course or something Unless someone has free time and wants to do some tutoring. I tend to try to put in linux solutions, unless I have to put it into windows. On Wednesday, April 28, 2004, at 05:22 PM, Michael Cree wrote:
I happen to disagree with that, for two reasons:
1) Object oriented programming is hugely overrated. 2) What C++/Java/C# etc compilers are there for microcontrollers?
Having said that, I have to admit C is not a good teaching language as it allows the programmer to program very badly. Other languages impose constraints which force good programming practices, and for learning to program, they are to be preferred.
But, as you say, you aim is to program microcontrollers effectively and efficiently. There is only one language (other than various assembly languages) you need to learn, and that is C. So ignore the computer scientists, who do not know what they are talking about - they have never programmed microcontrollers - and learn C.
I think the best book is Kernighan and Ritchie. They wrote C and in their book they explain the justifications for why C is the way it is. Furthermore they write good C. The main problem is, the book is too expensive and I understand that they are not updating it for C99 (mind you, the second criticism may not be an issue for microcontroller compilers, since due to low sales, are not going to be in a hurry to update their compilers to the new standard).
Having written the above I now see that your history was writing for microcontrollers and now you want to program PCs. Doh. Can't be stuffed rewriting this now....
Michael.
_______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

At 17:35 28/04/2004 Gavin Denby did say...
There's good stuff there anyway.
I need to continue with micro's, and while I like assembler, (really efficient code.) and I can think in terms of registers. :-) the drive in the industry is have a C front end for the Micro-controller software. So I need to learn C. but that said, yes.
You may be amazed at the advances in C compilers these days, the overhead can be as good as 1% and in most cases none. The worst case I have seen is 3%, but that was some complex coding.. Even coding in C you are still very aware of registers and I tend to code to suite the limitations of the micro in order to avoid stack usage.
I need to write the PC stuff now-days. as everyone wants to control the units we make from a PC, or manipulate the data they have collected.
Tell me about it, if it cannot plug into $3000 of hardware to do anything with it then it is frowned upon<grin>
SO its looking like C++ for now, I'll phone around, someone must be teaching this, and Maybe I can squeeze a seat from a provider where this is just part of a larger course or something
As I mentioned a lot of training providers offer VC++ for the NZQA qualifications, have not found any that offer gcc, but NZQA is owned by mickysoft so what do you expect<grin>
Unless someone has free time and wants to do some tutoring. I tend to try to put in linux solutions, unless I have to put it into windows.
Seriously have a look at Kylix, it may cost, but it is a good RAD solution and an evaluation version can be obtained. Also the teach yourself C books are very good, they assume you have BASIC programming experience or some none at all and they may not make a guru of you, but you will get a solid grounding.
On Wednesday, April 28, 2004, at 05:22 PM, Michael Cree wrote:
I happen to disagree with that, for two reasons:
1) Object oriented programming is hugely overrated. 2) What C++/Java/C# etc compilers are there for microcontrollers?
Having said that, I have to admit C is not a good teaching language as it allows the programmer to program very badly. Other languages impose constraints which force good programming practices, and for learning to program, they are to be preferred.
But, as you say, you aim is to program microcontrollers effectively and efficiently. There is only one language (other than various assembly languages) you need to learn, and that is C. So ignore the computer scientists, who do not know what they are talking about - they have never programmed microcontrollers - and learn C.
I think the best book is Kernighan and Ritchie. They wrote C and in their book they explain the justifications for why C is the way it is. Furthermore they write good C. The main problem is, the book is too expensive and I understand that they are not updating it for C99 (mind you, the second criticism may not be an issue for microcontroller compilers, since due to low sales, are not going to be in a hurry to update their compilers to the new standard).
Having written the above I now see that your history was writing for microcontrollers and now you want to program PCs. Doh. Can't be stuffed rewriting this now....
Michael.
_______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug
_______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

At 17:22 28/04/2004 Michael Cree did say...
On 28/04/2004, at 3:24 PM, Orion Edwards wrote:
1. Is C still a viable language to learn to write programs for PC/MAC Ideally in Win MacOSX (cocoa looks nice) and Linux or should I be looking at C# / Mono / QT / ??
There's 2 programming languages you need to learn. C++ (Treating C as a subset of C++ here), and everything else.
<snip>
No, do not just learn C, as a lot of 'next gen' languages are Object Oriented. If you only learn C, you won't learn about that, and be in for some strife if you do try and learn C#/Java/etc. Find a good C++ course, and get stuck into it.
I happen to disagree with that, for two reasons:
1) Object oriented programming is hugely overrated. 2) What C++/Java/C# etc compilers are there for microcontrollers?
Keil, Metroworks & Hi-Tech produce C++ compilers for microcontrollers. I have played with a number of Java engines for microcontrollers, nice idea but I while to go yet.
Having said that, I have to admit C is not a good teaching language as it allows the programmer to program very badly. Other languages impose constraints which force good programming practices, and for learning to program, they are to be preferred.
I actualy, and strange as it may be found starting with BASIC and moving to C was not very painful. Learning to program with pascal is the best way to go.
But, as you say, you aim is to program microcontrollers effectively and efficiently. There is only one language (other than various assembly languages) you need to learn, and that is C. So ignore the computer scientists, who do not know what they are talking about - they have never programmed microcontrollers - and learn C.
I think the best book is Kernighan and Ritchie. They wrote C and in their book they explain the justifications for why C is the way it is. Furthermore they write good C. The main problem is, the book is too expensive and I understand that they are not updating it for C99 (mind you, the second criticism may not be an issue for microcontroller compilers, since due to low sales, are not going to be in a hurry to update their compilers to the new standard).
Having written the above I now see that your history was writing for microcontrollers and now you want to program PCs. Doh. Can't be stuffed rewriting this now....
Michael.
_______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

But, as you say, you aim is to program microcontrollers effectively and efficiently. There is only one language (other than various assembly languages) you need to learn, and that is C. So ignore the computer scientists, who do not know what they are talking about - they have never programmed microcontrollers - and learn C.
On a tangent, is it wrong to think that one day microcontrollers will be programmed in higher level languages? "Back in the day", I'm sure there was only one language (other than various assembly languages) you needed to learn for mainframes. Craig

Craig Box wrote:
But, as you say, you aim is to program microcontrollers effectively and efficiently. There is only one language (other than various assembly languages) you need to learn, and that is C. So ignore the computer scientists, who do not know what they are talking about - they have never programmed microcontrollers - and learn C. C'mon Michael, thats a bit below the belt :)
On a tangent, is it wrong to think that one day microcontrollers will be programmed in higher level languages?
The problem with this concept is that higher level languages tend to make trade-offs sacrificing memory footprint, flexability and instruction count with code abstraction (which leads to faster development, portability etc.) and maintainability. Given that microcontrollers tend to be used in real-time environments, it's essential that the code be small, fast and predictable - not things that describe a Java executable. If an application is large or complex enough to warrant a higher-level language than C, you're probably going to use a decent micro on there, like a 200MHz ARM or so which will be plenty fast enough. Cheers James

Craig Box wrote:
But, as you say, you aim is to program microcontrollers effectively and efficiently. There is only one language (other than various assembly languages) you need to learn, and that is C. So ignore the computer scientists, who do not know what they are talking about - they have never programmed microcontrollers - and learn C.
On a tangent, is it wrong to think that one day microcontrollers will be programmed in higher level languages?
"Back in the day", I'm sure there was only one language (other than various assembly languages) you needed to learn for mainframes.
In the early nineties, a programmer was writing the firmware for set top boxes. The marketting guys kept changing their requirements, and the hardware guys kept changing their processor, so this poor programmer kept having to rewrite his code from scratch. Eventually he got irritated by this and decided to write a thin "VM" layer called "Oak" (named after the tree outside his window), and write his applications in that. Then when they changed the processor yet again, he could just retarget his VM and not lose all of his code. To make a long story short, the programmer was James Gosling, the company was Sun Microsystems, and the language was renamed from Oak to Java.

Thanks for the interesting comments to date, Just to fine tune my thinking, If a new programmer learnt C++ and then was handed some C code for tidy up, he would probably manage ok ??? Of course since no courses seem to be available, it may come down to books and self learning anyway. Both the polytech and uni are sending me course details, but neither course call centre understood a bean of what I asked.

Quoting Gavin Denby <redhat(a)ihug.co.nz>:
Thanks for the interesting comments to date,
Just to fine tune my thinking, If a new programmer learnt C++ and then was handed some C code for tidy up, he would probably manage ok ???
Yes. C is a subset of C++. You'll only really encounter issues with the API's - Pure C++ programmers tend to use things like iostreams and cout, whereas C you'll just get FILE* and printf. They're doing the same thing, just the API is different. The thing I like most about C++ is that you can use some of the nice things from C++ like the standard template library, but you also get to use all of the nice clean C things (printf). :-)

Thanks, Looking a little like time to visit the o'reilly website. After all they are sponsors :-) On Thu, 2004-04-29 at 11:25, Orion Edwards wrote:
Quoting Gavin Denby <redhat(a)ihug.co.nz>:
Thanks for the interesting comments to date,
Just to fine tune my thinking, If a new programmer learnt C++ and then was handed some C code for tidy up, he would probably manage ok ???
Yes. C is a subset of C++. You'll only really encounter issues with the API's - Pure C++ programmers tend to use things like iostreams and cout, whereas C you'll just get FILE* and printf.
They're doing the same thing, just the API is different. The thing I like most about C++ is that you can use some of the nice things from C++ like the standard template library, but you also get to use all of the nice clean C things (printf).
:-) _______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

On 29/04/2004, at 11:25 AM, Orion Edwards wrote:
Just to fine tune my thinking, If a new programmer learnt C++ and then was handed some C code for tidy up, he would probably manage ok ???
Yes. C is a subset of C++.
A clarification: C is for the most part a subset of C++. There are some subtle incompatibilities. I unfortunately forget what they are. If you are programming in C, having learnt C++, keep in the back of your mind that there might be a sting in the tail somewhere if you assume that C is a subset of C++. Cheers Michael ---------------------------------------------------------------------- Dr Michael Cree Email: cree(a)phys.waikato.ac.nz Senior Lecturer Dept. Physics and Elec. Eng. University of Waikato Private Bag 3105 Fax: +64-7-8384835 Hamilton Telephone: +64-7-8384301 New Zealand

Just to fine tune my thinking, If a new programmer learnt C++ and then was handed some C code for tidy up, he would probably manage ok ???
As long as they understand the difference between C++ and C, they'll be ok. If they get it wrong though, the compiler will give errors, and they might not understand why. Subtle things like where you can declare variables, which IIRC C++ doesn't really care about, whereas C maintains that you must have the delcaration of all variables before any statement lines in a given program block. I'm not really a C++ coder however, so I won't venture any more points of difference :). Mixing C and C++ code (between objects) can also be a pain in the ass, and a trap for young players.
Of course since no courses seem to be available, it may come down to books and self learning anyway. Both the polytech and uni are sending me course details, but neither course call centre understood a bean of what I asked.
Uni courses aren't aimed at teaching your how to program in a specific language. The COMP209 course James mentioned actually teaches you about OOP, not about C++ or Java. Likewise, the first year courses teach you programming concepts, not specifics about a language. In the past they used C or C++ to teach these, but whether they do or not any more I don't know, and it's likely to change at the drop of a hat any way. The point here is that if you know how to program in a procedural programming language, you should be able to pick up other procedural programming languages fairly easily. Likewise for any paradigm really - an experienced C++ coder moving to Java will find it trivial. Crossing the paradigms are a bit hardware - I've seem some really horrific Java code that would have been not nearly as horrific if it was written in C, simply because of expectations of the language (Java programs should follow OOP guidelines, this basically used a class as a way to call main() which then ran the whole program in a loop. Ick. Slightly more acceptable in C, but still ick :) I can't really speak from experience about Polytech courses, so won't attempt to. They do seem to focus on languages like Delphi however (ObjectPascal is the underlying language in Delphi), which is a different kettle of fish to C++ (Delphi is RAD based, and primarily RAD driven too, although you can do what you like really. ) The biggest problem you'll hit is with the libraries - and this will always be the case in any language. It takes a long time to know the library sets for a language well enough to make use of them comfortably. Python, for example, is a really small language - takes about 10 minutes to learn - but has a huge standard library set to use that I have got nowhere near mastering. BTW, if you want to buy oreilly books, you can get 20% discount as a paid-up LUG member. And you can borrow books from the WLUG library as a paid up LUG member. (yes, that means we could request the orielly C/C++ books for the library ) Daniel

* Daniel Lawson <daniel(a)meta.net.nz> [2004-04-29 02:17]:
Subtle things like where you can declare variables, which IIRC C++ doesn't really care about, whereas C maintains that you must have the delcaration of all variables before any statement lines in a given program block.
Well, up until C99, which gives you more freedom in that and other regards. -- Regards, Aristotle "If you can't laugh at yourself, you don't take life seriously enough."

I've tried and tried, but I don't have the will to bite my tongue any longer.. * Orion Edwards <orion(a)coke.net.nz> [2004-04-28 05:25]:
except for godawful things like lisp and haskell, but those are rarely used outside of academia.
LISP is anything but godawful. Haskell is not very well suited to applications, which does indeed limit its use outside academia, but is not at all godawful either. They're not made for writing hardware drivers, operating systems kernels, firmware, or other such stuff in, of course. They're very highlevel languages, not systems programming languages. But (far from only) my opinion is that writing applications in systems programming languages like C or C++ is simply madness for anything non-trivial, unless you happen to be a masochist. A very highlevel language (yes, like LISP) is much better suited for tasks like that. Java is a bastard child, systems programming language on the outside, and more of very highlevel language on the inside; in my eyes, you get the worst of both worlds, though to someone who has been using honest to god systems programming languages it must seem like a godsend. For systems programming, I'd stick to plain C. -- Regards, Aristotle "If you can't laugh at yourself, you don't take life seriously enough."

At 15:18 28/04/2004 Gavin Denby did say...
Having lasted 25 years as an electronic Tech, I am needing to expand to cope with the continued blurring of the line between when the electronics start and the Programming of PC's takes over.
I already write assembler for microcontrollers (programming from 2K to 2 meg in assembler) and really should be using c for this, but have never took the time to learn it.I have however programed in both Portran (port-a Punch) and basic many years ago.
Hi Gavin, I have been using C with the HC05/08/11/12/16, 805x, PIC and AVR families for a while now and you cant beat it for writing unified code as the portability issues are now largely redundant.
Ancient history lesson ends
I basically need to program PC's to set up/ colect data/ process data and probably via a graphical interface.
so my question ... in 2 parts:
1. Is C still a viable language to learn to write programs for PC/MAC Ideally in Win MacOSX (cocoa looks nice) and Linux or should I be looking at C# / Mono / QT / ??
It seems that all later programming languages seem to be adding to C (extend .. embrace ??) so Would C be a good start place ?
All opinions welcome.... and crystal ball gazing will be entertained.
Your choice of language will largely depend on how you accrue the data from your products. I have been coding in C to retrieve data via the serial port, mostly in DOS. With the need now for using USB it means moving into another language is worth while and have been looking at Delphi and Kylix, both based on Pascal and provide all the needed GUI functions etc.. for Win and Linux platforms. Cannot comment on Macs.
2. Does anyone have experience with a good course / course provider that they would recommend to provide such training.
I would prefer part time training, as my family like to eat, but this is flexible, as I can work nights/weekend is the course is not too long.
I think the Open Polytechnic offers Delphi as a learning option, most seem to offer VB or VC++.
Of course, then I could apply for the job that just hit my inbox too :-)
Thanks in advance.
_______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

Gavin Denby wrote:
I basically need to program PC's to set up/ colect data/ process data and probably via a graphical interface.
so my question ... in 2 parts:
1. Is C still a viable language to learn to write programs for PC/MAC Ideally in Win MacOSX (cocoa looks nice) and Linux or should I be looking at C# / Mono / QT / ??
If you are looking to make the transition from ASM to higher level languages, I highly recommend C as a stepping stone. "The C Programming Language - Second Edition (ANSI C)" by Kernighan and Richie is the one true C "bible". Being an ASM programmer you will pick C up quickly once you're used to the syntax and adjust to the debugging methods.
It seems that all later programming languages seem to be adding to C (extend .. embrace ??) so Would C be a good start place ?
All opinions welcome.... and crystal ball gazing will be entertained.
C++ is a massive language, but as Orion pointed out, once you learn C++ you will have dealt with >90% of the concepts that exist both in procedural and object orientated languages. For doing data capture, I would recommend C or C++ for the backend and C++ or C# (mono appears to work really well) for a front-end; obviously if you're going to write a monolithic application, then C++ is your best choice.
2. Does anyone have experience with a good course / course provider that they would recommend to provide such training.
I would probably recommend COMP209 at the uni if it was still a C++ based course, but I believe it's Java based now. James

Gavin Denby wrote:
1. Is C still a viable language to learn to write programs for PC/MAC Ideally in Win MacOSX (cocoa looks nice) and Linux or should I be looking at C# / Mono / QT / ??
C is still viable in general, though perhaps uglier than other languages if you want to work with graphical interfaces. e.g. in Windows you'll have to use the Win32 API or something, Carbon in MacOS and I guess GTK+ in Linux. Perfectly doable though. C++ is probably the way to go if you're prepared to learn object oriented programming. That way you can use MFC in Windows, or Qt in Linux/Windows/MacOS. It's also easy to go from C++ to either C or C#. Learn C# if you want to be hip. MacOS's Cocoa uses another language - Objective C. -- Jason Le Vaillant
participants (10)
-
A. Pagaltzis
-
Craig Box
-
Daniel Lawson
-
DrWho?
-
Gavin Denby
-
James Spooner
-
Jason Le Vaillant
-
Michael Cree
-
Orion Edwards
-
Perry Lorier