Hot answers tagged

40

Eventually, I thought you will become a better programmer knowing this because you'll know what's happening rather than assuming that everything is magic. These are not contradictory things. I have no idea how to pave a road, but I know that it is not magic. But a month ago, I came across this book called Structure and Interpretation of Computer ...


32

I know why abstraction is great, but doesn't that prevent you from learning how computers work? Certainly not. If you want to understand the abstractions at work, then study those abstractions. If you want to understand the low-level technical details of a real, physical, computer then study those details. If you want to understand both, study both. (In my ...


22

No, abstractions don't prevent you from understanding how things work. Abstractions allow you to understand why (to what end) things work the way they do. First off, let's make one thing clear: pretty much everything you've ever known is at a level of abstraction. Java is an abstraction, C++ is an abstraction, C is an abstraction, x86 is an abstraction, ...


16

A key skill in programming is simultaneously thinking at multiple levels of abstraction. Another key skill is building abstractions; this skill uses the previous one. Low-level programming is valuable in part because it exercises and expands both these skills. SICP models and implements interpreters, simulators for a machine model, and a compiler to that ...


14

In my first year at the university the first programming course I took was using SICP (that was 1988). However, I had a similar problem like you: for my own computer (actually a Commodore Amiga), there was no Scheme implementation available at that time, only a different Lisp dialect (I don't remember its name). However, given the flexibility of Lisp, it ...


10

In that section of the book, filter, map, and enumerate-interval are presumed to return sequences, which are conceptually distinct from lists. You can implement sequences using streams, for example, though you can implement sequences using lists too. So, in this case, the accumulate with cons is to convert the sequence to a list.


9

I'm not so sure I believe these people. I've gone through SICP and the biggest blocker you'll run into is how call-with-current-continuation (call/cc) is implemented. While MIT-Scheme is officially endorsed, there are a few downsides to MIT-Scheme Old Unmaintained as far as I can tell Pretty mediocre environment/repl Not so great errors On the other hand ...


8

Yes, but it's not as hard of a constraint like physical constraints in other engineering disciplines. Memory usage, processor power, hard disk space, network speed, and more are constraints. However, there are two considerations. First, they are easily expanded. You can add additional resources or distribute the problem across multiple nodes or upgrade ...


7

The purpose of a dictionary is to return a value given a specified key, not to serve as a sequential container. Just because other data structures are sequential but dictionaries are not does not mean that the benefits of sequences are invalidated. Sequences are one of the three fundamental logic structures in computing. Every (solvable) computing problem ...


6

Essentially with tail recursion, the problem with recursion in general is that you each function call gets it's own stack frame. In this stack frame you store all your local variables and whatnot. So if you run a function like int fact(int n){ if(n == 0) return 1; return n * fact(n-1); } fact is called n times, allocating n ...


5

SPJ has written two books with very similar titles: The implementation of functional programming languages, Simon Peyton Jones, Prentice Hall 1987. Implementing functional languages: a tutorial, Peyton Jones and Lester. Both are available here. The second one is more focused on compiling and executing code, including G-machines in Chapter 3. Quoting its ...


5

I know why abstraction is great, but doesn't that prevent you from learning how computers work? Am I missing something? Go to a magic show and you'll be entertained but you won't understand how the tricks work. Read a book on magic and you'll learn how tricks work but you still won't be entertaining. Do both. Work hard. And you might be both. I'ved ...


4

Aren't the above situations just as challenging as physical constraints talked about in the video? They can be, but for most developers and projects, they aren't. Some software is written with serious, hard restrictions on speed, memory, space, etc. If you are writing the software for the space shuttle guidance computer, where you have a specific task to ...


4

Have an abstract base class and two concrete derived classes. You didn't tell us what is different, but only said "their implementations are almost the same with each other". Let's assume the database name is the only difference: abstract class Model_base { public function insert($tableName, $columns, $preds = null) { $db = $this->getDB(); ...


3

Software engineering has multiple levels of detail. Your question is "what is the most rewarding, worthy, interesting level?" It depends on your task or on what you want to be, what you care about. For big systems you should not care much about bit shifting and clock cycles. For embedded software running on a simple micro controller you will probably want ...


3

The abstractions we teach in computer science are the things which, historically, have been found most beneficial to most people writing most programs. You can't write a modern program in assembly, just due to the sheer size of modern programs and the time constraints business will place on a developer. You have to be ready to accomplish your goals without ...


3

What time is it? Is it time to become a know-it-all programmer or is it time to become a productive programmer? Knowing the abstraction layers that exist below those among which you work is a good thing, it grants you a better understanding behind the structure of your work and it will even allow creating better solutions. Yet, you do that, you study when ...


2

Difficulty varies from person to person. I've read SICP, Art of Computer Programming, and Intro to Algorithms and I found them easy - however, I had a great teacher in all my classes, a lot of support from other students and teaching fellows as well as help online. Furthermore, I've always loved both math and computer programming, and I excel in those ...


1

Your quote is still true today: Dealing with large numbers of interrelated types while still preserving modularity in the design of large systems is very difficult, and is an area of much current research. Programming very large object oriented systems -- thus with more and more interrelated classes and dependencies -- caused mainstream language to ...


1

Abstractions are necessary to manage complexity, which is the Nemesis of all programmers. It's just as important to learn using abstractions as it is to learn the details behind them. A solution to a real-world problem needs to have a representation that closely resembles the model of the problem. It's why a dice game has a class called Die with a method ...


1

You might like to read Zen and the Art of Motorcycle Maintenance which addresses this very question. The conclusion that it arrives at is that you should aim to generate the greatest 'Quality' at the level(s) of abstraction that you choose. Sometimes this means understanding more about the levels above and below you, but generally you won't be able to master ...


1

On the other end of the spectrum is another book that often gets praised as a classic of how to teach algorithms: Donald E. Knuth’s Art of Computer Programming. DEK gave all his algorithms in a (fake, abstracted) machine language, because in his view, programmers will tend to write code that’s simple and efficient in the language they’re using, and the size ...


Only top voted, non community-wiki answers of a minimum length are eligible