[Noisebridge-discuss] Recommendations for learning C?

bandit bandit at cruzio.com
Fri Mar 9 16:29:00 PST 2012


> Remember...
>
> Be a pointer.

"you mean like this?"

(I will buy a soda, assuming the machine has some, to the first person
who can explain this when I am at NB.)

The key to using C (or any other language) is write clean, simple, dumb code.
Don't get all fancy in the code - get fancy in the algorithm.
The what is fancy, the how is simple.
And *comment*.

as far as ASM - I have forgotten more ASM languages that you and I have
fingers and toes.
This includes the ones I created.
(is it    to, from  or    from,to     ?)
The other problem is since the 80's, most micros are designed so the ASM
is intended for compilers, not humans.
Try to decode a PowerPC opcode - oye!

The best way to quickly come up to speed on some flavor of ASM is to write
sample code
in C, then compile with the listing output (try different optimization
levels).
Work thru the generated ASM, and look at the rest of the generated output,
like the various sections (.data, .bss, .code, etc).
Embedded systems use a bunch of sections for the linker that a PC app does
not
need to deal with. One of the joys of the embedded world.

I should be around NB tomorrow (10 Mar).

... bandit

>
> On Fri, Mar 9, 2012 at 3:31 PM, Robert Chu <robertayoungchu at gmail.com>
> wrote:
>> I remember you Bandit, thanks for support by being open to answering
>> questions.
>>
>> Cheers
>> Rayc
>>
>>
>> On Fri, Mar 9, 2012 at 3:20 PM, jim <jim at well.com> wrote:
>>>
>>>
>>> how's your assembler on *nix?
>>>
>>>
>>>
>>> On Fri, 2012-03-09 at 14:35 -0700, bandit wrote:
>>> > I happen to be a C expert (30+ years, well over a million LOC as a
>>> > guess).
>>> > I am glad to answer C questions when I am at NB on Saturdays.
>>> > (I am the guy with one hand.)
>>> >
>>> > I recommend "Learn C in 21 days" over the white book.
>>> > The white book (K&R 2) is the absolute best piece of tech writing I
>>> have
>>> > ever seen,
>>> > but for a beginner, "21 days" is better - it breaks the pieces down
>>> > better.
>>> >
>>> > ... bandit
>>> >
>>> >
>>> > >
>>> > >
>>> > >     Great! I've been lonely in there the last several
>>> > > weeks. Note that Robert is finishing up his SQL class
>>> > > at 6 PM and tends to run over. We can deal with that.
>>> > >     Note also that the format is specified as "study
>>> > > group" rather than class. The idea is that we're all
>>> > > humbly studying along trying to help each other; the
>>> > > class format is that some one person goes blah blah...
>>> > > and everybody else has to shut up and listen.
>>> > >     In fact, mostly the C part of things has been a
>>> > > class, but that's entirely negotiable per your (and
>>> > > anyone-else-who-shows-up's) wishes.
>>> > >     You've got access to a linux computer, yes?
>>> > >
>>> > >
>>> > >
>>> > > On Thu, 2012-03-08 at 12:03 -0800, Robert Chu wrote:
>>> > >> Thank you all for recommendations so far.
>>> > >>
>>> > >>
>>> > >> Daravine: if I could borrow The C Programming Language, 2nd
>>> Edition,
>>> > >> by Kernighan and Ritchie. That would be wonderful.
>>> > >>
>>> > >>
>>> > >> Andy: Thank you for the recommendations.
>>> > >>
>>> > >>
>>> > >> Jim: I am looking into coming in on Tuesdays to attend the C
>>> class.
>>> > >>
>>> > >>
>>> > >>
>>> > >>
>>> > >> Thanks for all the given and upcoming recommendations
>>> > >> Cheers
>>> > >> Rayc
>>> > >>
>>> > >> On Thu, Mar 8, 2012 at 11:52 AM, jim <jim at systemateka.com> wrote:
>>> > >>
>>> > >>            Why don't you come by the Turing classroom at 6 PM
>>> > >>         some Tuesday evening. That place/time is scheduled for
>>> > >>         C programming (and assembler, per interest) on Linux.
>>> > >>
>>> > >>            As to books, that depends on your experience. If you
>>> > >>         have little or no programming experience, then Stephen
>>> > >>         Kochan's ANSI C is probably the best book--it is not
>>> > >>         complete but it's a really well written intro to the
>>> > >>         language. Also Steven Prata (C Primer Plus) and Robert
>>> > >>         LaFore (I forget the title) have very good books for
>>> > >>         people just getting into C.
>>> > >>
>>> > >>            One of the best books for those who are serious was
>>> > >>         put out by MIX publishing. It claims it's written for
>>> > >>         intermediate level students, but those must be some smart
>>> > >>         and/or determined intermediates. It's divided into two
>>> > >>         sections, tutorials and reference. Both sections have
>>> > >>         lots and lots of examples, and to have example code for
>>> > >>         each library function is rare in a book.
>>> > >>            I donated a couple of copies to the library. I'm
>>> > >>         afraid that some pinhead threw them out because they're
>>> > >>         written for MS-DOS. That they're written for MS-DOS has
>>> > >>         nothing to do with their value. It's the explanations and
>>> > >>         example code that's valuable.
>>> > >>
>>> > >>            The K&R book has two editions: you probably have the
>>> > >>         ANSI C edition; check to be sure, as the older edition is
>>> > >>         pre-ANSI spec and in a few ways will throw you off.
>>> > >>
>>> > >>            There is a huge number of tutorials on the internet.
>>> > >>         It takes time to sort through those that make sense to
>>> you.
>>> > >>         I have links to some that I like. Wikipedia has very good
>>> > >>         info on C programming.
>>> > >>
>>> > >>
>>> > >>
>>> > >>
>>> > >>
>>> > >>
>>> > >>         On Thu, 2012-03-08 at 07:01 -0800, Robert Chu wrote:
>>> > >>         > Good morning Noisebridge Community,
>>> > >>         >
>>> > >>         >
>>> > >>         > I have decided to start learning C programming and was
>>> > >>         wondering if
>>> > >>         > anybody could give me good recommendations on: books,
>>> > >>         videos, talks,
>>> > >>         > papers, etc. So far I am studying from the book Sam's
>>> Teach
>>> > >>         Yourself C
>>> > >>         > in 21 Days Sixth Edition.
>>> > >>         >
>>> > >>         >
>>> > >>         > All resource recommendations are greatly appreciated,
>>> and
>>> > >>         most likely
>>> > >>         > would be a catalyst to my learning.
>>> > >>         >
>>> > >>         >
>>> > >>         > Cheers
>>> > >>         > Rayc
>>> > >>
>>> > >>         > _______________________________________________
>>> > >>         > Noisebridge-discuss mailing list
>>> > >>         > Noisebridge-discuss at lists.noisebridge.net
>>> > >>         >
>>> > >>
>>> > >> https://www.noisebridge.net/mailman/listinfo/noisebridge-discuss
>>> > >>
>>> > >>
>>> > >>
>>> > >>
>>> > >>
>>> > >> _______________________________________________
>>> > >> Noisebridge-discuss mailing list
>>> > >> Noisebridge-discuss at lists.noisebridge.net
>>> > >> https://www.noisebridge.net/mailman/listinfo/noisebridge-discuss
>>> > >
>>> > >
>>> > >
>>> > >
>>> >
>>> >
>>>
>>>
>>> _______________________________________________
>>> Noisebridge-discuss mailing list
>>> Noisebridge-discuss at lists.noisebridge.net
>>> https://www.noisebridge.net/mailman/listinfo/noisebridge-discuss
>>
>>
>>
>> _______________________________________________
>> Noisebridge-discuss mailing list
>> Noisebridge-discuss at lists.noisebridge.net
>> https://www.noisebridge.net/mailman/listinfo/noisebridge-discuss
>>
>
>


-- 
bandit at cruzio.com
505-228-8197
bandit.name

I am a systems engineer, specializing in:
- Mission-Critical embedded systems
- device drivers
- control and data acquisition systems
My stuff *works* - *all the time*.

Member: INCOSE.org, PACA.org, IEEE.org, CaliforniaConsultants.org, quelab.net

And to support my son: Proud members of the New Mexico .NET User Group.
Please go to the community website at www.nmug.net.




More information about the Noisebridge-discuss mailing list