2

Author Topic: The C barrier  (Read 4702 times)

0 Members and 1 Guest are viewing this topic.

Offline azyTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
The C barrier
« on: November 15, 2010, 12:37:29 AM »
The C barrier

The C barrier is the wide chasm that separates the casual basic coder and denies him most of the sweets in the shop.

While the obvious thing to say is just learn C, this is a jump too far for the vast majority of potential robot builders who have the skills and creativity (but not the C) to make a masterpiece that far outstrips the capabilities of by the numbers hobby kits.  Learning C from scratch to a level equal to their proficiency in their native language would require a mental investment of many years. A price "too high" to pay if you only have a few hours a week to dedicated to your hobby. Quite simply & understandably they just don't bother & wander off to find a more rewarding return on their investment in another arena.

C , great as it is , is 10 times more complex than old school basic, and that cannot be denied. In addition very short simple programmes take twice as long to code in C as they do in basic even if you are proficient & 10 times longer if you are new to C


While i can happily accept that the robotics community will always divided between those who do (C) and those who don't. There is huge market that could be captured if a rope bridge was placed across the chasm. If this bridge where built then the hobby robotics community would double in size and so would the number of hardware units sold = $$$,market share Kudos & worship  ;D



An indecent proposal based on the premise that flying 2 inches off the ground is still flying

The C community could build that rope bridge by laying 1 vine across at a time as follows. (by adding a few lines of code to existing software ) Using a simple txt file to share paramaters between the manufactures program and the hobbyuser programme written in  mynativelanguadge of their choice. The manufactures program doing that hard bit of converting and translating


output to hardware


mynativelanguadge  write to txt file "do this, do that, do something else"

C bridge , read from txt file then convert and translate into required format

input from hardware

C bridge get values then convert and translate into required format, write to txt file " this happened, that happened, this is the state now"

mynativelanguadge read from text file " this happened, that happened, this is the state now" & make a decision



mynativelanguadge program would simply be this

1 write to file
2 read from file
3 if A = B then C=1
4 goto 1
5 rem in a single stroke! this enables you to bring your entire native coding skills to bear)


Agreed this is of ZERO value to any C programmer, but it would be a GODSEND to any one capable of writing a "hello world" program

while reading and writing to text files means there is a short delay, 80% of what you might want to do would NOT be effected. Some abilities & fuctions may be lost. But flying 2 inches above the ground is STILLl flying..... the words confusion, frustration & rejection have been replaced with inspiration, rewarding and I can  = Cheque in the post


is it me or is the world missing a big , if slightly ugly trick.....if it works and its stupid its not stupid  :o
« Last Edit: November 15, 2010, 01:20:57 AM by azy »

Offline billhowl

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 32
  • Your success is in your hands.
Re: The C barrier
« Reply #1 on: November 15, 2010, 03:40:32 AM »
If you like BASIC and try to program your Robot in BASIC, here are the list of

AVR Basic Language
BASCOM-AVR IDE
http://www.mcselec.com/
OSHON SOFTWARE PROJECT AVR SIMULATOR IDE
http://www.oshonsoft.com/
or you like free...
Great Cow BASIC - Open Source BASIC programming tools for Microchip PIC and Atmel AVR microcontrollers
http://gcbasic.sourceforge.net/





Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
Re: The C barrier
« Reply #2 on: November 15, 2010, 05:01:06 AM »
Learn Python, it is simple like basic but much more capable like C.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: The C barrier
« Reply #3 on: November 15, 2010, 05:47:15 AM »
Hi,

Well, I know my C/C++ but hate its inherent ugliness and low readability. I am quite proficient in a number of interpreted as well as compiled languages and assemblers actually, but I use BASIC most of the time anyway. Not that it resembles anything like GWBASIC or is as inefficient as Visual BASIC - I'd say it's perhaps closer to a hybrid between BASIC and Pascal (with some extra goodies thrown in).

That's for the PC of course. For µcontrollers I use BASIC (blended with assembler) as well.
Both of them is called PBP (a bit confusing at times), which stand for Power BASIC Pro and PIC BASIC Pro respectively.

