Register to reply

Need a good programming book

by The Grimmus
Tags: book, programming
Share this thread:
PrudensOptimus
#19
Nov27-03, 09:26 PM
P: 640
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!
SDNess
#20
Nov27-03, 10:39 PM
SDNess's Avatar
P: 33
Actually I've been wanting to know this for a while...

What is Win32 programming?
Hurkyl
#21
Nov27-03, 11:07 PM
Emeritus
Sci Advisor
PF Gold
Hurkyl's Avatar
P: 16,099
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. (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.
Guybrush Threepwood
#22
Nov28-03, 03:13 AM
Guybrush Threepwood's Avatar
P: 527
Originally posted by PrudensOptimus
So get VC++ 6 Professional and start writing real apps!
oh, brother, Bill Gates strikes again.......
selfAdjoint
#23
Nov28-03, 04:09 PM
Emeritus
PF Gold
P: 8,147
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
#24
Dec5-03, 05:33 PM
Emeritus
dduardo's Avatar
P: 1,919
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.
BigRedDot
#25
Dec7-03, 03:34 PM
BigRedDot's Avatar
P: 46
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.
chroot
#26
Dec7-03, 03:44 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,429
Ugh. Scheme/Lisp. Yeah, the syntax is trivial -- but when you're trying to figure out which of your 10,000 parentheses belongs to which of the other 10,000, it's a total nightmare.

- Warren
lethe
#27
Dec7-03, 04:10 PM
lethe's Avatar
P: 657
Originally posted by chroot
Ugh. Scheme/Lisp. Yeah, the syntax is trivial -- but when you're trying to figure out which of your 10,000 parentheses belongs to which of the other 10,000, it's a total nightmare.

- Warren
i like scheme... true, i never had to do anything useful with it....

prolog was also a really cool language, that i suspect would be hard pressed to find a use outside a CS dept.
BigRedDot
#28
Dec7-03, 05:44 PM
BigRedDot's Avatar
P: 46
Ugh. Scheme/Lisp. Yeah, the syntax is trivial -- but when you're trying to figure out which of your 10,000 parentheses belongs to which of the other 10,000, it's a total nightmare.
Matching a few levels of parenthesis is hardly as difficult as your exaggeration suggests, even without a decent paren-balancing editor. With such an editor (and come on, even vi can do this), it's a complete non-issue.

As for utility. Of the top of my head, one interesting program I've seen (in Lisp, not Scheme) was in Guy Steele's book. It accepted arbitrary complex mappings as input and generated postscript output that showed how an initial, preset shaded annular pattern was transformed under the mapping. Oh, and it was all only about 6 pages of code.

The point is to have a very expressive language, so that you can bring the language up to the level of the problem at hand. The closer you can work to the actual problem, and the less you have to muck about translating things down to the level of the machine, the more likely you are to not screw up. After all, what do pointers and shared memory and heap management have to to with runing a hospital, or managing financial transactions, or modeling physical processes? Answer: nothing at all.


Register to reply

Related Discussions
Any good programming challenge using the c language. Programming & Computer Science 12
Good books for systems programming Computing & Technology 5
Good Online Programming Contest(C/C++) Computing & Technology 1
Need a good book... General Physics 1
Good Book? Linear & Abstract Algebra 1