# Linux/Freebsd programming



## twantnix3 (Sep 18, 2009)

If I get the Linux Programming book by Wrox publishing. can I use, say, at least 80% of that for freebsd or more/less?


----------



## phoenix (Sep 18, 2009)

Depends.  Are you wanting to write programs to run on FreeBSD (userland apps)?  Or are you wanting to write things in kernel space (drivers, daemons, services, etc)?

For kernel programming, the book would be useless.

For userland programming, some parts may be useful.  But I doubt more than 50%.


----------



## twantnix3 (Sep 18, 2009)

userland.


----------



## Alt (Sep 18, 2009)

I think about 80% is useful =) And if you use only posix-compliant functions its must be near 100


----------



## graudeejs (Sep 18, 2009)

A little off topic, but I have "Advanced Programming in the Unix Environment" 2nd edition by W.Richard Stevens and Stephen A.Rago
Addison-Wesley

This is great book for userland programming bough on Linux and FreeBSD.
It talks about Posix and Single unix specification all the time...
And tells what things are different on all 4 platforms (Linux, FreeBSD, MacOsX 10.3 and Solaris 9)

I totally love this book, and would recommend to take a look at it


----------



## twantnix3 (Sep 18, 2009)

killasmurf86 said:
			
		

> A little off topic, but I have "Advanced Programming in the Unix Environment" 2nd edition by W.Richard Stevens and Stephen A.Rago
> Addison-Wesley
> 
> This is great book for userland programming bough on Linux and FreeBSD.
> ...




its really not, i was wondering if there was a book like that


----------



## LateNiteTV (Sep 18, 2009)

i have the same book (advanced programming in the unix env.) and i recommend it.
youre going to need to have some prior knowledge of c.


----------



## twantnix3 (Sep 18, 2009)

LateNiteTV said:
			
		

> i have the same book (advanced programming in the unix env.) and i recommend it.
> youre going to need to have some prior knowledge of c.



would C in 21 days help me?


----------



## ckester (Sep 19, 2009)

twantnix3 said:
			
		

> would C in 21 days help me?



For learning C, there's really nothing better than the original: The C Programming Language by Kernighan and Ritchie.  

In my opinion, if the K&R book doesn't make sense to you, or if you find it too difficult, you're probably not cut out to be a C programmer anyway.

Oh, and add me to the list of people recommending the Stevens and Rago book.  It's not the sort of thing you sit down and read straight through, but it's definitely something you'll want nearby when you're programming for any Unix platform.


----------



## twantnix3 (Sep 19, 2009)

ckester said:
			
		

> For learning C, there's really nothing better than the original: The C Programming Language by Kernighan and Ritchie.
> 
> In my opinion, if the K&R book doesn't make sense to you, or if you find it too difficult, you're probably not cut out to be a C programmer anyway.
> 
> Oh, and add me to the list of people recommending the Stevens and Rago book.  It's not the sort of thing you sit down and read straight through, but it's definitely something you'll want nearby when you're programming for any Unix platform.



the K&R book doesn't go over C99, because it's ann older book.  I have it, but prefer to use an more updated book.


----------



## fonz (Sep 20, 2009)

ckester said:
			
		

> For learning C, there's really nothing better than the original: The C Programming Language by Kernighan and Ritchie.


You program in C, you buy this book. It's that simple.

There are some differences between the C89 this book describes and recent standards, but the differences are nowhere near significant enough to invalidate this book as a learning source.

Alphons


----------



## ckester (Sep 20, 2009)

Learning C is more than just learning the syntax.  It's also about learning a programming style.  K&R teaches the Unix style, which imo is the *correct* style.


----------



## trev (Sep 21, 2009)

ckester said:
			
		

> In my opinion, if the K&R book doesn't make sense to you, or if you find it too difficult, you're probably not cut out to be a C programmer anyway.



A tad harsh. I've not seen the latest incarnation of the K&R book, but the one around when I was learning C in the early 80s was terse , obtuse and rarely recommended for beginners.


----------



## bigearsbilly (Sep 28, 2009)

If you are talking "beginning linux programming"
mathew & stones
I've got it. (as well as K&R, and stevens of course)

yes, it will be fine.
In my view it's an excellent book. not as novice as the
"beginning" would imply.
it's not just C, it's an excellent whistle stop tour of unix, terminals, curses, shell, perl, sockets, threads all done in an intelligent style with good examples to get you up and running.

one of my favourite books.


an example chapter


----------



## ckester (Sep 29, 2009)

trev said:
			
		

> A tad harsh. I've not seen the latest incarnation of the K&R book, but the one around when I was learning C in the early 80s was terse , obtuse and rarely recommended for beginners.



Really?  I learned C in the early 80's too and my recollection is the opposite of yours.

FWIW, most of the really good C programmers I've known over the years consider terseness a virtue.  You're the first person I've ever seen call that out as a failing of the K&R book.  

I don't think K&R is too terse, and I certainly don't think it's obtuse.

I stand by my original comment.  If the K&R book isn't your cup of tea, perhaps you're not cut out to be a C programmer in the first place.  The virtues (and yes, the failings) of the book are shared by the language and the programming paradigm it embodies.


----------



## Eponasoft (Sep 29, 2009)

Not everyone learns the same way. When I first tried learning C, I tried from a theory point of view which got me nowhere. I needed practical examples; things that were useful and pertained to my area of expertise. The white bible isn't the most beginner-friendly book, but that's not really a surprise; computer language developers are not always good at writing at the layman level. It's good for once you've got a grasp of the concepts already, but not everyone can handle it at first. In that case, there are other books that can help. Greg M. Perry, for example, writes books that are a bit more beginner-friendly, such as the "Absolute Beginner's Guide to C" and "C by Example". His "C Programming in 12 Easy Lessons" is the book that I have, and it helped a LOT when I couldn't grasp C.


----------



## LateNiteTV (Sep 29, 2009)

oreilly has a book called Practical C Programming. 
its a pretty good book for learning the basics.


----------



## Eponasoft (Sep 30, 2009)

Seems to have some mixed reviews but overall looks like it might be useful.


----------



## naikon (Sep 30, 2009)

+=1 on K&R book and APUE.
These really are the only two books you will need.

Skill comes with practice


----------