In PowerBP, you can load a GW program and run it, usually without much change, if at all, so it's a quite shallow curve to get started, if you're already proficient in GW (but mind you, if you are coding "dirty" or make spaghetti code, you're in for a wake up call).

I think your outburst is based in a lack of assessing the market, you need to get out more   :P
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline azyTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: The C barrier
« Reply #4 on: November 15, 2010, 11:08:28 AM »
hehe , I'm still in brain dribbling out of my ears mode. Information overload. Cant see the wood for the trees more than anything else.

all ?  ::) im after is a tilt n pan module for my camera that i can talk too from my Freebasic program, 1 week later still no closer to a solution. Way to deep to consider coding the servos directly as you say. Slipping in a few lines of code to shunt parameters across looks the easier path. Some terrific kit out there i must say. Lot of bang for your buck. It aint gonna happen for me though. I need to find some WYSIWYG kit or just pay someone .


Big thanks for the links and info
. There is a huge amount of quality information on this forum. A+ for that. loads of stuff on the web too.

as a newb coming in from the outside i have to say 99.9% of all that quality information is totally indigestible. One box looks and sounds the same as the other, one abbreviation melts into the next. While it gives me total confidence that whatever i want theres prolly a dozen ways to skin that cat i get the feeling rolling a dice is a good a move as any lol.

you've got the 50 dollar robot thing going, i guess that's where most noobs start and work their way up from there.

Not my ride though, I'm after some pretty specific stuff that's away from the core products, so its a double headache for me.

I did dload the AVR IDE simulator whatever that is ? following the intro I clicked about 100 buttons,6 windows all over my screen and literally 100s of checkboxes, must of missed 1 of those 100 steps....immediately entered "am i bothered mode" , must be an easier way....there is see my header post lol.



« Last Edit: November 15, 2010, 11:56:08 AM by azy »

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
Re: The C barrier
« Reply #5 on: November 16, 2010, 07:26:04 AM »
I think you need Arduino!
arduino.cc


Offline azyTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: The C barrier
« Reply #6 on: November 16, 2010, 10:28:47 AM »
thanks for the screen shot

getting two different bits of software to talk to each other , eg basic and c , or anylanguafge and bundled software is tricky unless you are an experienced coder. This is holding back hobby builders more than they realize.  We are at the dawn of a new age in robotics, machine learning is the next phase, but communication barriers have to be overcome before you can turn your dumb bots into smart ones.

There is a lot of realy powerfull brain software out that your not able to tap into simply due to communication barriers. your $50 dollar can easily be endowed with doglike inteligence via wifi conection to your pc.

You could be playing chess or poker with your robot arm & losing badly

Your pc armed with a webcam could be giving a u thrashing at scalextric.

You could even play I spy or hide and seek withyour 50 dollar robot, with a bit of imagination it can be player 2 on your playstation.
Sat beside you on the sofa kicking your butt at Tekken

you could even be having a semi inteligent coversation with your hexapod robot...about football ! or whatever


A terabyte harddrive cost next to nothing, dual core and quad core pcs armed with gigs of ram have a huge amount of processing power. Fishing an old pc out of a skip and dedicating it as a wireless brain will keep the, i can do it for pennies brigade happy, why stop at 1 ? , you will be runing out of space and starting to worry about your electric bill long before your wallet feels the pinch.



the great thing about a having universal software brain is that its cheap and costs nothing to replicate. Dloading a few hundred megs of brain software and you have a $50 bot that far smarter than ASIMO...if only it could talk to the hardware in a simple fuzzy fashoin

all you need is a wireless link and a communication bridge with brain software running on your pc....thats my 2 cents

ASIMOs new artificial intelligence. (ASIMO is learning!)
« Last Edit: November 16, 2010, 11:16:09 AM by azy »

Offline blackbeard

  • Supreme Robot
  • *****
  • Posts: 575
  • Helpful? 4
Re: The C barrier
« Reply #7 on: November 16, 2010, 02:00:42 PM »
C is not more complicated then BASIC. more fickle perhaps and C certainly requires a bit more thought then VB but all in all it's not any more complicated then French is to English. if you REALLY want a computer culture shock you should look into assembly! C is lower level then basic but assembly is the last line before you're typing 1s and 0s.
"sure, you can test your combat robot on kittens... But all your going to do is make kitten juice"

First step: Build androids with AI
Next step: Give them vaginas

Offline azyTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: The C barrier
« Reply #8 on: November 16, 2010, 02:46:11 PM »
C is 10 times if not 100 times more difficult than basic !!! for a beginner once you have learned C , 18 months graft if you got talent & ability then you will be able to write some usefull code.....only after 18 months hard graft will C become as easy as basic (this could be true)

I cant code for toffee in basic, but i can still code short programs faster than any C programmer ever could ! , crap as i am in basic, it would still take me 18months to 3 years graft to equal my basic coding ability with C.....you forget how much you have learned, & probably underestimate your natural talent for coding.



