Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Recommendation for a text

Reply
Thread Tools

Recommendation for a text

 
 
Nomen Nescio
Guest
Posts: n/a
 
      03-05-2012
I've been noticing the English is reprehensible in K&R II. The first edition
wasn't great but the errors in the 2nd edition are indeed egregious and now
I find it difficult to read because of the glaring errors. Has anyone else
noticed this or did somebody butcher the copy I ripped off from the 'net
(serves me right for not paying?) I do have a paid copy of the first
edition, well worn btw. Was just too lazy to go looking for the 2nd so
ripped one off from the comfort of my easy chair.

> but it is rarely the right choice for a "normal" application.


This should be at the front of every C textbook but it's far, far too late
for that...

 
Reply With Quote
 
 
 
 
Kleuske
Guest
Posts: n/a
 
      03-05-2012
On Mon, 05 Mar 2012 15:27:43 +0100, jacob navia saw fit to publish the
following:

> Le 05/03/12 14:21, John Coleman a écrit :
>>

> You can use my compiler system and its associated text book: "An
> introduction to C programming using lcc-win".
>
> It has several advantages:
>
> o It is free of charge (the compiler AND the introduction) o It starts
> from the ground up, but covers sophisticated topics
> like in-depth floating point analysis, memory allocation strategies
> and many others.
>
> o It is geared to lcc-win but all extensions of lcc-win are clearly
> marked as extensions.
>
> I am sure many people in this group will start complaining about it and
> propose you gcc or some variant. Just ignore them
>
> You can judge yourself by downloading it from
>
> http://www.cs.virginia.edu/~lcc-win32
>
> To download the introduction only, click on the "Tutorial" button.
>
> Jacob



Shamelessly promoting your own stuff isn't exactly "advice".


--
Fascinating is a word I use for the unexpected.
-- Spock, "The Squire of Gothos", stardate 2124.5
 
Reply With Quote
 
 
 
 
John Coleman
Guest
Posts: n/a
 
      03-05-2012
On Monday, March 5, 2012 3:09:19 PM UTC-5, Kleuske wrote:
> On Mon, 05 Mar 2012 15:27:43 +0100, jacob navia saw fit to publish the
> following:
>
> > Le 05/03/12 14:21, John Coleman a écrit :
> >>

> > You can use my compiler system and its associated text book: "An
> > introduction to C programming using lcc-win".
> >
> > It has several advantages:
> >
> > o It is free of charge (the compiler AND the introduction) o It starts
> > from the ground up, but covers sophisticated topics
> > like in-depth floating point analysis, memory allocation strategies
> > and many others.
> >
> > o It is geared to lcc-win but all extensions of lcc-win are clearly
> > marked as extensions.
> >
> > I am sure many people in this group will start complaining about it and
> > propose you gcc or some variant. Just ignore them
> >
> > You can judge yourself by downloading it from
> >
> > http://www.cs.virginia.edu/~lcc-win32
> >
> > To download the introduction only, click on the "Tutorial" button.
> >
> > Jacob

>
>
> Shamelessly promoting your own stuff isn't exactly "advice".
>
>
> --
> Fascinating is a word I use for the unexpected.
> -- Spock, "The Squire of Gothos", stardate 2124.5


What is "shameless" about promoting something that you are justly proud of,
especially when it is on-topic? Also - note that I specifically mentioned Jacob
by name in my original post since I thought an idea he had discussed (last fall?) was a promising idea for teaching. That made the mention of his text
quite natural in his reply.
 
Reply With Quote
 
John Coleman
Guest
Posts: n/a
 
      03-05-2012
On Monday, March 5, 2012 9:27:43 AM UTC-5, jacob navia wrote:
> Le 05/03/12 14:21, John Coleman a écrit :
> >

> You can use my compiler system and its associated text book:
> "An introduction to C programming using lcc-win".
>
> It has several advantages:
>
> o It is free of charge (the compiler AND the introduction)
> o It starts from the ground up, but covers sophisticated topics
> like in-depth floating point analysis, memory allocation strategies
> and many others.
>
> o It is geared to lcc-win but all extensions of lcc-win are clearly
> marked as extensions.
>
> I am sure many people in this group will start complaining about it
> and propose you gcc or some variant. Just ignore them
>
> You can judge yourself by downloading it from
>
> http://www.cs.virginia.edu/~lcc-win32
>
> To download the introduction only, click on the "Tutorial" button.
>
> Jacob


Thanks for the offer but I tend to use Textpad + gcc (via MinGW) for my
own programming and don't want to spend time learning a different environment
between now and then. Also - the fact that lcc-win32 has an IDE is a bit ofa
drawback from my perspective since as a side-purpose of the class I think that
it is good that the students get more exposure to command-line tools.

-John
 
Reply With Quote
 
John Coleman
Guest
Posts: n/a
 
      03-05-2012
Than

