• Support PF! Buy your school textbooks, materials and every day products Here!

Need a good programming book

199
0

Main Question or Discussion Point

I am looking for a good book on something like parcel or C or soemthing in the same range of that. Any recomnedations
 

Answers and Replies

211
2
Many people would suggest learning C++ instead but if you have little or no experience in programming C is a good place to start. Besides C compilers are available on the web for free (I like Dev-C++).

If you plan to be self-taught I suggest "A Book on C" since it is designed for that, is well written, has very few errors and has answers to the exercises so you can actually learn and not just struggle. Good luck.
 
192
0
Go to the masters: Kernighan and Ritchie.
 
32
0
Yes, The C Programming Language by Kernighan and Ritchie is excellent.

Also, another good (free) C compiler to use is GCC (http://gcc.gnu.org.)

Cheers.
 
Last edited:
192
0
Another good book, though not on C or any other language in particular, is Cormen et al's Introduction to Algorithms.
 
181
1
Hmm... but K & R's C is very tough for the newcomers ....

I'd suggest:

"C how to program" - Deitel & Deitel.

For Pascal a very nice book:

"Pascal: Understanding Programming & Problems Solving"
- Douglas W.Nance

And for C++:
You can use Deitel's one or

"GNU C++ for Linux" - Tom Swan.

Hope it helps :)
 
33
0
I'm learning my first "real" programming language right now - Visual Basic. My teacher recommended I buy the book "Programming in Visual Basic 6.0", by Julia Case Bradley and Anita C. Millspaugh. I like it a lot so far. I will be learning Java in the spring and I have already bought a book on it. It is called "Java: An Introduction to Computer Science and Programming", by Walter Savitch.

VB:https://www.amazon.com/exec/obidos/tg/detail/-/0072420243/qid=1069046948/sr=1-1/ref=sr_1_1/102-3281250-7085752?v=glance&s=books
Java: https://www.amazon.com/exec/obidos/tg/detail/-/0131013785/qid=1069046875/sr=8-1/ref=sr_8_1/102-3281250-7085752?v=glance&n=507846
 
dduardo
Staff Emeritus
1,894
3
SDNess, why don't you learn c++ instead. It is a much powerful language in that you get direct memory access. POINTERS POINTERS POINTERS!!! Also there is no overloading of operators allowed in java. Arghh

Finally, "Java is not designed for computer-intensive applications that are critical in space and speed" - The Java White Paper
 
33
0
Well, I'm taking VB and Java in high school. They used to offer C++ up until last year, but the New York State curriculum has changed from C++ to Java. I am planning to learn C++ on my own though...out of a book probably.
 
dduardo
Staff Emeritus
1,894
3
It is pretty stupid of the school system to change from c++ to java. I think java is the most hyped programming language ever. It may be good for the web, but it isn't all that great at high proformance applications and low level development. Your not going to see the linux kernel written completely in java anytime soon. Garbage collecting wastes precious cpu cycles and used by lazy programmers that don't want to deallocate the memory that they allocate.
 