I got nothing against C whatsoever, anyone who needs to program at any level above casual hobby should learn it. ( I have written a kick but brainsoftware in basic that i would never have been able to in C as it would have doubled the time, but that is a very rare exception to this rule...not many programs take 25 years to write ! lol )


Earn Beer solving my problem

http://www.societyofrobots.com/robotforum/index.php?topic=12617.0
« Last Edit: November 16, 2010, 02:57:02 PM by azy »

Offline Asellith

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 648
  • Helpful? 9
  • "I'm a leaf on the wind. Watch how I soar"
Re: The C barrier
« Reply #9 on: November 16, 2010, 02:51:10 PM »
The only formal programing training I have had is in C programming (one college course). I write ugly code because all the commenting and formatting techniques where not drilled into my head but it works. Maybe it just comes easier to me but the only languages I have problems with now are object oriented ones because they are so fundamentally different. The rest are just learning a bit of syntax. C isn't complicated but it is so low level that everything higher feels so much easier to program in. I've learned python,VBA, and C# among other smaller projects needing modifications or simple scripts in C++ and javascript. All that behind a firewall that doesn't let me get to 75% of the forums out there. It always easier to get into habits of concentrating on things like what kind of variable you need and then not need them then to go the other way. I loved learning python but I still thought in C and converted it.

With the amount of tutorials and projects out there for C I will always recommend that people sit down and learn it along with the generic best practices (my short falling) for programming. Its like soldering, a skill that is hard to start with but once you learn it you will use it so much that you will wonder how you survived with out it.
Jonathan Bowen
CorSec Engineering
www.corseceng.com

Offline chelmi

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
Re: The C barrier
« Reply #10 on: November 16, 2010, 03:59:50 PM »
there is also a brain barrier with C , id say 1 in 10 human beings could be fruitfull with there efforts in C

Id say 9 out of 10 people including your grandma could be fruitfull with a simple version of basic.

you need a certian kind of brain to get something out of C , so its not just the 18 months investment to crack it, for 9 out of 10 people they will crack first.

It all depends on what you mean by "fruitful". To write a simple helloworld, you are probably right. To write relatively complex embedded software for robotic ? you will probably go from "9 out of 10" to "1 out of 10".
(imperative) Programming languages are more or less all equivalent. The only difference is how you express things not what you can express. And as soon as you start writing "real" programs then the language your are actually using doesn't matter so much because you spend more time thinking about the algorithm itself and not about how to actually write it (the syntax)
To come back to your example, your grandma won't be able to program a robot even in basic (unless your grandma is a computer scientist, a mathematician, ... ;) ).

Yes, it will be quicker to write some type of program using high level languages (like java, python, C#,...) but it is also necessary for other types of application to have access to the hardware itself and in this case, C is the best so far. What I'm trying to say is that each language has its own benefits.

One last word about basic: it was meant as a way to teach programing. And by teaching programming I mean introduce people to how a computer is programmed and what are the general principles of programming. But once you've spent some times learning the basics (pun intended), the move to a "real" programing language is not that hard. Trying to use basic everywhere is a nonsense IMHO.

Id say the3 barriers are

[] 18month investment before usefull return vs 18 days with a simple basic (imediate feedback is encouring wth basic)

[]You got to have the right kind of brain to be fruitfull. This barrier can never be overcome

[]The nonintuitve IDE is a killer if you are trying to teach yourself, your reverse engieering unknowns and illogical happenings. This barrier is removed if you did it at college.

1) Again, define useful. My first programming course was in C, and after a few weeks I was able to do basic stuff. (like the example below)
2) No. If you really understand programming in basic, then there is absolutely no reason why you could not learn C. It will take you some time but you will be able to program in C.
3) It depends on how you teach yourself. If your hope is to take random code from the internet and reverse engineer it, you won't get far. Start with simple examples, there are plenty of tutorials out there.


Adds text to current dislay line while person is typing and increases
the cursor position

#include<dos.h>
void interrupt our();
void interrupt (*prev)();
void writechar(char ch,int row,int col,int attr);
int a,b,kp,run=0;
char far *scr;
void main()
{
scr=(char far*) 0xb8000000;
prev=getvect(9);
setvect(9,our);
keep(0,500);
}
void interrupt our()
{
kp++;
if(kp==5)
{
run++;
_AH=3;
_BH=0;
geninterrupt(0x10);
a=_DH;
b=_DL;
if(run==1)
writechar('M',a,b,7);
if(run==2)
writechar('S',a,b,7);
if(run==3)
{
writechar('P',a,b,7);
run=0;
}
b++;
_AH=2;
_BH=0;
_DH=a;
_DL=b;
geninterrupt(0x10);
kp=0;
}
(*prev)();
}
void writechar(char ch,int row,int col,int attr)
{
*(scr+row*160+col*2)=ch;
*(scr+row*160+col*2+1)=attr;
}


