What are the benefits of using Scheme/Lisp for programming?

In summary, the conversation discusses recommendations for good books on programming languages such as C, C++, Pascal, and Java. Some suggest learning C++ instead of C, while others recommend starting with C for beginners. Various books are mentioned, including "A Book on C", "The C Programming Language" by Kernighan and Ritchie, "C How to Program" by Deitel & Deitel, "Pascal: Understanding Programming & Problem Solving" by Douglas W. Nance, "GNU C++ for Linux" by Tom Swan, and "Java: An Introduction to Computer Science and Programming" by Walter Savitch. The school curriculum is also discussed, with some arguing for the use of Java while others criticize it for its limitations in
  • #1
The Grimmus
200
0
I am looking for a good book on something like parcel or C or soemthing in the same range of that. Any recomnedations
 
Physics news on Phys.org
  • #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.
 
  • #3
Go to the masters: Kernighan and Ritchie.
 
  • #4
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:
  • #5
Another good book, though not on C or any other language in particular, is Cormen et al's Introduction to Algorithms.
 
  • #6
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 :)
 
  • #7
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:
Java:
 
  • #8
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
 
  • #9
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.
 
  • #10
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.
 
  • #11
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:
  • #12
Chroot, it seems that you are really hard on C++.
But from my point of veiw ...

For large scale software development 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++.
 
  • #13
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.
 
  • #14
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
 
  • #15
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.
 
  • #16
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.
 
  • #17
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.
 
  • #18


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 going to be JVM for the processors that doesn't support Java:smile:
 
  • #19
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!
 
  • #20
Actually I've been wanting to know this for a while...

What is Win32 programming?
 
  • #21
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:
 
  • #22
Originally posted by PrudensOptimus
So get VC++ 6 Professional and start writing real apps!

oh, brother, Bill Gates strikes again...
 
  • #23
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.
 
  • #24
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.
 
  • #25
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 http://mitpress.mit.edu/sicp/. 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.
 
  • #26
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
 
  • #27
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.
 
  • #28
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.
 
Last edited:

1. What are the top programming books recommended for beginners?

Some of the top programming books recommended for beginners include "Code Complete" by Steve McConnell, "Clean Code" by Robert C. Martin, "Head First Java" by Kathy Sierra and Bert Bates, "The Pragmatic Programmer" by Andrew Hunt and David Thomas, and "Eloquent JavaScript" by Marijn Haverbeke.

2. What are the key factors to consider when choosing a programming book?

Some key factors to consider when choosing a programming book include the language or technology you want to learn, the level of detail and structure in the book, the author's credibility and expertise, and reviews from other readers.

3. Are there any free programming books available?

Yes, there are many free programming books available online. Some popular resources for free programming books include GitHub, FreeCodeCamp, and OpenLibra. You can also find free eBooks on various programming topics on websites like Amazon and Google Books.

4. What is the best programming book for learning a specific language or technology?

The best programming book for learning a specific language or technology will vary depending on personal preferences and learning styles. Some popular choices for specific languages include "Introduction to Algorithms" by Thomas H. Cormen for learning algorithms and data structures, "JavaScript: The Good Parts" by Douglas Crockford for learning JavaScript, and "Learning Python" by Mark Lutz for learning Python.

5. Can I use programming books as my only resource for learning?

While programming books can be a valuable resource for learning, they should not be your only resource. It's important to supplement your learning with hands-on practice, online tutorials, and other resources such as video tutorials, coding challenges, and forums. This will help you gain a well-rounded understanding of the language or technology you are learning.

Similar threads

  • Science and Math Textbooks
Replies
7
Views
522
  • Science and Math Textbooks
Replies
16
Views
1K
  • Science and Math Textbooks
Replies
4
Views
972
Replies
4
Views
689
  • Science and Math Textbooks
Replies
4
Views
949
  • Science and Math Textbooks
Replies
14
Views
3K
  • Science and Math Textbooks
Replies
4
Views
474
  • Science and Math Textbooks
Replies
2
Views
204
  • Science and Math Textbooks
Replies
6
Views
1K
  • Science and Math Textbooks
Replies
5
Views
1K
Back
Top