Previous in Forum: Help Finding NTE Quick Cross   Next in Forum: Computer Security Software
Close
Close
Close
81 comments
Active Contributor

Join Date: Oct 2007
Posts: 12

C Programming

09/30/2014 3:33 AM

Hi!

Just started a course to learn C. Am 50 years old and the instructor is almost half my age!

He has very little patience and corrects the code I have written very fast( to keep pace with the rest of the class), before I understand my mistake.Also I am confused with the syntax.

I program using BASIC, could this be confusing me while coding C?

Thinking of quitting, but would like to know if anyone faced this problem initially and if so how they overcame the problem.

Would be obliged if you share your experience.

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Comments rated to be Good Answers:

These comments received enough positive ratings to make them "good answers".

Comments rated to be "almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, rate them!
6
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16498
Good Answers: 661
#1

Re: C Programming

09/30/2014 4:50 AM

I share your frustration...
I hate C with a passion.

message aborted compiler error:- missing ;

expected{

All I can suggest is you ask him to slow down.
Another trick I used once was to ask everyone who UNDERSTOOD to put their hand up...
People won't want to put their hand up, so be careful to ask the right question, such that the lack of hands supports what you want!

Del

__________________
health warning: These posts may contain traces of nut.
Register to Reply Good Answer (Score 6)
Active Contributor

Join Date: Oct 2007
Posts: 12
#2
In reply to #1

Re: C Programming

09/30/2014 4:57 AM

Good idea,

I will try that.

Thanks for the suggestion, as I was getting frustrated and could not think of anything.

Register to Reply
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#21
In reply to #1

Re: C Programming

10/01/2014 6:21 AM

Del, GA.

I was once in an IBM Systems training class in Frankfurt many years ago.

It was held in German, but all the English words used by everyone worldwide to describe parts and functions since time began in the computer world, had been "converted" into High German. 10 feet long words!!!

It was very confusing, half the "new" German words I simply did not understand at all, some you could guess at.

At the midday lunch break, I said to the rest of the class, all German nationals, that I was walking out of the class as it made no sense to me whatsoever....

THE WHOLE CLASS STOOD AS ONE AND SAID THEY DID NOT UNDERSTAND A WORD EITHER!!

I said to them, why didn't you say something before?!!!

The reply was, that I (me!) "seemed" to be understanding it and they did not want to look stupid!!! DUUUUHHHHHH!!

I got my Boss in and we discussed the problems and the training company got thrown out.....

__________________
"What others say about you reveals more about them, than it does you." Anon.
Register to Reply Score 1 for Off Topic
Guru
Hobbies - Musician - New Member Hobbies - Car Customizing - New Member Hobbies - Target Shooting - New Member Engineering Fields - Power Engineering - New Member

Join Date: Jul 2007
Location: FL Space Coast
Posts: 536
Good Answers: 14
#22
In reply to #21

Re: C Programming

10/01/2014 6:59 AM

Ya Hochdeutsch and their double, triple quintuple compound words. Was one of the hardest parts for me learning German. :-P

Register to Reply
Guru
Hobbies - CNC - New Member Hobbies - DIY Welding - New Member Engineering Fields - Electromechanical Engineering - New Member

Join Date: Aug 2007
Posts: 22637
Good Answers: 409
#23
In reply to #21

Re: C Programming

10/01/2014 7:04 AM

This is going of the dusty trail a bit.

But wasn't there a push about 10 years ago to change all the standard technical language into... French?

I'm sure it was the French that may have made the push.

It was basically for electronics or control? It was in a tech journal.

__________________
“ When people get what they want, they are often surprised when they get what they deserve " - James Wood
Register to Reply
Guru
Engineering Fields - Electrical Engineering - New Member Fans of Old Computers - Commodore 64 - New Member Popular Science - Evolution - New Member United States - Member - New Member

Join Date: Oct 2013
Location: Illinois, 7 county region (The 'blue dot' that drags the rest of the 'red state' around during presidential elections.)
Posts: 3688
Good Answers: 89
#28
In reply to #21

Re: C Programming

10/01/2014 9:47 AM

And THAT is why the act of walking into a place like you own it and ordering people around (when you have no business or authority do do so) is known as the Bavarian Fire Drill.

I hate to pick on my bretheren back in the homeland, but it's a simple fact, more visible in cultures with a hierarchal society but always there even in eglatarian societies: If you go around acting like you're in charge, people will assume that you are.

Here the person 'in charge' was the instructor, and the students were reluctant to challenge his authority as teacher by asking what the foch his Sesquipedalian Loquaciousness was supposed to mean.

__________________
( The opinions espressed in this post may not reflect the true opinions of the poster, and may not reflect commonly accepted versions of reality. ) (If you are wondering: yes, I DO hope to live to be as old as my jokes.)
Register to Reply
Guru
Hobbies - CNC - New Member Hobbies - DIY Welding - New Member Engineering Fields - Electromechanical Engineering - New Member

Join Date: Aug 2007
Posts: 22637
Good Answers: 409
#29
In reply to #28

Re: C Programming

10/01/2014 10:07 AM

"If you go around acting like you're in charge, people will assume that you are."

That's similar to people in an elevator. At least 35 years ago....

the higher up on the hierarchal ladder will look confident, while the surfs will look submissive.

__________________
“ When people get what they want, they are often surprised when they get what they deserve " - James Wood
Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9687
Good Answers: 467
#3

Re: C Programming

09/30/2014 6:02 AM

C can be very frustrating - but IMHO it's worth sticking to it 'til you get the hang. I used to use C exclusively way back - but I now use VB.net. Very few days go by before I think "Damn, why can't I just <whatever>? If only I was using C, this would be 2 lines of code instead of 50!"

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
6
Guru
Popular Science - Evolution - New Member Popular Science - Weaponology - New Member

Join Date: May 2006
Location: The 'Space Coast', USA
Posts: 11112
Good Answers: 918
#4

Re: C Programming

09/30/2014 6:59 AM

Is it C or C++?

C is not too much of a headache, but C++ is much more abstract and not a good course for a beginner.

If you have BASIC experience it should help with learning C, which is a more powerful language.

I highly recommend getting the book "C Primer Plus'. It has everything you need to learn C from a non-programmer point of view.

The best way to get through this is to apply time and energy into the process. You may have to do more than others to succeed, but that's simply what it takes.. Learning is a process or repetition and as you get older you tend to get resistive to the process, but the good news is that applying some elbow grease will overcome that issue.

If you need specific help, there are a number of people here that can help you learn what you are stumbling on, so don't forget to ask. No one wants to do your homework, but we can and will gladly teach you to fish.

Register to Reply Good Answer (Score 6)
Guru
Engineering Fields - Electrical Engineering - New Member

Join Date: Oct 2007
Location: Sour Lake, TX 30°08'59.68"N 94°19'42.81"W
Posts: 671
Good Answers: 13
#80
In reply to #4

Re: C Programming

10/17/2014 1:23 PM

Stephen Prata's C Primer Plus.

You'll find it at Amazon for $0.01 + $3.99 shipping. Like new condition! I bought it hoping that somebody read it for me, but, as I said, it is in "like new condition". Darn, I must read it!

__________________
Bridge rule #1: Nobody is as good as he thinks about himself nor as dumb, as his partner thinks...
Register to Reply
Guru
Hobbies - CNC - New Member Hobbies - DIY Welding - New Member Engineering Fields - Electromechanical Engineering - New Member

Join Date: Aug 2007
Posts: 22637
Good Answers: 409
#5

Re: C Programming

09/30/2014 7:43 AM

I took 'C' programming (night classes, 24 years ago) when I was about 30, (a time that C++ was coming around, with OOPs) the problem I had was the COBOL programmer's in the class that were 55+ (Fossils) that give me trouble.

They loved talking about themselves and how great they are, and won't hesitate to crucify anyone that challenged them.

'C' experience was good, I actually purchase a complier (Borland). and wrote a few programs for work. (of which after 25 years, they still are using variations of the source code) I haven't found the need to code for a long time.... at least to any extend that amounts to anything.

__________________
“ When people get what they want, they are often surprised when they get what they deserve " - James Wood
Register to Reply
3
Guru

Join Date: Jul 2006
Location: Silicon Valley
Posts: 5356
Good Answers: 49
#6

Re: C Programming

09/30/2014 8:02 AM

You can blame Noam Chomsky and several other linguists for all that curly-bracket, pointy-bracket stuff. If you want to gain a little more understanding on why they feel compelled to code that way, look up "Backas-Naur Format (BNF) and Augmented-BNF.

Back in the 60's, some asshole programmers thought it would be cool to identify program components like linguists identify syntactical structure within spoken languages. The result being that ABNF is sort of like having to "diagram" each sentence (remember that from grade school) within any correspondence you write - even those within e-mails to friends. And what really sucks is that all current programming languages have followed suit.

In the end, just try to stop thinking of words while programming. Instead, think of each command as a sentence structure... After all, programming is not writing a nice, friendly letter (BASIC), you're just telling impersonal, dead silicon what you want it to do.

__________________
"Perplexity is the beginning of dementia" - Professor Coriolus
Register to Reply Good Answer (Score 3)
Guru
Hobbies - CNC - New Member Hobbies - DIY Welding - New Member Engineering Fields - Electromechanical Engineering - New Member

Join Date: Aug 2007
Posts: 22637
Good Answers: 409
#7
In reply to #6

Re: C Programming

09/30/2014 8:21 AM

yep, I agree, those pioneer programmers didn't know what they were doing....

__________________
“ When people get what they want, they are often surprised when they get what they deserve " - James Wood
Register to Reply
Guru
Popular Science - Weaponology - New Member Fans of Old Computers - PDP 11 - New Member Technical Fields - Architecture - New Member Hobbies - HAM Radio - New Member

Join Date: Oct 2009
Location: Maine, USA
Posts: 2168
Good Answers: 70
#9
In reply to #7

Re: C Programming

09/30/2014 9:54 AM
__________________
Tom - "Hoping my ship will come in before the dock rots!"
Register to Reply
Guru
Hobbies - CNC - New Member Hobbies - DIY Welding - New Member Engineering Fields - Electromechanical Engineering - New Member

Join Date: Aug 2007
Posts: 22637
Good Answers: 409
#10
In reply to #9

Re: C Programming

09/30/2014 9:56 AM

you mean assembly language.

__________________
“ When people get what they want, they are often surprised when they get what they deserve " - James Wood
Register to Reply
Guru
Popular Science - Weaponology - New Member Fans of Old Computers - PDP 11 - New Member Technical Fields - Architecture - New Member Hobbies - HAM Radio - New Member

Join Date: Oct 2009
Location: Maine, USA
Posts: 2168
Good Answers: 70
#11
In reply to #10

Re: C Programming

09/30/2014 9:59 AM

Sure - pick one!

Every machine had one, some were known with the "brand" of computer manufacturer, some were invented on the fly for special purpose applications. Today that's called an ASIC I believe.

__________________
Tom - "Hoping my ship will come in before the dock rots!"
Register to Reply
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16498
Good Answers: 661
#8
In reply to #6

Re: C Programming

09/30/2014 8:33 AM

How dare you say my silicon is cold dead and impersonal... I wub my micwoconwoller

Del

__________________
health warning: These posts may contain traces of nut.
Register to Reply Off Topic (Score 5)
Guru

Join Date: Mar 2007
Location: Etherville
Posts: 12334
Good Answers: 115
#15
In reply to #6

Re: C Programming

09/30/2014 4:43 PM

Bit of the topic so I'll post as such, but any thoughts on JSP ? Most people of a certain age will have learnt some flavour of BASIC but moving on can be a synantic nightmare. My understanding is that JSP is something of a dead duck, but is there a methodology that might apply here ?

I'd babble more but Del said 'hands' instead of paws . Worse still, I have to go google several things you just mentioned.

Haven't figured the firsts bits, but that last paragraph is very readworthy.

__________________
For sale - Signature space. Apply on self addressed postcard..
Register to Reply Off Topic (Score 5)
Guru

Join Date: Mar 2007
Location: at the beach in Florida
Posts: 30957
Good Answers: 1727
#12

Re: C Programming

09/30/2014 2:38 PM

You should have studied on your own for a while before starting the class, that way you get more out of the time spent in class....Your best hope as I see it is private tutoring....and total immersion...

http://www.cprogramming.com/how_to_learn_anything.html

__________________
Break a sweat everyday doing something you enjoy
Register to Reply Score 1 for Good Answer
Guru
Hobbies - CNC - New Member Hobbies - DIY Welding - New Member Engineering Fields - Electromechanical Engineering - New Member

Join Date: Aug 2007
Posts: 22637
Good Answers: 409
#13
In reply to #12

Re: C Programming

09/30/2014 2:40 PM

that's what I did.

And that's why I gave you a GA... because I may have been a little bias

__________________
“ When people get what they want, they are often surprised when they get what they deserve " - James Wood
Register to Reply
Guru

Join Date: Mar 2007
Location: at the beach in Florida
Posts: 30957
Good Answers: 1727
#14
In reply to #13

Re: C Programming

09/30/2014 2:55 PM

Reality is the same for everybody, it's only its recognition that varies....

__________________
Break a sweat everyday doing something you enjoy
Register to Reply
2
Guru

Join Date: Apr 2010
Location: About 4000 miles from the center of the earth (+/-100 mi)
Posts: 9046
Good Answers: 1031
#16

Re: C Programming

09/30/2014 7:11 PM

C is a good language that is powerful enough to do what needs to be done in software without all the complications of some other languages (IMHO). Don't be intimidated by the instructor that doesn't seem to have time.

If you're trying to learn code by writing it dry, you're doing it the hard way, in my opinion. The way to learn is to have access to a computer with a C compiler on it. Find a simple problem and try to write the code to solve it. If your syntax is wrong, the compiler will flag the error (almost always). You learn pretty fast that way without the insult.

When I write code, I don't sweat the typos. I do the thinking, let the computer compiler proof read it. (Very few typo mistakes will compile and give the wrong result.) It goes much faster that way.

Register to Reply Good Answer (Score 2)
Guru
Engineering Fields - Instrumentation Engineering - New Member Hobbies - Automotive Performance - New Member Technical Fields - Education - New Member Fans of Old Computers - TRS-80 - New Member Hobbies - Musician - New Member

Join Date: Jan 2008
Location: Tucson, AZ
Posts: 1331
Good Answers: 30
#17
In reply to #16

Re: C Programming

09/30/2014 9:00 PM

Exactly!

For me, MY most *successful* learning technique was to code-up a "packed" FFT program, ie: something *useful* to me. This became my personal "project" with each new programming language that I learned (almost chronologically):

1) in FORTRAN

