Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror

Comment Learn the concepts and the languages will follow (Score 1) 537

Don't worry too much about learning a particular language. If you understand the core principles of good programming practice, you will be able to readily take advantage of the feature set of almost any good language.

In this regard, I think the best book to learn and reinforce the fundamentals of computer science would be Abelson and Sussman's Structure and Interpretation of Computer Programs.

http://mitpress.mit.edu/sicp/full-text/book/book.html

It uses the language called Scheme, which is a *very* slight variation of common lisp that is much simpler. Lisp is already a very simple language due to its regular syntax (sometimes thought of as "lack of syntax"), and yet it is wickedly powerful and succinct.

All this being said, if you *really* want to get the most mileage out of learning a particular language, learn C. It is the inspiration for the syntactic nuances of most new languages that have been created over the last 30 years. It has been the common-denominator-language that all software developers share.

Comment Re:Broken Algorithm BS (Score 1) 620

When you move to FP, all your algorithms break

If moving to a functional programming language breaks your algorithms, then you are somehow doing it wrong. That line doesn't even make sense to me. Algorithms are mathematical constructs that have nothing to do with programming paradigm. Assuming the language is Turing complete, how is that even possible?

For one thing, the implementation of your algorithms must change to compensate for the lack of destructive updates in the functional paradigm.

See "Purely Functional Data Structures" by Okasaki for more info.

In particular, your data structures must all become 'persistent' under the functional paradigm (as opposed to 'ephemeral' under an imperative implementation).

This means that, when you update a list or tree using the functional paradigm, you must create a copy of the original data structure that reflects the update, while keeping the original structure unchanged.

It sounds simple but in many cases this is not trivial.

For example, simple things like list concatenation, which in the imperative world can be done in O(1) time using pointers, is not so easily done under the functional paradigm. Concatenation of lists can only be achieved in O(1) *amortized* time using the functional paradigm and the Banker's Method, and this only after essentially representing the lists as trees and incorporating lazy evaluation in the algorithm design.

Slashdot Top Deals

All the simple programs have been written.

Working...