10 rem This is a basic program
20 screen 7
30 cls
40 print " hello"
50 input "type a word"; a$
60 print a$
70 for I = 1 to 100 step 2
80 print "odd numbers", I
90 Next I
100 input " press enter to run again" anykey$
110 if anykey$="s" then end else goto 30

no comparison if you ask me


 ::)
Thats not a fair example...
You used a very low level approach in your C example. The standard C library provides function to do this in a few lines

Code: [Select]
#include <stdio.h>

#define LINE_MAX 100

void main(void) {
  char key;
  do {
    char line[LINE_MAX];
    printf("hello\n");
    printf("type a word: ");
    gets(line);
    printf("%s\n", line);
    for(int i = 1; i<100; i+=2) {
      printf("odd number %d\n", i);
    }
    printf("press any key to run again\n");
    key = (char) getc(stdin);
  } while(key != 's');
}

I agree it's not as simple as the basic version, but not impossible to understand...

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
Re: The C barrier
« Reply #11 on: November 16, 2010, 04:49:01 PM »
Quote
The bottom line is NO ONE LEARNS C UNLESS THEY GOT A DAMN GOOD REASON, but lots of peeps will play with basic outa curiosity.
This, is your opinion. It is not true. You can not prove it to be true, and we can not prove it to be false.


azy, you are focusing way to much on the IDE. You talk about M$ (microsoft visual c? man you are old  ;D) being a horrible IDE, and yes that is true, but C is not. You probably also know that Visual Basic is just as horrible. You need to compare languages, not IDEs.

And in that sense, in my opinion, both BASIC and C/java and those variants are all bad. They are like foreign languages when they should not be.

That is where I think Python will be the future. It isn't perfect, but it is very easy to understand, like traditional english. A for loop example like blackbeard said would be:

Code: [Select]
for number in range(10):
     if thingyouwanttobe:
           effect = 1

That's it, very simple, no crazy setups, no brackets, no colons, just like that and it will run.
« Last Edit: November 16, 2010, 04:51:40 PM by Razor Concepts »

Offline azyTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: The C barrier
« Reply #12 on: November 16, 2010, 05:36:33 PM »
Question

What version of C and IDE would you recommend for a cautious beginner to programming

What version of C and IDE would you recommend for a an intermediate basic programmer looking to join the modern world

Offline blackbeard

  • Supreme Robot
  • *****
  • Posts: 575
  • Helpful? 4
Re: The C barrier
« Reply #13 on: November 16, 2010, 05:38:09 PM »
you also need to consider cost. the whole reason C is popular in robotics is that micros and inexpensive sbc can be pushed allot farther using a lower level language. think about it this way, an atmega328 is $5 if you buy it on ebay and maybe much cheaper from other sources whereas even an old laptop with a parallel port might cost you like $40. visual basic is nice because it essentially spoon feeds you most of your code these days but a micro can do most of the hardware related tasks while still interfacing with your computer for the visual aspect of VB or VC++. there are things that you need a full computer for but they are very specialized. you seem like you're scared about it honestly and that's not really a good reason to condemn one of the most powerfull programming languages.

Question

What version of C and IDE would you recommend for a cautious beginner to programming

What version of C and IDE would you recommend for a an intermediate basic programmer looking to join the modern world


for both i would recommend a software called codeblocks. it's a free and very powerful programming environment! visual C express is also free and is allot like visual basic. i've found it harder to use though
« Last Edit: November 16, 2010, 05:40:23 PM by blackbeard »
"sure, you can test your combat robot on kittens... But all your going to do is make kitten juice"

First step: Build androids with AI
Next step: Give them vaginas

Offline blackbeard

  • Supreme Robot
  • *****
  • Posts: 575
  • Helpful? 4
Re: The C barrier
« Reply #14 on: November 17, 2010, 01:34:47 PM »
you forget linux

anyway you're talking as if C is as bad as assembly. it's not... it's litterally one of the most well rounded languages around and it exists because low level languiges of it's type run much more efficiently then higher level ones like basic. visual basic isn't even compiled from what i understand and windows has a runtime built in that interprets VB programs which is why only windows programs can be made with it. here take a look at "hello world" in assembly.

section   .text
    global _start         ;must be declared for linker (ld)