2) in BASIC

3) in 8080/Z80 Assembler

4) in Ada

5) in Pascal

6) in C

7) in C++

__________________
...and the Devil said: "...yes, but it's a DRY heat..!"
Register to Reply Score 1 for Good Answer
Guru

Join Date: Apr 2010
Location: About 4000 miles from the center of the earth (+/-100 mi)
Posts: 9046
Good Answers: 1031
#81
In reply to #17

Re: C Programming

10/24/2014 9:57 PM

I once wrote a 256 point FFT to run on an 8085 CPU (which basically used the 8080 instruction set). The first step was to write code to multiply two numbers and hard code tables for sin/cos look up using only the simple instruction set of the CPU.

It took about 3 seconds to run at a screaming clock rate of 3 Mhz.

It's so much easier to write in C code!

Register to Reply
Guru

Join Date: Apr 2014
Posts: 1869
Good Answers: 67
#34
In reply to #16

Re: C Programming

10/01/2014 7:45 PM

"... powerful enough ..."

Yes, it certainly is.

In K&R's (Kernigan & Richie's) original little 9-mm-thick tutorial, 'The C Programming Language,' the language definition itself is located in an appendix in the back of the book.

Some may think that C's limited number of keywords and constructs implies a lack of power when, in fact, it is C's lack of constraints. You can do anything you want in C. Anything at all. This is both a blessing and a curse.

