C You Later
idbruce
Posts: 6,197
Hello Everyone
Just wanted to share a couple thoughts with you.....
Someone recently told me that they were reluctant to learn C, and I was somewhat understanding, because even though I am familiar with C and C++, I was also reluctant to walk away from the comfort zone of programming in SPIN.
After jumping back into C, I want to tell all those reluctant people, that my Propeller programming has never been so productive. Most of my code is already written for me and most of all of my problems have already been solved by someone else. All I have to do is a little searching and WHOLA, there she blows, problem solved.
Believe me, I can understand how difficult it may appear, because I have been there myself, but trust me, you will never regret jumping in and learning the language, and I just want to encourage all of those reluctant forum members to become more productive.
Bruce
Just wanted to share a couple thoughts with you.....
Someone recently told me that they were reluctant to learn C, and I was somewhat understanding, because even though I am familiar with C and C++, I was also reluctant to walk away from the comfort zone of programming in SPIN.
After jumping back into C, I want to tell all those reluctant people, that my Propeller programming has never been so productive. Most of my code is already written for me and most of all of my problems have already been solved by someone else. All I have to do is a little searching and WHOLA, there she blows, problem solved.
Believe me, I can understand how difficult it may appear, because I have been there myself, but trust me, you will never regret jumping in and learning the language, and I just want to encourage all of those reluctant forum members to become more productive.
Bruce
Comments
Ken Gracey
Yes I agree, Andy did a bang up job. SimpleTools and SimpleText are very nice tools to have, but in reality, I was referring to code in the outter limits of the internet. There will be many times when you just need code to get the job done, various routines to accomplish various tasks, nothing Propeller specific. There is tons of C code out there
Now where is your C-controlled figure 8 robot, good sir?
Surely you jest good sir. I am up to my head with the 3D printer project. It is coming along though. Tracy Allen just help me over a MAJOR hurdle. Thank goodness for his assistance.
As a practical matter though one can fit a lot more functionality into a Propeller using Spin. Spin's byte codes are very space efficient.
Spin is potentially a lot easier to teach beginners than C or C++. Like BASIC in the old days.
What we need here is working, cool, examples of C programs on the Prop.
Ouch!
I am working on it
Picturing Heater. in the famous playground pose with his hands over his ears saying "I can't hear you! I can't hear you!" :O)
Doesn't CMM approach Spin's compactness, and run at approximately the same speed? All while providing the option for inline assembly?
I can't argue the simplicity of the language compared to C/C++. It is much simpler. If had to teach someone to program for the first time, it would not be C or C++. Then again - it also wouldn't be on an embedded system.
x2 on that. I've seen very little in terms of completed C/C++ projects for the Propeller. I don't know if people aren't writing them or aren't sharing them . PropWare has demo programs for each module, but I'm guessing you were referring more to real projects than short demos.
What is it with all these new-fangled programming languages popping-up everywhere and non of them are as readable as BASIC.
DOS and a wonderful programming language called QuickBASIC enabled this know-nothing programmer to become self employed in the mid-eighties and I have kicked competitor's butt ever since. While my competitors were spending time compiling/linking/burning EPROMs, I had this wonderful threaded p-code interpreter which let me make changes on the fly without having to halt execution of the program. Now, when we are talking process control, this is a HUGE advantage because the process does not need restarting for every code change.
Nothing out there has impressed me as much, since!
Still in business and still kicking butt and still using BASIC (B4A for Android programming).
I keep visiting the forum in the hope that Bean has announced a new PropBasic development :-D
My first experience of programming was in BASIC. Entered at a teletype and run on a mainframe in a far off city.
How is that different from talking to an MCU on your desk via a serial link from a terminal on your PC?
Again beginner programmers get along with that set up just fine with their Arduino's. Not to mention BASIC Stamps before that.
I would argue that such an "embedded" approach is a good introduction to computing, it removes a ton of abstraction and gets your program directly affecting the real world, flashing that LED or tweaking that servo.
I believe Bean stated several weeks ago that it was dead in the water due to something or other, but I could be wrong. Yea, I suppose BASIC would be another good language, with similar support. I never messed around with it, except for a few ports here and there.
Mickster,
I agree, it a shame Parallax couldn't come to some sort of arrangement with Bean.
If it was reasonable, Parallax would have almost a complete BASIC that they could add to the more complex C/Forth/Spin.
There actually seem to be few uCs that can be programmed with BASIC, which is really a shame.
Yes sure, having line numbers and Goto is just so old school.
The thing is, those are the training wheels that are just so helpful for the beginner.
Yes we want to get kids to learn to program, and program with an eye towards 'flow' and structure.
But the fact is, line numbers and Goto are there to help kids/beginners get out of those situations where they've got themselves stuck.
Not having those early hand-holds at the early stage probably puts off far more kids from the whole programming thing than not. Because they have to rip half their program apart and restructure it to avoid whatever problem they encountered.
Takes a certain kind of masochism to persevere to a future point where they've made their mistakes, realized Gotos are as much a hindrance as a help, and are able to then forge ahead to a more structured language/environment.
Not too mention how many schools sit around looking at the options available for computer labs, and figuring out who wants to learn a language to teach it, or more properly, who is going to be directed to learn it. Being one of the few options which has BASIC as an approved language might be a deciding factor in more than a few instances.
Hey Mickster & Koehler !
Ken let some PropBASIC thoughts slip recently on another thread, so it would seem all is not completely lost. We might need to keep a spare eye on the forum for future news!
http://forums.parallax.com/showthread.php/159928-Is-it-time-to-re-examine-the-P2-requirements?p=1318706&viewfull=1#post1318706
Yours sincerely, another PropBASIC fan !
The Arduino world is a testament to the fact that newbies can learn with C/C++, for sure. But I think they could learn a lot faster by starting with Python on desktop to grapple the basics, then move to an embedded system after they understand the concept of loops, if-statements and functions. Having an easy-to-read interpreted language helps a ton. And having a shell open with which you can type and run your code line-by-line is invaluable to any age programmer, but especially a newbie.
~David
I don't know about that GOTO thing. My feeling is that if you want to teach "goto style" programming, with flow charts and all, you're better off doing it in assembler. In fact when we were teenagers exposed to programming for the first time after a quick intro with BASIC we were expected to be proficient in assembler at the end of the year as well. Soon after that I started to think that BASIC was a waste of our time, very restricting, we could have been using a real language already instead.
@SwimDude0614
I do agree about the Python approach. As you say having that instant feed back of the REPL is very encouraging to a beginner. I think that's why many CS courses used to start out by introducing programming with Scheme. And BASIC of course.
It need not be Python of course. JavaScript will do as well as things like Scheme and God forbid Forth.
Of course you can do all that on an embedded system now a days. The Raspeberry Pi for example. Or JavaScript on the tiny Espruino boards: https://www.kickstarter.com/projects/gfw/espruino-pico-javascript-on-a-usb-stick
or Python on the tiny MicroPython boards http://micropython.org/
I need to be productive to pay the bills so I don't fall for the Emperor's new clothes of programming languages (C), I use what gets the job done and remains readable for future maintenance, etc.
I really, really, really believe that a refined PropBASIC would be a huge success for the Prop. I for one would pay $$$ for such a thing.
The CFUNCTION section is where the binary for the compiled C program goes, the actual C code follows in the comments at the end. You do need to compile the C program with MPLAB to get the binary but once you have that, you can just pass the function around as text.
What we believe is that if you are going to use a modern BASIC with all the structured programming goodness of other high level languages you might as well use one of those other high level languages. Then you get the benefits of, a better language, standardization and cross platform support. Do what? I know BASIC was around about a few years before C. But as we are talking nearly 50 years ago I would hardly call either of them "new clothes".
@mindrobots,
In the recent context of this discussion, ease of use for newbies, that embedding compiled code as hex into your source is nuts. Well, it's nuts anyway:)
I agree. Siemens used a language that reminded me of Basic on a building automation system I worked on 3 or 4 years ago. Very simple modular structure without a truck load of special symbols, brackets, and such, and without line numbers. I had never worked with this system before but it was so straight forward that a couple of hours looking through the code was enough to make some minor changes to the code. A basic written with the same philosophy would be a good starting point for someone getting started with microcontrollers.
If that Basic was written for the Propeller in a manner that allowed it to assign the standard peripherals (serial, parallel, I2C, SPI, etc) to whatever pin(s) they wanted it could be a great learning tool and useful for many projects. The peripherals would be code that is loaded to one of the remaining cogs by a "start" or "open" statement.
JavaScript? Ugh. You make me sick. I'd rather program in whitespace than JS - it's more legible!
I do love the MicroPython board. I got one from the kickstarter campaign and had a blast playing with it for a bit. Unfortunately... just like the Propeller... I have nothing to do with it. And it obviously doesn't need a HAL... so it just sits and collects dust with the rest of my toys.
Oh, and I don't consider the Pi an embedded system. It runs full-blown Debian with a GUI and everything. The only thing embedded about it is the System-on-chip hardware design, which most programmers aren't even aware of. With that said, I absolutely agree. I quite enjoy teaching to program on this and encouraging students to try out crazy things like "sudo rm -rf /" becase it's so easy to wipe the system clean and do it again!
http://www.phrases.org.uk/meanings/the-emperors-new-clothes.html
Haha!! Yes, I can see it now:
Learning BASIC
Chapter 1 - Using Variables
Chapter 2 - Program Control and Functions
Chapter 3 - Embedding C Programs as extensions to the BASIC language
Appendix A - BASIC Language Reference
Appendix B - C Language Reference for Writing Embedded Functions
If I recall, the CFUNCTION feature was added for slight more advanced users than the newbies!
JS was only presented there as an example of a language that can be used from a REPL for ease of use by beginners. Legibility seems to be, to a large part, in the eye of the beholder. Perhaps you would prefer the much cleaner syntax Scheme: A very fine language used to introduce people to programming for decades.
As it happens I backed the Espruino kickstarter and got two boards. They are also gathering dust in my toy pile. One of the main reasons I backed it was because the deal was that Gordon Williams would open source his JS engine if the target was met. I was curious about getting that engine running on the P2 at some point.
I hoped my coworker, a Python head, would get the MicroPython for us to play with a bit. Sadly that never happened.
Perl is a nice "starter" language!! (ducking, bobbing and weaving!)
I'm fully aware of the meaning of "The emperor's new clothes". We can take it as "The label given to any fictional item that viewers have been induced into believing as real.."
So taken in that light your statement... ...is very confusing to me. Are you saying that the C language we use everyday does not exist? That's absurd.
Emperor's new clothes of programming languages?? You do realize that by computing standards "C" is positively ancient, right? While it's not the best language for all applications or situations the popularity and longevity says a lot of good about it!
Back in the day we did a similar thing by using BASIC POKE commands to get binary code into the machine. Effectively BASIC was just the means of loading our programs.
Well, in that case, why not just use C or whatever compiled language? The BASIC thing is just getting in the way.