_start:               ;tell linker entry point

   mov   edx,len   ;message length
   mov   ecx,msg   ;message to write
   mov   ebx,1   ;file descriptor (stdout)
   mov   eax,4   ;system call number (sys_write)
   int   0x80   ;call kernel

   mov   eax,1   ;system call number (sys_exit)
   int   0x80   ;call kernel

section   .data

msg   db   'Hello, world!',0xa   ;our dear string
len   equ   $ - msg         ;length of our dear string


now to most people that looks like someone spilled their alphabet soup on the floor. now lets take a look at C hello world

#include <stdio.h>

main()
{
  for(;;)
      {
          printf ("Hello World!\n");
      }
}


now wasn't that much easier? C is easier then you can imagine and it's a very efficient language. higher level languages are good too but C is designed to make the most of the resources available. if your going to go anywhere with low cost robots that don't require a computer connection then you will need to learn some sort of low level language, most likely C. to put it into perspective firmware is free while hardware is not! if you can buy a cheaper chip and run softare made in a low level language then you will have a more efficient design. even if you don't want to ever make electronics that will be marketed to the public then you will still save allot of money in what is essentially a very expensive hobby by using lower cost hardware that is programmed in a lower level language.
"sure, you can test your combat robot on kittens... But all your going to do is make kitten juice"

First step: Build androids with AI
Next step: Give them vaginas

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: The C barrier
« Reply #15 on: November 17, 2010, 04:08:41 PM »
Hi,

you need a certain kind of brain to get something out of C , so its not just the 18 months investment to crack it, for 9 out of 10 people it is they that will crack first. :'(
Nonsense.
It takes a certain way of thinking to program!
It helps immensely to know how the hardware works, but once you know the logic behind coding, any new language is just adding meat on the skeleton.


Id say the 3 barriers to  C are

[] 18month investment before usefull return vs 18 days with a simple basic (imediate feedback is encouraging wth basic)
Simply not true.
I guess you learned BASIC and then you got so comfortable with it that you are now closed to different thinking.


[]You got to have the right kind of brain to be fruitfull. This barrier can never be overcome
No.
While it helps to have a logical mind, anyone can learn to code in any language - without interest, curiosity and dedication, you won't get to expert status of course, but anyone can learn it if they so wishes.
Are you perhaps trying to rationalize your own failure in learning it so far?


[]The nonintuitve IDE is a killer if you are trying to teach yourself, your reverse engieering unknowns and illogical happenings. This barrier is removed if you did it at college.[/color]
Most IDE's are fairly close and it always take a bit of practize with new software of those proportions - Not many people is 100% proficient in Office (open or closed), since it has a lot of possibilities that most people only uses a subset of, but that won't get you claiming that most people cannot write a simple text (or whatever) I hope?


im going to add a fourth, prior to 1980 there where no computers anywhere on the planet !! outside of a lab, anyone one born after 1980 was born in to a world of computers.
Now your pants are on fire ;D
I build one in the seventies and so did a couple of my friends.
When do you think the first Apple came out?

So, obviously you're born before 1980 and that should somehow have been holding you back?


im going to add a fifth there was no digital technology anywhere in the world in 1960, the word digital did not exist
Yes it did, but admittedly, it wasn't mainstream and were mostly used by people in white lab coats.

Quote
The first digital computer

Short for Atanasoff-Berry Computer, the ABC started being developed by Professor John Vincent Atanasoff and graduate student Cliff Berry in 1937 and continued to be developed until 1942 at the Iowa State College (now Iowa State University).


im going to add a 6th widespread use of computers and the internet did not happen untill 2000
[/color]
Not true either. You have to separate the two things, as they're not the same!
Win3.1 was the  OS that made PC's available to most and Win95 swept the floor (some people may carry a grudge against Bill, but without him, you probably wouldn't be able to afford a PC and it would have specs way way way lower than they do now).
The internet was buzzing with non-techies as early on as 1998, if not sooner.


all this adds up to a background computer knowledge defecit for any one over the age of 30, thats half the world population. This means anyone over the age of 30 is gonna find learning C much harder than anyone under the age of 30.
To me, it sounds like excuses and rationalizing (if not whining).
I'm past the half hundred years and I challenge you to find average citizens under 30 that is proficient in just half the languages I've already left behind or semi-forgotten.

On one hand, you yap a lot about how bright your patchwork "brain" is, compared to our inferior 'bots and on the other hand you claim to be bad at programming -something doesn't really add up here.