Even for seasoned programmers, it is easier to hang yourself in C than it is to breathe. Still, it is one of my favorite languages, second only to Python.

Register to Reply
Active Contributor

Join Date: Jan 2013
Posts: 11
#18

Re: C Programming

09/30/2014 11:07 PM

You must mean C++? Nobody uses straight C any more. I feel your pain and learning a language as subtle as C is tough going. Everything is focused in object oriented today and C is used only in a few tight niches - and even then it's always C++. Ask yourself what you're really going to do. If you want to code there is a vastly larger market for Java! Still OO of course. Not as low level as C. Might be easier get, and that doesn't mean it's easy!

Register to Reply
Active Contributor

Join Date: Oct 2007
Posts: 12
#19
In reply to #18

Re: C Programming

09/30/2014 11:27 PM

I am learning C to program motor controller.

So it is not a question of easy access.

By the way, does C have an alternate for motor controller programming?

Any suggestions will be appreciated.

Register to Reply
Active Contributor

Join Date: Jan 2013
Posts: 11
#25
In reply to #19

Re: C Programming

10/01/2014 8:26 AM

Ok makes sense. Machine & process control among C's niches. Try to remember you don't always have to know everything about a language to get real work done with it. Good luck!

Register to Reply
Guru

Join Date: Apr 2014
Posts: 1869
Good Answers: 67
#35
In reply to #19

Re: C Programming

10/01/2014 10:08 PM