On Monday, March 5, 2012 12:43:30 PM UTC-5, Keith Thompson wrote:
> John Coleman <(E-Mail Removed)> writes:
> > I teach math and computer science (though mostly math) at a small liberal arts college. Because of our smallness we don't have a huge course offering. To compensate, we have a grab-bag "special topics course" where we cover different topics each semester based on student's and/or professor's interests.

> [...]
>
> It's helpful to add line breaks so your lines are no longer than
> 80 columns, preferably 72. Some Usenet clients deal with very long
> lines just fine, but others don't. (Mine, for example, wraps long
> lines, but not at word boundaries.
>
> --
> Keith Thompson (The_Other_Keith) http://www.velocityreviews.com/forums/(E-Mail Removed) <http://www.ghoti.net/~kst>
> Will write code for food.
> "We must do something. This is something. Therefore, we must do this."
> -- Antony Jay and Jonathan Lynn, "Yes Minister"


Thanks for the tip - I'll try to keep it in mind, though it might be somewhat
hard when posting via an editor that has a small window size and automatic
word wrap. Hard - but not that hard I guess.

 
Reply With Quote
 
BartC
Guest
Posts: n/a
 
      03-05-2012

"John Coleman" <(E-Mail Removed)> wrote in message
news:19481535.945.1330979870599.JavaMail.geo-discussion-forums@yner4...

> Thanks for the offer but I tend to use Textpad + gcc (via MinGW) for my
> own programming and don't want to spend time learning a different
> environment
> between now and then. Also - the fact that lcc-win32 has an IDE is a bit
> of a
> drawback from my perspective since as a side-purpose of the class I think
> that
> it is good that the students get more exposure to command-line tools.


I've been using lccwin32 for at least ten years, and I've never used it's
IDE. Although I also use mingw/gcc for a 'second opinion' (as my C work is
mostly experimental).

--
Bartc

 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      03-05-2012
On 03/ 6/12 04:36 AM, Stefan Ram wrote:
> John Coleman<(E-Mail Removed)> writes:
>> I wanted to emphasize to prospective students that
>> C is not some language that was replaced by C++

>
> You might show them
>
> http://www.tiobe.com/content/paperinfo/tpci/index.html
>
> . C++ now even has been exceeded by C# in popularity.
> C++ is dying.


C and C++ still dominate the embedded and non-windows system programming
space, neither is dying and one hasn't replaced the other.

--
Ian Collins
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      03-05-2012
On 03/ 6/12 06:44 AM, Stefan Ram wrote:
> Ben Bacarisse<(E-Mail Removed)> writes:
>> link with almost any other language, but it is rarely the right choice
>> for a "normal" application. (These are not the only use-cases but the
>> point should be made that C is hard to use correctly and that must
>> be justified when choosing it.)

>
> But what do you use for a »normal application«?
>
> I would like to say »Java«, but the Java people say that Java is
> disappearing from the desktops and has moved on to web servers.


Common sense does prevail sometimes!

> (Also, I am not sure what defines a »normal application«.
> To a young student, it's an »app«? So learn Objective-C for iOS?)


That really depends on the environment. In the Unix world, Python is
becoming increasingly popular for utilities that used to be written in C.

--
Ian Collins
 
Reply With Quote
 
ImpalerCore
Guest
Posts: n/a
 
      03-05-2012
On Mar 5, 8:21*am, John Coleman <(E-Mail Removed)> wrote:
> Greetings,


[snip]

> Also - I am open to ideas about projects for the students to work on.
> Thanks in advance for any suggestions


One project that could be interesting is to create a spell checker.
Have a dictionary of words, use the levenshtein distance to evaluate
closeness, and present a top 5 list of alternatives. One could
incorporate file I/O to add words to a dictionary file.

Another project would be to create an email spam filter. You could
have a students collect samples of spam email, and devise methods to
remove unwanted email. You could use simple keyword recognition, like
if "meds" is in the subject header, send it to the spam folder. You
could just have a file of email subject headers to evaluate, and they
can calculate a likelihood that the email is spam. You could even
make it a student contest to design the best spam filter that
eliminates the majority of spam. You give them a sample file, while
you run their program on your master file to determine accuracy.

You can create structures that would mimic records in a database.
Then have them be able to search, sort, or filter on given field(s).
Here is a simple example of movie database.

\code
struct movie_record_tag
{
int id;
char title[40];
char rating[10];
int year;
};
typedef struct movie_record_tag movie_record;

movie_record movie_data[] =
{
{ 1, "Avatar", "PG-13", 2009 },
{ 2, "Ratatouille", "G", 2007 },
{ 3, "The Matrix", "R", 1999 },
{ 4, "The Lord of the Rings: The Two Towers", "PG-13", 2002 },
{ 5, "The Dark Knight", "PG-13", 2008 },
{ 6, "Back to the Future", "PG", 1985 },
{ 7, "The Forbidden Planet", "PG", 1956 },
{ 8, "Iron Man", "PG-13", 2008 },
{ 9, "Star Trek II: The Wrath of Khan", "PG", 1982 },
{ 10, "Terminator 2: Judgement Day", "R", 1991 },
{ 11, "Jonah: A VeggieTales Movie", "G", 2002 },
{ 12, "Star Wars V: The Empire Strikes Back", "PG", 1980 },
{ 13, "Sneakers", "PG-13", 1992 },
{ 14, "Finding Nemo", "G", 2003 },
{ 15, "Aliens", "R", 1986 }
};
\endcode

You could have them store it in a container to be able to sort based
on the year, or filter movies appropriate for a person's age (like a 5
yr old would only be able to see G rated movies). If you have a
linked list container API, you could have them insert these records
into a linked list, then use search and sort functions to analyze the
data.