And before another long post of how much your "brain" (which so far is just something we haven't seen, but only heard from you) are gonna change the world and make robot's superior - As long as you aren't able to give feelings and urges, it will be nothing but algorithms with perhaps a large database - nothing new about that and scaling it up won't make it any bit more human.
You can program something like pain behaviour, but you cannot make it actually feel pain and as long as that holds true, it ain't gonna be all that human-like - You claim an IQ of 85 (the official name for an IQ of between 60 and 90 points is moron, by the way). That means it should be able to defend itself from basic dangers - like someone pulling the plug - is it able to?


I think you should give the $50 robot a try, perhaps it would open your eyes to what can be done with tight coding and perhaps give you a more realistic perspective on what you are trying to accomplish - I guarantee that your time won't be wasted - would probably save you time in a grander scheme, as you'll then have a fairly neat testbed to easily test the functions and impacts of various sensors and actuators that you will need for building some kind of droid.
You'll need several steps in between as well actually.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: The C barrier
« Reply #16 on: November 17, 2010, 07:38:32 PM »
While I'm not usually a fan of negativity around here, I think Soeren's response sums it nicely. Your extra long rant about C seems to be more your frustration with trying to learn it. I will give you the point that some people just can't wrap there head around it (like you), but that's no proof of how bad it is.

I hacked around with some C code in High School, it was very easy to follow and guess the proper syntax. I was able to tweak some programs with minimal help from search engines.

I took my first formal class in College, learned a good deal in a few months. Then, I learned assembly. They taught it in this order, so we could learn how a compiler works, and become a more efficient C programmer.  I then promptly forgot C, as my studies turned towards electronics and power systems for the rest of my college career (2 years). It was only towards the end I started getting into robotics and found myself codding again. Like riding a bike, it was very easy to pick it up once more.

So my short answer is, I don't agree with you. You've offered little proof to back-up your claims, and are obviously frustrated with C.

Offline Asellith

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 648
  • Helpful? 9
  • "I'm a leaf on the wind. Watch how I soar"
Re: The C barrier
« Reply #17 on: November 18, 2010, 08:21:35 AM »
I think the biggest problem is the "Barrier to Entry" I run into this a lot. You can read a hundred tutorials and try your best but if you never overcome the Barrier to Entry then the blocks never fall into place. Everyone is different and some might not be able to handle some things but I think that has more to do with a self imposed barriers. This might not work for everyone but I NEED a project to learn something and motivation to overcome the barrier. I can't just grab a book on a topic and learn it. In order to get through it I usually take one step at a time and push through with a TON of googling and trial and error.

Just an example, I needed to do some image manipulation for a project involving printing on fabric. 4 or 5 weeks ago I started resizing images of nebulas in gimp. In order to get the size I need it ruins the images to scale them 400 or 500%. Now I'm color correcting and morphing two cloud formations together and getting some great looking images. Its like buying a new tool. This project has pushed me through the gimp barrier in my brain and I have a new tool to use. Next tool is Blender and some 3D sculpting/printing. However at this point that one looks nasty and will hurt but taking my time and concentrating on one area at a time will eventually get me through it.

Taking the same approach in C or any programming language you need to not try to LEARN C. Instead learn how to turn on an LED with your MCU in C. Then learn how to control a servo. Also checkout Webbot's Library as that will make all your hardware interfacing easy or just jump into arduino which I have been reading on and may try out here soon.
Jonathan Bowen
CorSec Engineering
www.corseceng.com

Offline z.s.tar.gz

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: The C barrier
« Reply #18 on: November 18, 2010, 11:27:56 AM »
I'm usually accused with having a backwards programming stance: I learned asm first and now I can't for the life of me understand why anyone would use C.

When it comes to languages though (imho alert!), it's not about the actual syntax but more about understanding the underlying system. Because of this, I often find that high level languages like python and basic are difficult to use with microcontollers. (Given that, I'll choose python for pc programming any day of the week  :P)

So I think the problem isn't that there's a barrier for specifically C but that there's a barrier for any new language, programming or otherwise.
Save yourself the typing. Just call me Zach.

Offline knossos

  • Robot Overlord
  • ****
  • Posts: 278
  • Helpful? 14
Re: The C barrier
« Reply #19 on: November 18, 2010, 06:03:37 PM »
quote author=z.s.tar.gz link=topic=12604.msg94550#msg94550 date=1290101276]
So I think the problem isn't that there's a barrier for specifically C but that there's a barrier for any new language, programming or otherwise.
[/quote]

