|
Hi Jevgeni
Comments inline.
Regards
Frank Kolmann
date: Mon, 20 Jan 2014 11:50:35 +0000
from: Jevgeni Astanovski <Jevgeni.Astanovski@xxxxxxxxxxxxx>
subject: Re: [C400-L] C syntax errors
Frank,
I learnt programming C more than 20 years ago - and I used solely K&R book.
Just start from the beginning and do all exercises without exceptions
- this is how I did it.
Of course there is one little thing to mention -
you also occasionally need someone who is ready to act as a tutor.
Looks like the K&R book is the way to go. No one has mentioned any other.
Have you still got your solution for exercise 5.20.
If so can I have the code please?
This is for 2 major issues:environment/compiler.
1. You must get familiar with the particular programming
This is not covered in the Book so you will need external help.example.
2. You will need that "someone" to prevent you from spending
hours on stupid problems, like, for example one { missing in the source
I am using the iSeries C compiler, so far so good.
I dont have a tutor, so my problems are my own.
Now in general.C-style.
As far as I understand, there is such a thing like "C-style".
Some people are proud that they are writing C using "C-style".
This "while (ns-->0) is very C-style. Your example with double * is also
C-style assumes using lots of *, &, -> and mixing them in all possible
combination making it close to impossible for anyone
(including yourself after a month) to understand the code.
But you can also write clearly understandable code - and not take
care of minimizing keystrokes, which indeed is a very bad practice.
I certainly intend to not use "C-style" but its a two edged sword
what to dont use you lose.
Another thing - there is no such thing like: you MUST write shortfunctions.
One simple reason - it is always easier to read consecutive row of
source code lines than to jump from one function to another,
then from there further (deeper) and again and again.
So my advise - write the way YOU like, the way YOU feel convenient with.
And luckily for us - C allows you to do it.
I know the problem of function upon function upon function etc. I
have seen this is RPG ILE and I am wary of it.
And one last thing - from an old-style programmer.
Do not start to write code before you have a more or less
(at least high-level) understanding of what you are writing.
I am up to Ch 5 in K&R and I think I have a good understanding so far.
From another old programmer I understand what you mean.I am learning C because I got bored.
Good luck!Thanks
Jevgeni.--
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.