4/5 I want to improve my C coding skill. Would it help my
understanding to read the spec or is there something better to
increase my understanding and use of C?
\_ download the cs61c assignments and do them.
\_ practice with it and give yourself projects to motivate you to
learn.
\_ Take 164, 170, 172, 174. Read the Art of Computer Programming.
A good algorithm will beat any C and compiler optimizer trick.
You can hiring a lot of people and a lot of cheap hardware
to make things run fast, or you can hire one Phd. Take your pick.
\_ academia sux0r!
\_ Dude. A good bachelors is a better coder than most CS PhDs
from Berkeley I know. The strength of a PhD is not in their
coding skill.
\_ Agreed. BS and MS guys are much better coders than PHDs.
Some PHDs are good designers, but some just have thier
head up thier ass since they haven't every had to get
anything to work with a deadline/customer on the phone.
\_ Use 4 spaces (or tabs) to align code properly.
Use carriage returns before and after brackets.
Be consistent with other white-space use (parentheses).
Now even if you do write crappy code, others will be able to
identify the crap quickly.
\_ the use of spaces (instead of tabs) is bad. Recommend using
tabs to indent. 8 is more standard than 4, but yes, 4
looks better.
\_ Use Of Spaces Instead Of Tabs Considered Harmful.
\_ Oh..... how I *DESPISE* how some code editors represent tabs
as 4 spaces in the default setting. Tabs are goddamn 8
spaces.
\_ Why? Because they take more bytes to store? With disk prices
these days is that really a concern? Can any editor not handle
the spaces? Hell, at least everyone sees it formatted the
same. You have a problem with maintainable code?
\_ imagine an environment where people use MS Visual C++,
vi, emacs, notepad, etc. Each one treats tab a certain
\_ notepad always treats tabs as 8 chars,
and god forbid i look up the tab spacing
command in vi
way. Its easy to use across different editors. Also,
emacs, for example, has a special mode which works
very well with tabs. See C-Mode in emacs.
\_ The fact that each one treats tab (sic) a certain
(and different) way is why spaces are better.
\_ Are you arguing for or against tabs?
\_ for tabs
\_ All my editors handle spaces/tabs as whitespace for
indenting/hilighting, etc. Of course, I don't use emacs.
This just seems like a cry not to break your .emacs --
sorry but not all of us use emacs.
\_ I believe if you looked through industry code
most use tabs. And most of those coders were
probably not emacs users.
\_ Uh, I am in industry. And many people I know have
agreed with me on this one. Hence many uses
spaces instead of tabs.
\_ Industry is mostly divided between vi and
emacs, with some companies favoring one
more than the other. At Sun I heard its
mostly vi, while at Cisco (from experience)
its recommended that you use emacs (lots
of homegrown lisp for development).
\_ Just use C-Mode in emacs. It does all the indenting correctly,
and you can easily tell when one of those vi lusers edits your
source files since the indenting will be off.
\_ .emacsrc foo required?
\_ Reading through K&R is worthwhile, but nothing beats writing lots
of code. -dans
\_ "Deep C Secrets: Expert C Programming" is a much more useful book
to read than the spec. (And I recommended it even before I worked
for one of the companies involved in publishing it.) -alan-
\_ This is an excellent book and should be required
reading for everyone who is programming professionally.
It also helps your fu!
\_ you can't improve your C coding skill without understanding the
big picture. A thorough understanding of machine architecture
compiler, OS, networking, math, and most importantly theory is
required. Being a good programmer is more than just reading
"Learning C in 21 Days." If you want to be a good programmer,
go to a community college. If you want to be a good computer
scientist, go to Berkeley.
\_ FUCK YOU! i learned perl in 21 days and i'm making
$80K/year and that's probably more than what you're
making as an academic sux0r
\_ You seem rather pissed off in spite of your $80K/year.
-dans |