I learned BASIC first, myself, but I would be hard pressed to go back to it now.  I have been through many different languages, and there are things I like about most of them, but I think of the ones I have used C++ offers the best balance.   It allows inline assembly for those rare moments when its critical, it has lots of high level features, and a good degree of flexibility.  I do feel its a little more cumbersome to use than some others, due mainly to the syntax.  Its not any less readable to me, but the amount of punctuation slows my typing speed.
"Never regret thy fall,
O Icarus of the fearless flight
For the greatest tragedy of them all
Is never to feel the burning light."
 
— Oscar Wilde

Offline z.s.tar.gz

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: The C barrier
« Reply #20 on: November 18, 2010, 10:02:15 PM »
The thing I hate most of all are case sensitive languages! Seriously, I'm never going to have the need to differentiate between Variable1 and variable1.
Just a little (off topic) thought.
Save yourself the typing. Just call me Zach.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 98
Re: The C barrier
« Reply #21 on: November 19, 2010, 10:31:19 AM »
The biggest advantage of C over BASIC is that there is a written Standard. As to learning C there are many BAD books out there. The best book is "The C Programming Language" by Brian W. Kernighan and Dennis M. Ritchie the creators of C. I still use my 1985 edition for programming C on a PC under Windows and programming PICs and other microprocessors and microcontrollers. I have thrown away all the other C books I've bought.
http://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628

Quote
The thing I hate most of all are case sensitive languages! Seriously, I'm never going to have the need to differentiate between Variable1 and variable1.

Most C compilers have a switch to turn off 'case sensitive' if you really don't need or want it.

Offline azyTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: The C barrier
« Reply #22 on: November 19, 2010, 02:30:06 PM »
Thankfully the world has settled on C as a backbone language, it widespread, universal and standards have been set.

For  graduate programmer learning C , he/she can at least be confident it will still be around in 20 years & it has the power to get down n dirty with the hardware. I'm all for overcoming barriers. Youtube is the best free university out there. (some 10 yr old kid was teaching how to write old school dos macro's)

If someone could post links to some first class tutorials ref "learning c" i would be gratefull.

The last few programming course i went on they where still teaching COBOL & Pascal...and I'm like C is the future get me out of here. Back then few educational systems where teaching C, those that where were reserved for AAA students at elite institutions. The general populous where still using homecomputers writing in basic and assembly. Basic never died, came free with every computer i owned, or had a copy to hand on disc. So i just stuck with old man river....the death of basic is still proving to be an unfounded rumour after all these years. :o Much to the chagrin of fanboys & the professional coding community.

http://en.wikipedia.org/wiki/C_%28programming_language%29

The old hands here will have seen entire genomes of unique hardware and software fall by the wayside, no doubt DNA & RNA had competitors, even after they had fallen nature still had to decide on left handed or right handed molecules....the need for compatibility made all other needs secondary. As computers only need to exchange data and not genes there is still room for hw & sw biodiversity. (even bacteria which normally reproduce asexually can exchange genetic material, hence the need for handed compatibility)

« Last Edit: November 20, 2010, 11:46:53 AM by azy »

Offline chelmi

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
Re: The C barrier
« Reply #23 on: November 19, 2010, 03:10:55 PM »
Quote
The thing I hate most of all are case sensitive languages! Seriously, I'm never going to have the need to differentiate between Variable1 and variable1.
Most C compilers have a switch to turn off 'case sensitive' if you really don't need or want it.

GCC does not have such a switch and for a good reason: the standard specifies that keywords are case sensitive.
What compiler did you use ?

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 98
Re: The C barrier
« Reply #24 on: November 19, 2010, 04:06:03 PM »
The 'case sensitive' switch to the best of my recall is/was available in:
BDS C
Borland C
C under Visual Studio 6

So it seems that you are correct, I'm wrong. It was the older compilers that had this feature probably due to the very small storage space available on early PC's.

Offline GearMotion

  • Supreme Robot
  • *****
  • Posts: 489
  • Helpful? 24
  • Two decades+ of Embedded Design
Re: The C barrier
« Reply #25 on: November 19, 2010, 04:10:46 PM »
Wow.

A lot of "I like X and Y is a zillion times harder" type of talk. No one in their right mind would ever code in Z. A is simple for me, B isn't so anyone that uses B must be insane. Anyone can learn X, but Y will take loads more effort.

Relax. They are all the same. Free your mind.  

I turn to the tool that I think is the right fit for the job. I don't use a hammer on a screw just because turning a screw is harder than hammering.

Oh and RobotBASIC that you see in my sig? I use that for all sorts of simple applications on a PC. Is it then better than C? Nope. Just sometimes the right tool for the job.