chroot
Staff Emeritus
Science Advisor
Gold Member
10,165
34
Originally posted by dduardo
It is pretty stupid of the school system to change from c++ to java. I think java is the most hyped programming language ever. It may be good for the web, but it isn't all that great at high proformance applications and low level development. Your not going to see the linux kernel written completely in java anytime soon. Garbage collecting wastes precious cpu cycles and used by lazy programmers that don't want to deallocate the memory that they allocate.
[devil's advocate mode]
I think C++ is the most hyped programming language ever. It's so loosely defined that many different compilers interpret the same constructs differently. Many people have just given up on the idea of standardizing it. It's also not that great at developing high performance applications, because it demands that every programmer be a master of algorithm and data structure design. Sure, it has the STL, but everyone knows it's one of the most obtuse general-purpose libraries ever designed. Besides, you remember all those standardization issues? Yeah, they apply to the STL, too. You're not going to see any large-scale scientific computing applications written entirely in C++ anytime soon. C++ also provides a lot of completely frivolous "features" that are misused 100 times more often than used. Pointer arithmetic is so low-level as to be entirely unnecessary, and many programmers abstract their data structures using tools like the STL to avoid human error anyway. Multiple inheritance has probably been used one or two times properly in the history of the language. The template construct is so syntactically challenging that most new programmers are terrified to use it (and therefore terrified to write REAL object-oriented code). Operator overloading is just a convenience, and it doesn't really help much -- you still have to invest the time to learn how each class's designer chose to use his operators, just like you'd have to read Java documentation to learn about each method. Huge vtables take up a lot of memory, and C++'s lack of garbage collection means that quite a lot of human resources are spent finding and removing memory leaks.
[/devil's advocate mode]

- Warren
 
Last edited:
181
1
Chroot, it seems that you are really hard on C++.
But from my point of veiw ...

For large scale software developement Java is the best solution.

And when you are going to develop any system software such as OS then you have to rely on C/C++.
 
dduardo
Staff Emeritus
1,894
3
It's so loosely defined that many different compilers interpret the same constructs differently.
Blame it on microsoft and their crappy compiler. GCC goes by the standard very well.

It's also not that great at developing high performance applications, because it demands that every programmer be a master of algorithm and data structure design. Sure, it has the STL, but everyone knows it's one of the most obtuse general-purpose libraries ever designed. Besides, you remember all those standardization issues? Yeah, they apply to the STL, too.
If you have a group of programmers working on high performance applications and they don't know fundamental algorithm and data structure design then you are in trouble. Why did you hire the morons in the first place.

I have to agree that STL is junk. All I say is Don't Use It. I don't think its that hard to program your own string, stack, lookup table structures. I've done it. I also don't think its that hard to create your own sorting algrothms etc.

Pointer arithmetic is so low-level as to be entirely unnecessary, and many programmers abstract their data structures using tools like the STL to avoid human error anyway. Multiple inheritance has probably been
Have you inspected the structures and algorithms supplied with java? Do you know if they are optimized and secure? This is why I write my own code in c++. Then whenever I need it I use my own algorithms.


Multiple inheritance has probably been used one or two times properly in the history of the language. The template construct is so syntactically challenging that most new programmers are terrified to use it (and therefore terrified to write REAL object-oriented code).
I'm sorry your not into polymorphism. I think its a great way to visually see a program. It might be daunting for new programmers but once you've got the hang of it, its a piece of cake.

Operator overloading is just a convenience, and it doesn't really help much -- you still have to invest the time to learn how each class's designer chose to use his operators, just like you'd have to read Java documentation to learn about each method.
And its a convenience that make code more readable. Its just dumb to have a function call like addthesetwonumbers(2,4). I would rather see 2+4.

Huge vtables take up a lot of memory, and C++'s lack of garbage collection means that quite a lot of human resources are spent finding and removing memory leaks.
garbage collection makes people lazy and they don't clean up after themselves. To handle memory leaks c++ programmers have applications like memory profiler to locate such problems.
 
chroot
Staff Emeritus
Science Advisor
Gold Member
10,165
34
Originally posted by dduardo
Blame it on microsoft and their crappy compiler. GCC goes by the standard very well.
Okay... I just have to. What standard?
If you have a group of programmers working on high performance applications and they don't know fundamental algorithm and data structure design then you are in trouble. Why did you hire the morons in the first place.
Why should I have to pay for experts? Why shouldn't I remove some of that burden from programmers? Why should cars have power windows and turn signals when you can roll the window down and stick your arm out?
I have to agree that STL is junk. All I say is Don't Use It. I don't think its that hard to program your own string, stack, lookup table structures. I've done it. I also don't think its that hard to create your own sorting algrothms etc.
Why would you want to do this? Why should every programmer have to go write his own basic algorithms and data structures when Knuth has already done all the work? Why shouldn't a language provide those tools?
Have you inspected the structures and algorithms supplied with java? Do you know if they are optimized and secure? This is why I write my own code in c++. Then whenever I need it I use my own algorithms.
Of course I've looked at the source! Sun provides it with every distribution of the JDK.
I'm sorry your not into polymorphism. I think its a great way to visually see a program. It might be daunting for new programmers but once you've got the hang of it, its a piece of cake.
When did I say I wasn't into polymorphism? Surely you realize multiple inheritance != polymorphism?
And its a convenience that make code more readable. Its just dumb to have a function call like addthesetwonumbers(2,4). I would rather see 2+4.
Can you list the number of times in practice that you've seen operator overloading done so well in a class that you immediately understand what every operator did?
garbage collection makes people lazy and they don't clean up after themselves. To handle memory leaks c++ programmers have applications like memory profiler to locate such problems.
I could argue that garbage collection makes them better programmers, since they can produce cleaner code faster. The ultimate arbiter of success is not how bloody your knuckles are when you're done -- it's how much money is in your pocket. And you're suggesting that instead of taking a (literally) negligible performance hit from a thread automatically reclaiming unreferenced objects (usually done when the program is waiting for input), you'd rather purchase a profiler and pay to educate all your staff on its proper use?

Sounds like you enjoy bloodying your knuckles. I prefer to line my pockets.

- Warren
 
dduardo
Staff Emeritus
1,894
3
Ok, this is just like a windows versus mac or religion versus science war. You program with what your comfortable and I program with why i like. Use the tool that gets the job done.

By the way, I use open source tools. MemProf comes bundled with redhat.
 
Originally posted by dduardo
Finally, "Java is not designed for computer-intensive applications that are critical in space and speed" - The Java White Paper
what years was that?

Although I admit that C(++) works faster that Java for now, Java is a lot easier to learn and there's talk of processors that can support directly Java instructions so speed will not be a problem in the near future

Grimmus: I have a lot of programming books in html and pdf. If you're interested in a list PM me.
 
selfAdjoint
Staff Emeritus
Gold Member
Dearly Missed
6,764
5
No kidding

there's talk of processors that can support directly Java instructions so speed will not be a problem in the near future
Kind of defeats the purpose of Java, doesn't it, since that language was designed to be processor independent. That was its great announced strength.
 
Re: No kidding

Originally posted by selfAdjoint
Kind of defeats the purpose of Java, doesn't it, since that language was designed to be processor independent. That was its great announced strength.
there's still gonna be JVM for the processors that doesn't support Java:smile:
 
Free Compilers are good,... but

THERE IS A REASON THEY ARE FREE!!! AND IS BECAUSE THEY CAN'T COMPILE WIN32 C++!!! ONLY CONSOLES C++ programs!!!

So why waiste your time learning C++ when you can't write in Win32? Nobody uses Console anymore anyways, the GUI is the problem --> Looks stupid.

So get VC++ 6 Professional and start writing real apps!
 
33
0
Actually I've been wanting to know this for a while...

What is Win32 programming?
 
Hurkyl
Staff Emeritus
Science Advisor
Gold Member
14,843
17
All right, polarization! Must... contribute... my two cents...

Let's start with the easy issue:

THERE IS A REASON THEY ARE FREE!!! AND IS BECAUSE THEY CAN'T COMPILE WIN32 C++!!! ONLY CONSOLES C++ programs!!!
mingw.

Anyways, win32 isn't the entire world. Not everything has to be (or even should be) a GUI.

I have MSVC++ 6.0 on my computer and I still write command line programs, which I compile with gcc. The editor and help database is nice, though.

(And yes, command line tools are important at my workplace too)


Ok, onto C++ vs Java.

Inlining is great for writing performance code. C++ does it. Java doesn't.

Templates are great because they allow further expressiveness with inlinability, but are unfortunately still just a hack with little language support. Someone needs to write a new language that does templates right, yet retains the speed of C. :smile: (I've done very little Ada, but have heard it does something similar; how does it compare?)

iostreams are great

Java does bounds checking for every array access. Great for security and detecting errors, bad for performance code. Java will never catch up to C/C++ for numerical applications involving frequent array accesses without either some seriously clever technology (either in compilers, hardware, or both) or throwing away security.

Java frees you from memory management, but in doing so it distances you from memory management. Great for security, makes it easier to code, but bad for performance. Java applications will typically eat up more memory and have worse memory fragmentation, inflicting overhead beyond the garbage collector. There are no local objects in Java, which is also bad for performance and locality without either a clever compiler or a lot of effort to work around this fact.

Java has a lot of standard libraries. I bet java would have been less popular if C++ had all of those libraries standard as well. :smile:
 
Originally posted by PrudensOptimus
So get VC++ 6 Professional and start writing real apps!
oh, brother, Bill Gates strikes again.......
 
selfAdjoint
Staff Emeritus
Gold Member
Dearly Missed
6,764
5
Nine times out of ten you don't need all the special complications of C++, and they slow you down. I've seen developments in C++ that took six months when they could have been done in VB or SAS in a couple of weeks. Sure it's "tighter code" but who cares? Only if you're running some server that gets millions of hits a day does the efficiency factor make any difference.
 
dduardo
Staff Emeritus
1,894
3
I was looking up gcc optimizations today and came across this library for garbage collecting made by some guy over at Hewlett Packard.

http://www.hpl.hp.com/personal/Hans_Boehm/gc/

Now you java people can't complain that c++ doesn't have garbage collecting.
 
43
1
Personally, I think C is an awful choice for a beginning computer language. I also don't like C++ or Java as pedagogical tools, but for different reasons. The most important thing a programmer does is to reason about problems and algortithms. This skill is not inherent in people and it must be taught and practiced. What is needed to teach this skill is a language with a very simple syntax and enough high level facilities that re-inventing the wheel doesn't get in the way of learning how to use basic and universally applicable concepts like iteration, recursion, and data abstraction.

To that end, I suggest Scheme, with a textbook like Structure and Iterpretation of Computer Programs. The sytax of scheme is utterly trivial, so you can concentrate on formulating algorithms, without getting hung up on syntactic idiosyncracies of a specific language. I think MIT, and those who have followed their lead, have it right in using Scheme.

If you must go the imperative language route, then I would suggest Python, which also has a very clean syntax and offers very high level constructs for data abstraction.
 

Related Threads for: Need a good programming book

  • Last Post
Replies
6
Views
3K
  • Last Post
Replies
7
Views
2K
  • Last Post
Replies
16
Views
5K
  • Last Post
Replies
1
Views
14K
  • Last Post
Replies
1
Views
3K
Replies
6
Views
4K
  • Last Post
Replies
1
Views
1K
Replies
2
Views
4K
Top