There are all kinds of languages that can be used for motor control, but control at what level? Hard against the metal, at the register level? Higher level, through an API (Application Programer/ing Interface? Higher yet, application-specific languages executing on a motion-controller module/board/PLC?

The problem with answering your question is that it encompasses too large a swath to be answered in any but the most general terms. Quite understandable if you're new to the field, so no worries. You've simply so many more choices than you might have imagined.

Really, the languages and methods used to 'talk to' motors are probably as numerous as the people using them to write motor-control programs! Perhaps we should narrow your question's domain somewhat?

Register to Reply
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#37
In reply to #35

Re: C Programming

10/02/2014 2:47 AM

I remember when Forth was first available for a simple ZX-80 and 81 computers, I managed to control a telescope for a friend's son with it, so that the star/planet being observed stayed dead center in the scopes field of vision. A small wonder in those days....

I have absolutely no recollection of the language at all nowadays!! NOTHING!! Except the name!!

I had to have both a hardware interface and a memory module on that awful connector at the back.....I also had to interface a proper keyboard as the original was really "iffey".....if I remember correctly....

Those were the days!!!

__________________
"What others say about you reveals more about them, than it does you." Anon.
Register to Reply
Guru

Join Date: Nov 2012
Posts: 633
Good Answers: 13
#39
In reply to #37

Re: C Programming

10/02/2014 10:09 AM

blast to the past....Charles Moore and DR.C.H. Ting were associates of mine years ago. I was S.V Fig librarian for a while. Moore was the father of Forth. Ting wrote PC Forth, a free system for the IBM PC/AT. I used to build automated welding systems for defense contractors, 10 precision servo loops running the process as a forth system compiled into a 2764 (less than 8k) as a compiled C program >300k. The multiplexed switches and displays replaced a 300 wire control cable with a 7 wire cable. Forth environment!

Forth is still alive and well, it's just not taught in schools. It's Zen Programming. I can easily edit code I wrote 30 years ago. Complete freedom to move between assembler, interpreter, compiler, based on a virtual stack oriented computer model that is transportable across systems...build the forth core model for the system you are using and compile your high level code there.

Object oriented programming hides the system from the programmer, hides function in libraries, and requires a lot of faith in unknowns. Strongly 'typed', bit logic and Boolean logic functions provide different results from the same input and easily trip you up.

I feel a rant coming, guess I'd better stop.

Register to Reply Off Topic (Score 5)
Guru

Join Date: Apr 2014
Posts: 1869
Good Answers: 67
#40
In reply to #39

Re: C Programming

10/02/2014 12:30 PM

Amazing what one did in such a small memory footprint because one had to - memory was expensive and you had to make every byte count. Years ago I wrote a preemptive, multitasking RTOS in assembly (Motorola 68701) that fit in 8K. It wasn't easy but somehow I did it.

These days an empty Word 2013 doc takes more space than that! (12,288 bytes) And the junk websites leave behind on my disk after one day's worth of browsing the Internet is phenomenal. Oftentimes more than the entire capacity of my first hard drive (20 MB).

Register to Reply Off Topic (Score 5)
Guru

Join Date: Jul 2006
Location: Silicon Valley
Posts: 5356
Good Answers: 49
#41
In reply to #39

Re: C Programming

10/03/2014 2:47 AM

At programming competitions, FORTH is always the winner because it's so damn easy to debug!

The sad thing about it is most of the programmers don't even know they're using it. There's a layer of coding that sits below the operating systems of most workstations and sits underneath Apple's operating system, as well, and they're written in FORTH. Go ahead, really crash that Apple laptop, then watch for the little "OK" prompt to appear. That's a FORTH kernel running there, suckas!

Anyway, your description of FORTH was so perfect, I have to vote you a "good answer."

__________________
"Perplexity is the beginning of dementia" - Professor Coriolus
Register to Reply Off Topic (Score 5)
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16498
Good Answers: 661
#42
In reply to #41

Re: C Programming

10/03/2014 5:42 AM

It's even endorsed by God in the Bible when he said go FORTH

Del

__________________
health warning: These posts may contain traces of nut.
Register to Reply Off Topic (Score 5)
Guru

Join Date: Apr 2014
Posts: 1869
Good Answers: 67
#43
In reply to #42

Re: C Programming

10/03/2014 6:15 AM

"Go FORTH and multiply - you know, like Adders on a Log Table?"

Register to Reply Off Topic (Score 5)
Guru
Hobbies - CNC - New Member Hobbies - DIY Welding - New Member Engineering Fields - Electromechanical Engineering - New Member

Join Date: Aug 2007
Posts: 22637
Good Answers: 409
#44
In reply to #42

Re: C Programming

10/03/2014 7:12 AM

God loves his new iPhone.

__________________
“ When people get what they want, they are often surprised when they get what they deserve " - James Wood
Register to Reply Off Topic (Score 5)
Guru

Join Date: Apr 2014
Posts: 1869
Good Answers: 67
#45
In reply to #44

Re: C Programming

10/03/2014 7:23 AM
Register to Reply Off Topic (Score 5)
Guru
Hobbies - CNC - New Member Hobbies - DIY Welding - New Member Engineering Fields - Electromechanical Engineering - New Member

Join Date: Aug 2007
Posts: 22637
Good Answers: 409
#46
In reply to #45

Re: C Programming

10/03/2014 7:44 AM

God really has a dry sense of humor.

No one laughed at his middle ages scourges, especially that black death thing or the Spanish inquisition.

But it still brings a chuckle to him.

__________________
“ When people get what they want, they are often surprised when they get what they deserve " - James Wood
Register to Reply Off Topic (Score 5)
Guru

Join Date: Apr 2014
Posts: 1869
Good Answers: 67
#47
In reply to #46

Re: C Programming

10/03/2014 8:09 AM

Yeah, I bet He was rollin' in the aisles when my four-year-old son fell three metres off the back of some bleachers onto hard concrete, shattered his skull, ruptured an artery in his brain and, by the time his LifeFlight 'copter landed at Hermann Childrens Hospital Trauma Unit in Houston the pressure from the hematoma was extruding his brain out through his spinal-cord opening at the base of his skull and his chances of being anything more than a vegetable were exactly zero.

Two days later, after my boy awoke from his coma, apparently unharmed, and asked for his shoes because he said he wanted to go home, Hermann's chief neurosurgeon pulled me aside in the hallway on the way to dinner and confided that, in his all his 29 years as a trauma neurosurgeon he'd never believed in miracles until he saw my son survive the largest hematoma in anyone he'd ever operated on in his entire career, child or adult: "We did everything we could even though we knew he wasn't going to make it. We cannot explain why he is alive, and, not only alive, but healthy - as if he'd never been injured."

A bit closer to home than the Middle Ages.

Register to Reply Off Topic (Score 5)
Guru
Hobbies - CNC - New Member Hobbies - DIY Welding - New Member Engineering Fields - Electromechanical Engineering - New Member

Join Date: Aug 2007
Posts: 22637
Good Answers: 409
#48
In reply to #47

Re: C Programming

10/03/2014 9:17 AM

That is unreal.

You should consider yourself and your family very fortunate.

__________________
“ When people get what they want, they are often surprised when they get what they deserve " - James Wood
Register to Reply Off Topic (Score 5)
Guru

Join Date: Jul 2006
Location: Silicon Valley
Posts: 5356
Good Answers: 49
#38
In reply to #35

Re: C Programming

10/02/2014 4:37 AM

FORTH

__________________
"Perplexity is the beginning of dementia" - Professor Coriolus
Register to Reply
Guru

Join Date: Apr 2010
Location: About 4000 miles from the center of the earth (+/-100 mi)
Posts: 9046
Good Answers: 1031
#50
In reply to #19

Re: C Programming

10/04/2014 4:43 PM

So you can learn by working on your problem. It's much easier to learn when you have a practical purpose in mind instead of just cramming facts.

Write out what you want the program to do. Break it up into small pieces if possible. And "printf" is your friend. Run a little piece of the program at a time and print out one or more variables and verify that they are what you expect.

It is a mistake to write a huge amount of code and expect it to run correctly the first time. Write a little, test it and make sure it works the way you want. If you have too much untested code at one time, it is sometimes hard to figure out why it isn't working the way you expect.

Sometimes it helps to simplify. If you can solve a simpler version of what you are working on (e.g. fewer inputs and outputs), you can see that it is doing the right thing, and then expand it back to the original problem.

Register to Reply Score 1 for Good Answer
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#53
In reply to #50

Re: C Programming

10/05/2014 3:05 AM

Although I "code" far less than I used to, all of your comments are fully valid and if taken onboard by other coders here, will help them!!

Many thanks.

I remember that even when a program is doing everything as it should, adding all the bells and whistles to prevent a user putting in wrong values as well as making it "look" better, would often more than double the physical size of the program.....as well as being as much "work" to get it just right!!

__________________
"What others say about you reveals more about them, than it does you." Anon.
Register to Reply
Guru

Join Date: Jul 2006
Location: Silicon Valley
Posts: 5356
Good Answers: 49
#54
In reply to #50

Re: C Programming

10/07/2014 1:07 AM

That is exactly what FORTH was designed to do. You create little programs called "words," then you make bigger words out of those, and finally one big word that is your program.

__________________
"Perplexity is the beginning of dementia" - Professor Coriolus
Register to Reply
Guru

Join Date: Nov 2012
Posts: 633
Good Answers: 13
#56
In reply to #54

Re: C Programming

10/07/2014 9:49 AM

Whatever the language:Top down design, bottom up coding.

In forth, you build on a system model that is processor independent. Start with a small set of assembly routines that set up the model, then you make calls to these routines with pointers defined in higher level as 'words' defined in 'definitions' that create a dictionary that you use to build a program.

The power of forth lies in it extensibility, and immediate execution by the interpreter of definitions for testing. Its weakness is the absolute control given to the programmer.

Register to Reply
Guru

Join Date: Jul 2006
Location: Silicon Valley
Posts: 5356
Good Answers: 49
#66
In reply to #56

Re: C Programming

10/07/2014 10:18 PM

That's what I just said!

__________________
"Perplexity is the beginning of dementia" - Professor Coriolus
Register to Reply
Guru

Join Date: Jan 2007
Location: Edinburgh, Bonnie Scotland
Posts: 1282
Good Answers: 22
#20
In reply to #18

Re: C Programming

10/01/2014 1:12 AM

Only true for writing computer programs: industrial applications use C because it is deterministic. Java is a higher level language which is used for ease but it has a much higher overhead and uses significantly more memory.

__________________
Madness is all in the mind
Register to Reply
Guru

Join Date: Apr 2010
Location: About 4000 miles from the center of the earth (+/-100 mi)
Posts: 9046
Good Answers: 1031
#51
In reply to #20

Re: C Programming

10/04/2014 7:54 PM

Try using JAVA for real time signal processing...

What happened to the rest of my data...? Oh, JAVA decided to do garbage collecting!

Register to Reply
Guru

Join Date: Jan 2007
Location: Edinburgh, Bonnie Scotland
Posts: 1282
Good Answers: 22
#52
In reply to #51

Re: C Programming

10/05/2014 2:03 AM

Which is why C is the only choice for automotive applications.

__________________
Madness is all in the mind
Register to Reply
Guru

Join Date: Nov 2012
Posts: 633
Good Answers: 13
#55
In reply to #52

Re: C Programming

10/07/2014 9:08 AM

: garbage! C rot rot rot compost ;

Register to Reply
Guru
Hobbies - Musician - New Member Hobbies - Car Customizing - New Member Hobbies - Target Shooting - New Member Engineering Fields - Power Engineering - New Member

Join Date: Jul 2007
Location: FL Space Coast
Posts: 536
Good Answers: 14
#24
In reply to #18

Re: C Programming

10/01/2014 7:10 AM

I beg to differ. C is still used a fair amount at the hardware level. It doesn't have the code overhead of the higher languages. So it fits better on smaller devices. Yes, makes bigger code than assembly but assembly is very device specific.

You are correct at the system level though. C is being superceded by more efficient languages.

Register to Reply
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16498
Good Answers: 661
#26
In reply to #24

Re: C Programming

10/01/2014 8:36 AM

Assuming we are talking about motor control or anything designed ad hoc the bottom line is ...
At hardware level you are using assembler, and that's where all these fancy "high level" languages fall down.
At the end of the day, if you've designed the hardware you have to write the various drivers. Or pore over generic drivers written for some development board which almost work as you want and have virtually no documentation or have endless layers, names labels, functions etc just to toggle a bit.

It's like driving your car car by sitting in the back seat and using two broomsticks to reach the controls.

Del

__________________
health warning: These posts may contain traces of nut.
Register to Reply
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#31
In reply to #26

Re: C Programming

10/01/2014 11:10 AM

LOL!!!

But true!!

I am trying to interface a special chip to monitor movements and accelerations. There are other sensors on the same tiny PCB, originally intended for an Arduino, which I also have and may use if I cannot get a PICAXE to work. But PICAXE is my first wish....

It uses I2C, of which I am used to, but am no expert in....amateur at best.

If you have any experience which could help me before I start, I would be most pleased to hear from you, or anyone else for that matter.

The ebay title is:-

10DOF IMU MPU6050 HMC5883L BMP085 for accel gyro baro

I am mostly interested in using the MPU6050 first, but open to tips....

Sadly the company who sell them can only supply Chinese docs, but I have found others who sell basically the same article and deliver free some English documents.....so I am not totally on my own!

Thanks in advance.

Marking as Off Topic as it mostly is!!

__________________
"What others say about you reveals more about them, than it does you." Anon.
Register to Reply Off Topic (Score 5)
Guru

Join Date: Nov 2012
Posts: 633
Good Answers: 13
#32
In reply to #31

Re: C Programming

10/01/2014 12:10 PM

Hi Andy, there are code examples using some of these sensors for drones, robots, and personal movers at 'instructables.com', makezine.com, and at the Parallax object exchange. the examples are available in Processing(subset used on Arduino), C, C++, (parallax has a new IDE compiler that accepts multiple formats). I'm currently working with XBEE and I2C to interface multiple controllers. Learning curve! Interfacing Propeller 8X32, 3 different arduino's, 2 galileos, and a pcDuino3 on a wifi link using secure socket programming to my laptop so I can access them remotely.

Register to Reply Off Topic (Score 5)
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#33
In reply to #32

Re: C Programming

10/01/2014 12:49 PM

WOW!!!

...and I imagined I was doing something complicated!!! I am an instructables member, so a good idea!

Thanks for your post!

__________________
"What others say about you reveals more about them, than it does you." Anon.
Register to Reply Off Topic (Score 5)
Guru

Join Date: Apr 2010
Location: About 4000 miles from the center of the earth (+/-100 mi)
Posts: 9046
Good Answers: 1031
#65
In reply to #18

Re: C Programming

10/07/2014 7:01 PM

http://www.danielsen.com/jokes/objecttoaster.txtOnce upon a time, in a kingdom not far from here, a king summoned two of his advisors for a test. He showed them both a shiny metal box with two slots in the top, a control knob, and a lever. "What do you think this is?" One advisor, an Electrical Engineer, answered first. "It is a toaster," he said. The king asked, "How would you design an embedded computer for it?" The advisor: "Using a four-bit microcontroller, I would write a simple program that reads the darkness knob and quantifies its position to one of 16 shades of darkness, from snow white to coal black. The program would use that darkness level as the index to a 16-element table of initial timer values. Then it would turn on the heating elements and start the timer with the initial value selected from the table. At the end of the time delay, it would turn off the heat and pop up the toast. Come back next week, and I'll show you a working prototype." The second advisor, a software developer, immediately recognized the danger of such short-sighted thinking. He said, "Toasters don't just turn bread into toast, they are also used to warm frozen waffles. What you see before you is really a breakfast food cooker. As the subjects of your kingdom become more sophisticated, they will demand more capabilities. They will need a breakfast food cooker that can also cook sausage, fry bacon, and make scrambled eggs. A toaster that only makes toast will soon be obsolete. If we don't look to the future, we will have to completely redesign the toaster in just a few years." "With this in mind, we can formulate a more intelligent solution to the problem. First, create a class of breakfast foods. Specialize this class into subclasses: grains, pork, and poultry. The specialization process should be repeated with grains divided into toast, muffins, pancakes, and waffles; pork divided into sausage, links, and bacon; and poultry divided into scrambled eggs, hard- boiled eggs, poached eggs, fried eggs, and various omelette classes." "The ham and cheese omelette class is worth special attention because it must inherit characteristics from the pork, dairy, and poultry classes. Thus, we see that the problem cannot be properly solved without multiple inheritance. At run time, the program must create the proper object and send a message to the object that says, 'Cook yourself.' The semantics of this message depend, of course, on the kind of object, so they have a different meaning to a piece of toast than to scrambled eggs." "Reviewing the process so far, we see that the analysis phase has revealed that the primary requirement is to cook any kind of breakfast food. In the design phase, we have discovered some derived requirements. Specifically, we need an object-oriented language with multiple inheritance. Of course, users don't want the eggs to get cold while the bacon is frying, so concurrent processing is required, too." "We must not forget the user interface. The lever that lowers the food lacks versatility, and the darkness knob is confusing. Users won't buy the product unless it has a user-friendly, graphical interface. When the breakfast cooker is plugged in, users should see a cowboy boot on the screen. Users click on it, and the message 'Booting UNIX v.8.3' appears on the screen. (UNIX 8.3 should be out by the time the product gets to the market.) Users can pull down a menu and click on the foods they want to cook." "Having made the wise decision of specifying the software first in the design phase, all that remains is to pick an adequate hardware platform for the implementation phase. An Intel Pentium with 48MB of memory, a 1.2GB hard disk, and a SVGA monitor should be sufficient. If you select a multitasking, object oriented language that supports multiple inheritance and has a built-in GUI, writing the program will be a snap." The king wisely had the software developer beheaded, and they all lived happily ever after.

Register to Reply
Guru

Join Date: Jul 2006
Location: Silicon Valley
Posts: 5356
Good Answers: 49
#67
In reply to #65

Re: C Programming

10/07/2014 10:23 PM

I have a joke too... Uh, can't quite remember how it goes, but the punch line was "Rectum?! Hell, it killed him!"

__________________
"Perplexity is the beginning of dementia" - Professor Coriolus
Register to Reply Off Topic (Score 5)
Anonymous Poster #1
#68
In reply to #65

Re: C Programming

10/08/2014 3:44 AM

Made more readable (more similar to the original text!):-

http://www.danielsen.com/jokes/objecttoaster.txt

Once upon a time, in a kingdom not far from here, a king summoned two of his advisors for a test. He showed them both a shiny metal box with two slots in the top, a control knob, and a lever. "What do you think this is?"

One advisor, an Electrical Engineer, answered first. "It is a toaster," he said.

The king asked, "How would you design an embedded computer for it?"

The advisor: "Using a four-bit microcontroller, I would write a simple program that reads the darkness knob and quantifies its position to one of 16 shades of darkness, from snow white to coal black. The program would use that darkness level as the index to a 16-element table of initial timer values. Then it would turn on the heating elements and start the timer with the initial value selected from the table. At the end of the time delay, it would turn off the heat and pop up the toast.

Come back next week, and I'll show you a working prototype."

The second advisor, a software developer, immediately recognized the danger of such short-sighted thinking. He said, "Toasters don't just turn bread into toast, they are also used to warm frozen waffles. What you see before you is really a breakfast food cooker. As the subjects of your kingdom become more sophisticated, they will demand more capabilities.

They will need a breakfast food cooker that can also cook sausage, fry bacon, and make scrambled eggs. A toaster that only makes toast will soon be obsolete. If we don't look to the future, we will have to completely redesign the toaster in just a few years." "With this in mind, we can formulate a more intelligent solution to the problem. First, create a class of breakfast foods. Specialize this class into subclasses: grains, pork, and poultry.

The specialization process should be repeated with grains divided into toast, muffins, pancakes, and waffles; pork divided into sausage, links, and bacon; and poultry divided into scrambled eggs, hard- boiled eggs, poached eggs, fried eggs, and various omelette classes." "The ham and cheese omelette class is worth special attention because it must inherit characteristics from the pork, dairy, and poultry classes. Thus, we see that the problem cannot be properly solved without multiple inheritance.

At run time, the program must create the proper object and send a message to the object that says, 'Cook yourself.' The semantics of this message depend, of course, on the kind of object, so they have a different meaning to a piece of toast than to scrambled eggs."

"Reviewing the process so far, we see that the analysis phase has revealed that the primary requirement is to cook any kind of breakfast food. In the design phase, we have discovered some derived requirements. Specifically, we need an object-oriented language with multiple inheritance. Of course, users don't want the eggs to get cold while the bacon is frying, so concurrent processing is required, too."

"We must not forget the user interface. The lever that lowers the food lacks versatility, and the darkness knob is confusing. Users won't buy the product unless it has a user-friendly, graphical interface. When the breakfast cooker is plugged in, users should see a cowboy boot on the screen. Users click on it, and the message 'Booting UNIX v.8.3' appears on the screen. (UNIX 8.3 should be out by the time the product gets to the market.)

Users can pull down a menu and click on the foods they want to cook." "Having made the wise decision of specifying the software first in the design phase, all that remains is to pick an adequate hardware platform for the implementation phase. An Intel Pentium with 48MB of memory, a 1.2GB hard disk, and a SVGA monitor should be sufficient. If you select a multitasking, object oriented language that supports multiple inheritance and has a built-in GUI, writing the program will be a snap."

The king wisely had the software developer beheaded, and they all lived happily ever after.

Register to Reply Score 1 for Off Topic
Guru

Join Date: Nov 2012
Posts: 633
Good Answers: 13
#69
In reply to #68

Re: C Programming

10/08/2014 8:57 AM

and here is an example of the difference of style and how it affects readability

Register to Reply
Anonymous Poster #2
#70
In reply to #69

Re: C Programming

10/08/2014 9:12 AM

It's very good, but a few parts could have been indented. I'd also have liked some labels and a few conditional jumps. Non functional comments would help, but I don't want to scroll sideways. The lack of parenthesis is a little disappointing .

Register to Reply Off Topic (Score 5)
Guru
Hobbies - CNC - New Member Hobbies - DIY Welding - New Member Engineering Fields - Electromechanical Engineering - New Member

Join Date: Aug 2007
Posts: 22637
Good Answers: 409
#71
In reply to #70

Re: C Programming

10/08/2014 10:22 AM

The lack of parenthesis is a little disappointing

You mean like LISp. (aka, Lost In Stupid parenthesis)

__________________
“ When people get what they want, they are often surprised when they get what they deserve " - James Wood
Register to Reply Off Topic (Score 5)
Guru

Join Date: Apr 2010
Location: About 4000 miles from the center of the earth (+/-100 mi)
Posts: 9046
Good Answers: 1031
#72
In reply to #69

Re: C Programming

10/08/2014 6:51 PM

Sorry about the formatting. I was in a hurry and didn't notice "cut and paste" didn't pick up the carriage returns / line feeds.

Register to Reply
Guru

Join Date: Nov 2012
Posts: 633
Good Answers: 13
#73
In reply to #72

Re: C Programming

10/09/2014 6:27 AM

It makes a good example of how some programmers write code that is hard to read and how a few simple changes improve on that.

The story is a good example of how bloated most operating systems and programs have become.

Register to Reply
Commentator

Join Date: Aug 2009
Location: Carrollton, TX.
Posts: 78
Good Answers: 6
#27

Re: C Programming

10/01/2014 8:48 AM

'C' does start out with a steep learning curve. I started by reading the book "The C Programming Language" by Kernighan and Ritchie, (hope my spelling is correct here). Once you get into pointers, things seem to 'snap' into place with the understanding of this language. I would recommend trying to stay with class until then, it will come to you with just a little perseverance.

__________________
MRH - "The search for truth is more precious than its possession." Albert Einstein
Register to Reply Score 1 for Good Answer
Guru

Join Date: Nov 2012
Posts: 633
Good Answers: 13
#30

Re: C Programming

10/01/2014 10:33 AM

I would ask 'which' motor controller and then check to see what tools are available. From a programming standpoint first "flowchart"...understand the device functions and what needs to be done... then 'pseudocode'... work out which functions work out to calls to routines buried in C libraries that someone else wrote and try to understand them. This is time consuming, but possible. Try to understand the compiler differences...whose are you using? OBJECT oriented programming is an act of faith!

OR

Learn how to code the processor you are using at machine level.

Learn 'Forth', a programming system that sets up a stack oriented virtual machine on whatever system you are using and allows you to write high level code with immediate access to machine level assembly.

Register to Reply Off Topic (Score 5)
Guru

Join Date: Apr 2014
Posts: 1869
Good Answers: 67
#36

Re: C Programming

10/01/2014 10:23 PM

If your professor gets a little haughty and push comes to shove, perhaps remind the dear professor that there was a time when he was in your shoes, learning the language for the first time and, given his teaching style, ask him what are the chances that he would have preferred a different professor than himself to teach him? If he's impatient and haughty, I'd say the chances are pretty good.

Sometimes people forget their roots and so lose their way. Everybody was a 'dummy' once - including your professor. It may be helpful to remind him of that - and yourself that you'd mastered a great many things already and long before he was even a twinkle in his daddy's eye.

Register to Reply Score 1 for Good Answer
Guru

Join Date: Apr 2010
Location: About 4000 miles from the center of the earth (+/-100 mi)
Posts: 9046
Good Answers: 1031
#49

Re: C Programming

10/04/2014 1:05 PM

Here's a free online tutorial you might like. It's pretty straight forward...

http://www.tutorialspoint.com/cprogramming/cprogramming_tutorial.pdf

Register to Reply Score 1 for Good Answer
Participant

Join Date: Oct 2014
Posts: 3
#57

Re: C Programming

10/07/2014 10:43 AM

There are a gazillion good tutorials - enought that you can find one that speaks to you.

The K&R book is a good place to look when the tutorials are starting to make sense to solidify your new knowlege.

To flex your new knowlege I suggest the absolute best place to turn is to read other peoples code. The web is full or real code doing just about anything you can image if you care to search for it. This will show you how real people use the languge to do real things like you want to do. Don't assumed that if you can't read it that you are the problem - some people write crappy code.

Register to Reply
Guru
Popular Science - Evolution - New Member Popular Science - Weaponology - New Member

Join Date: May 2006
Location: The 'Space Coast', USA
Posts: 11112
Good Answers: 918
#58
In reply to #57

Re: C Programming

10/07/2014 11:36 AM

Reading other people's code is very much a mixed bag and discouraged for a biginner.

It's worse than trying to learn how to be a good writer by reading everything from Shakespeare to porn.

The reason is is worse is that it is not possible as a beginner to recognize good code writing practices from bad and there are far more badly written code examples on the internet than good.

Programming requires both an understanding of good architecture (not to be confused with style) as it does a mastery of the language itself.

Register to Reply
Guru
Hobbies - CNC - New Member Hobbies - DIY Welding - New Member Engineering Fields - Electromechanical Engineering - New Member

Join Date: Aug 2007
Posts: 22637
Good Answers: 409
#59
In reply to #58

Re: C Programming

10/07/2014 11:45 AM

It helps if they have a good habits of coding structure. But at times this can take time to cypher.

__________________
“ When people get what they want, they are often surprised when they get what they deserve " - James Wood
Register to Reply
Guru
Popular Science - Evolution - New Member Popular Science - Weaponology - New Member

Join Date: May 2006
Location: The 'Space Coast', USA
Posts: 11112
Good Answers: 918
#63
In reply to #59

Re: C Programming

10/07/2014 2:36 PM

I spent 20+ years coding and leading teams to develop embedded software for aviation DO-178B level B and Level A.

Structure is mandatory. Hard to imagine it any other way, but I think if I were to ever read the code that's inside my Kenwood car radio I would get the worst case of gas. ;-)

Register to Reply
Guru
Hobbies - CNC - New Member Hobbies - DIY Welding - New Member Engineering Fields - Electromechanical Engineering - New Member

Join Date: Aug 2007
Posts: 22637
Good Answers: 409
#64
In reply to #63

Re: C Programming

10/07/2014 2:57 PM

Not too hard,

I consider myself a novice... and never really considered myself a true programming, even though I would trouble shoot code through the night. (A lot of the trouble I had, was not the syntax, but actually appearance and had to do with my structure,.... or lack of.)

When I first started programing, my major required programming classes but the classroom instruction was very basic. And even though structure should have been the foundation, I must have been sick that day when they covered it.

Because the structure of my programing was horrid. Mostly because I had to learn on my own, and only then did I learn the real value of this. (Also because I was learning and doing concurrently, my grasp of the syntax was also weak)

A company where I worked for, I did a rather involved program on my own. (Only because I was told it wasn't needed) My response was, no its not needed today, but it will be tomorrow. Still I was told not to, but did it anyways on my own time.

I left that company and 7 years later I was called in (interview) when I was looking for a contracting position.

They showed me what I was going to be doing me, and showed me their source code and asked if I understood it.

I did, it was beautifully structure (someone rewrote it my code and structed it beautifully) but I recognized it as mine code I wrote, because my sub routines (POW) acronym for Prisoner Of Work or hop-a-long, such as that. Some routines even ridiculed crappy co-workers and bosses...., (even those subs stayed the same).

I told them of course I do, I wrote the base code. Of which they were surprised and was not aware of it, until I started to explain the routines to them with not so much as a glance.

I don't program anymore.... only because it keeps me up at night.

__________________
“ When people get what they want, they are often surprised when they get what they deserve " - James Wood
Register to Reply
Participant

Join Date: Oct 2014
Posts: 3
#60

Re: C Programming

10/07/2014 12:26 PM

Granted that C is hard to read, and bad code even more so.

The thing here is learning how to do things in C. Reading other peoples code and working through what it might mean is a way to reinforce what the language is all about.

Every languge has things you do to use the features of the language; what I do in Basic is very different than what I do in C; there is absolutly nothing in basic that prepares you to deal with pointers. That said - once you learn how to do things with pointers you miss them when they are not available.

C is just assembly languge with the rough edges knocked off; learning either one helps you learn the other. Since the CPU "speaks" assembly languge embedded programming is likely to work better with one or the other for a long time to come.

Register to Reply
Guru
Popular Science - Evolution - New Member Popular Science - Weaponology - New Member

Join Date: May 2006
Location: The 'Space Coast', USA
Posts: 11112
Good Answers: 918
#62
In reply to #60

Re: C Programming

10/07/2014 2:32 PM

I did not say C is hard to read. I said that for a beginner, picking up other people's code and expecting to use it as good examples of C programming is little different than picking up a used condom off the street - you just never know where its been.

This is why we have instructors, so we do not start down the path of bad habits. Unless you know what is good and bad you have no way to discriminate between them.

So I fundamentally disagree that reading other's code is necessarily a good way to reinforce good practices because the beginner is clueless. Once you understand the fundamentals it may be another story.

C is not quite assembly with the rough edges knocked off. It is still an abstraction of machine code, but that abstraction makes it portable, whereas assembly is not.

The only thing that learning assembly code will translate to other languages is learning about structured programming. That assumes that structure is taught as part of any course. However, you don't need assembly to learn about structure. Any language will serve for that. The alternative is known as spaghetti code.

I agree that C, and to a lessor extent - assembly, will be the backbone of embedded programming. However, assembly is rapidly becoming redundant in most applications due to the huge speed of modern microcontrollers and the low cost of memory.

20 years ago that was a different story, but now C++ and operating systems are finding their way into embedded applications where they were unthinkable before.

Register to Reply
Participant

Join Date: Oct 2014
Posts: 1
#61

Re: C Programming

10/07/2014 1:49 PM

Hey there, I have learned C/C++ in the past on my own, but right now I am learning Java in school. The professor makes absolutely no sense. He is very disorderly in his lectures, and jumps from window to window as he tries to explain things. But there are some very good text books for learning programming languages. I was about a month behind on getting through the homework, but I opened up the text book, which had very clear examples, and in a week I had caught up with the rest of the class.

I have also heard from others that programming is one subject that is best learned on your own. You cannot survive programming if their are holes in your learning, you have to study it thoroughly on your own.

Register to Reply
Power-User

Join Date: Oct 2008
Location: Meherrin Virginia
Posts: 319
Good Answers: 6
#74

Re: C Programming

10/10/2014 7:17 PM

I can share your pain, I learned to touch type at 50 and started programming in basic at about the same age, probably a little younger. My motivation to type was to develop speed to input to a computer. I have managed to extend this particular life to the point that I will be 76 this month.

I am still fighting these pesky languages, this advise probably won't be of much use to you, but I found that any language that needed a compiler was usually so committed to structure and for lack of a better term "purity" that they can't be approached with something as simplistic as common sense.

I personally found that I had to approach the higher level languages by learning the more forgiving languages like HTML, Javascript, PHP etc. Not only are these forgiving there is enough information on the internet that you can find an explanation that you can understand on the interne, and if the first one doesn't make it clear there are at least 20 more to choose from and you can understand one of them.

Even some of the "tight ass" languages have better explanations on the internet than you will get on campus.

include, void and main to you.

Good luck

__________________
If you fail to follow through, you will fail.
Register to Reply
Active Contributor

Join Date: Oct 2007
Posts: 12
#75
In reply to #74

Re: C Programming

10/10/2014 9:27 PM

You have got to the root of the matter.

I was trying to search for some logic in the structure of the program instructions and failing which , was getting frustrated.

But, now i have learned to leave common sense behind and rote the syntax for each command(initially) and repetitively using the commands by practicing a lot is helping.

Its working.I am writing small codes, successfully.

Thanks all, for all your insights and sharing your experiences.

Register to Reply
Guru

Join Date: Mar 2007
Location: Etherville
Posts: 12334
Good Answers: 115
#76
In reply to #74

Re: C Programming

10/10/2014 11:23 PM

Much kudos on the typing - 76 wpm is astonomic !

Leg-pulling aside, I am peeked to ask how you learned to type. Even after many years of such stuff as Mavis Beacon, I just can not do it. Whilst doing a course some years back, the tutor got so frustrated he took out a marker pen and wrote on each of my fingers which key it was to be used for.

I'd look into my keyboard mayhem more, but other stuff troubles me. Several personal friends have said that they now e-mail, not just because it's easier, because they have lost the art of handscript. Joyous news to me, because my handwriting is worser than my spelung.

Every try I've ever made at touch-typing has flunked, and hardly for lack of trying. To make me double-stupid, I can shut my eyes and know where every single key is . Fingers and <whatever it may be> just will not communicate.

__________________
For sale - Signature space. Apply on self addressed postcard..
Register to Reply
Guru

Join Date: Jul 2006
Location: Silicon Valley
Posts: 5356
Good Answers: 49
#77
In reply to #76

Re: C Programming

10/11/2014 2:06 AM

Well, you just have to get over the fact that typing and scotch don't mix.

__________________
"Perplexity is the beginning of dementia" - Professor Coriolus
Register to Reply
Guru

Join Date: Mar 2007
Location: Etherville
Posts: 12334
Good Answers: 115
#78
In reply to #77

Re: C Programming

10/11/2014 4:50 AM

You're darn right - Vodka is much better !

__________________
For sale - Signature space. Apply on self addressed postcard..
Register to Reply
Power-User

Join Date: Oct 2008
Location: Meherrin Virginia
Posts: 319
Good Answers: 6
#79
In reply to #76

Re: C Programming

10/11/2014 6:03 PM

The typing was a real chore, I went the online "Mavis Bacon" route, I don't remember the program. I do remember that I put an unbelievable amount of hours into it. At my peak I could do 40/min. on a computer, back then a lot of it was on a typewriter (the most unforgiving device in existence) where my speed faltered to about 20/min.

It was probably one of the better usages of my time for the results obtained. I now time myself by how long it takes before my fingers start to cramp up. You got to love old age.

__________________
If you fail to follow through, you will fail.
Register to Reply
Register to Reply 81 comments
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Comments rated to be Good Answers:

These comments received enough positive ratings to make them "good answers".

Comments rated to be "almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, rate them!
Copy to Clipboard

Users who posted comments:

70AARCuda (1); adreasler (1); Andy Germany (5); Anonymous Hero (4); Anonymous Poster (2); bitking (2); craftsmen (3); Del the cat (4); europium mkII (7); geraldpaxton (7); GM1964 (2); IanR (2); indel (1); JohnDG (1); Kris (3); matthew rapaport (2); MRH620 (1); otha (2); phoenix911 (12); Raisintoe (1); Rixter (7); SolarEagle (2); Tom_Consulting (2); vermin (7)

Previous in Forum: Help Finding NTE Quick Cross   Next in Forum: Computer Security Software

Advertisement