Offline azyTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: The C barrier
« Reply #26 on: November 20, 2010, 04:58:32 AM »
ref "wow" lol , so true , any coding discusions always follows this pattern



The 'C' barrier is more a reflection of the growing sophistication of technology over time, learning tools improve , supporting background knowledge increases but the minimum buy in cost, in terms of investment to competitive utility increases over time.

Yesterdays Line follower was hip , now Stereo Colour Vision with depth perception is the entry standard to aspire to

Tommorow the buy in will be Cognition, Sentience & self awareess

Before long, Hal1000 will be telling you how to build HAL9000

-----------------------------------------------------------------------------------


http://www.robotbasic.org/


Free to dload , quite interesting if you are a Basic Head. Allows you to control real or virtual bots
Robots in the Classroom



If you are a complete noob to programming this vid is worth watching
CSTEM RobotBASIC Training: Lesson 1
« Last Edit: November 20, 2010, 05:29:13 AM by azy »

Offline voyager2

  • Supreme Robot
  • *****
  • Posts: 459
  • Helpful? 6
  • Behold! The Impossible Triangle of robotics!
Re: The C barrier
« Reply #27 on: November 20, 2010, 07:10:51 AM »
Hi
C is not hard, I'm learning it, and its not hard.
I recommend you start with a language derived from C, I started with JavaScript:http://en.wikipedia.org/wiki/JavaScript]http://JavaScript]http://en.wikipedia.org/wiki/JavaScript
That will get you started with the syntax.
I like this C tutorial:
http://www.eskimo.com/~scs/cclass/notes/top.html

The classic Hello World program:
Code: [Select]
#include <stdio.h>

main()
{
printf("Hello, world!\n");
return 0;
}

I admit in BASIC is probably much simpler, but C is much faster...
And in advanced AI like your doing, your going to need all the speed and power you can get!

Side note: MS Windows was written in C, I believe Linux is too...

Side note #2: I'm 11 and 3/4 years old ;)
« Last Edit: November 20, 2010, 07:14:33 AM by voyager2 »
And Admin said "Let there be robots!"
And it was good.

Offline Cannon00

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 1
Re: The C barrier
« Reply #28 on: November 20, 2010, 02:31:25 PM »
  Honestly, you seem to have a distaste for the formality and specificity of C.  To a degree this follows into programming in general.
C gives you much lower level access than something like basic.  You're given the exact details of what's going on, and the chance to comprehend and manipulate these details.  For someone who needs to be very specific, this is great.  If you plan on making a robot that will interact with the world, plan on being very specific.

  Programming is similar to math in that you need to get your mind into analyzing things in an abstract way, and being objective and specific with what you say.  You can't tell your robot "if object is chair do this:".  If you plan on making a new, smarter robot, what you really need is a better combination of code and hardware to know what is and isn't a chair.  For this you need low level access to the hardware, in order to use math, analysis, and logic to figure out a pattern of information the hardware gives that always indicates a chair, and only indicates a chair.  If you look at projects like the kinect, or google goggles, these have a lot of very intelligent people working on them.  They solely want to interpret the world, and you can look at those projects to determine how far along we are.  If you plan on making a smarter robot, you shouldn't even start with a "robot".  You should start with research into perceiving the environment around you.  Because if you're brain can learn actions that's still useless when you have no way to recognize, perceive, and distinguish actions. 

  Truly what you appear to see as a trivial part of this project, is potentially the greatest portion of it.  Useful computer vision is such a huge technical problem I fear your greatly underestimating it.  It's tremendously difficult to get a computer to see and understand the world in the way we humans do. It may very well be the largest barrier between where we are and where we need to be in order to have intelligent androids.

Offline z.s.tar.gz

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: The C barrier
« Reply #29 on: November 20, 2010, 06:04:29 PM »
1010011010 the number of the beast.

Nobody likes harry potter or warcraft and would therefor never ask HAL that.

There are several assembly operating systems out there (like minuet) that give you a complete desktop with slick gui and compositing that fit on a single 1.44mb floppy disk so yes modern operating systems are very inefficient but they need to be or else it would take forever to develop them.

Sight is the most used sense but not the most powerful. Smell has much more direct connections to the instinctual part of the brain.

As far as basic one day being as fast as C, that's a load of bull. Regardless of what computer you're running on C will always be faster. It's not because C is C, but because C is a lower level language. It's the equivalent to saying "python will be as fast as assembly one day". It just won't.
Save yourself the typing. Just call me Zach.

 


Get Your Ad Here

data_list