You could incorporate some kind of date processing to categorize
people by age, like say find out who the top 10 oldest or youngest
presidents were. They would need to do the conversions of dates in a
string format like "mm/dd/yyyy" to some kind of day count (you could
use a Gregorian calendar where a day count of 0 is Jan 1, year 1),
maybe adding some error detection to detect invalid dates, and print a
list of those presidents with their birthdate.

There are several things that you could expose them to that while they
are not directly related to C, you can still incorporate them into
"modern C programming". For example, one could incorporate doxygen as
a tool to learn documentation generation in the project. You give
them a partial structure for an API, they have to fill in the gaps in
the guts and documentation. You could do this for a simple container
like a linked list or resizable array.

You could have a refactoring project. You have a monolithic program
that you want your students to split into headers and source files,
maybe adding a makefile to the mix. Instead of using #define to
define input values, have the students convert it to accept user input
from the command line.

You can have them learn how to use a graphing library, like gnuplot.
The assignment could be to put in a simple equation like 2*sin(x),
evaluate the data over a given domain with a certain precision, then
either write a gnuplot file to display the data or use its C API.

You would know better than me how to limit the complexity to a
project, but maybe something here will inspire you.

Best regards,
John D.
 
Reply With Quote
 
Hans Vlems
Guest
Posts: n/a
 
      03-05-2012
On 5 mrt, 14:21, John Coleman <(E-Mail Removed)> wrote:
> Greetings,
>
> I teach math and computer science (though mostly math) at a small liberalarts college. Because of our smallness we don't have a huge course offering. To compensate, we have a grab-bag "special topics course" where we coverdifferent topics each semester based on student's and/or professor's interests.
>
> Next fall I will be running a special topics course with the title "Modern C Programming". The motivation for the course is that currently our CS students are exposed to C++, Java and a smattering of other languages (e.g. Lisp in an elective AI course) but no C per se. While in principle they learn some C naturally in the course of learning C++ they really don't learn all that much about things like pointers, malloc, and the safe handling of C-style strings and they definitely don't learn anything about C99. The proposed class is intended to give a serious introduction to C to students who have a working knowledge of either C++ or Java. This will allow me to blow through the basic syntax of expressions, loops, etc. in a couple of weeks and to spend the bulk of the semester on aspects of C which are different from Java and even C++.
>
> My question is - what would a good text be? My first tentative choice wasKing's "C programming: a modern approach", but I have also been looking atKochan's book "Programming in C". More recently I have been toying with the idea of using K&R. On the one hand that seems on the face of it like a poor choice for a course called *Modern* C programming. On the other hand - it *is* a classic and seems to hit the right level of difficulty (a course for students who already know at least one programming language). My main question is - does the merits of K&R outweigh the disadvantages of the lack of coverage of C99? I could of course supplement K&R by e.g. O'Reilly's "C Pocket Reference" which covers the C99 material. Where I'm at right now is that my heart says to go with K&R but my head says go with King (or Kochan).The bookstore wants a decision on my part sooner rather than later.
>
> Also - I am open to ideas about projects for the students to work on. Oneidea that I had was to concentrate on the Mandelbrot Set. Towards the beginning of the semester they could have a program which just prints to the command line e.g. with '*' for points in the set. Later on they could write it to a portable bit map text file. Even later they could write it to a .bmpfile in which they have to get the header and the byte-alignment correct. Finally, I could have them rewrite it in C99 with e.g. the complex-number type and *variable-length arrays so they don't have to hard-wire in the size of the bitmap. This topic of course reflects my interest as a mathematician. I have less ideas when it comes to straight computer-science applications (although Jacob Navia's idea about a hex-dump utility for pedagogical purposes caught my eye).
>
> Thanks in advance for any suggestions
>
> -John Coleman


Go for C and use King's book. Your heart may tell you to use K&R but
you're teaching a math class not history, right ?
If you want datastructures that have variable length, well use linked
lists of structures.
Hans
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controlling text in a Text Area or Text leo ASP General 1 12-05-2005 01:13 AM
Looking for a WPA bridge recommendation msnews.microsoft.com Wireless Networking 0 05-28-2005 03:11 PM
Wireless router recommendation... Fritz Wireless Networking 0 09-23-2004 07:50 PM
Product recommendation please. -keevill- Wireless Networking 1 09-03-2004 04:37 AM
Re: Need NAS recommendation =?Utf-8?B?TmV0d3Jrd29tYW4=?= Wireless Networking 0 07-24-2004 05:39 PM



Advertisments