views:

723

answers:

11

I have a compiler book, Compilers, and an operating systems book, Operating System Concepts. I have read some of both and, eventually, I plan on completing both. However, for right now, I would like to pick one of them to focus on. I want to read something that will help me develop some good practical skills, via exercises, small projects and what not. I get the impression that the Dragon Book would give me more to play with, but I'm wondering a little about what I might not know.

Both topics sound important, but does one have more benefits or practical gain than the other? Which, if either, helped you understand yourself more as a programmer and what you do?

+2  A: 

I would say you are more likely to write a parser than an operating system.

However, if you like playing around with the OS and writing drivers, then OS would be fun for you.

Unknown
I'm not so sure....if you end up working in the embedded system space, you're far more likely to write pieces of an OS than a parser (or even a LLVM backend or what have you)
Ben Collins
@ Ben, I write parsers all the time for console apps, though obviously they aren't all full blown context-sensitive grammar parsers. I highly doubt the number of people working with embedded systems would outnumber that.
Unknown
we may have to agree to disagree then. I have yet to encounter *any* situation in my professional career that required me or anyone I worked with to write a parser for any reason. The closest I've come is writing a yacc grammar for some trivial data structure format. I would say at this point, if you actually need a custom parser for something, writing it yourself is almost foolish, given the wealth of well-understood tools for that kind of thing.
Ben Collins
@ Ben, what about regular expressions? You've probably used that which would be helpful to learn about the underlying theory behind them.
Unknown
+8  A: 

I think either one would be of great benefit, but in different ways:

studying OS implementations will lend you greater understanding of architecture, memory hierarchies, and computer systems

studying compilers will probably give you better exercise of classical algorithms

Ultimately, though, the two intersect - compiler writers wind up having to understand architectures very well, and sometimes have to know the ins and outs of their targeted operating system.

If I had to go back and do it again, even after having experience as a professional, I'd probably choose compilers, but I think it would be a close decision. Both is better :-)

Ben Collins
A: 

Both of the books seem to be very good read. But since you are hesitating just ask yourself which is more entertaining and more fun to read. Make your choice and study the book.

SeasonedCoder
+4  A: 

I've done far more with compilers - multiple - than with actual operating system development, but understanding the operating system and operating system concepts is crucial to making good use of it in applications.

You don't have to understand everything about the internals of the operating system, but understanding the services provided and knowing enough about how it is implemented helps a lot. I'd suggest understanding operating systems is probably the more important - but both are important.

It also depends on where you see yourself working in future. Compilers are a relatively specialized topic - you will most likely use many more than you develop or maintain (but the same is true of operating systems too). Operating systems are, in many ways, even more esoteric than compilers.

Finally, it also depends on how much knowledge you already have. Compilers are generally simpler than operating systems. Not much simpler - and a good optimizer is really tough to write. It used to be that compilers don't have to deal with concurrency whereas operating systems do - that is now an over-simplification since some compilers do need to deal with multi-threading code on multi-core chips and understanding how the program will exploit concurrency (or not) at run-time. But the compiler itself still tends to be substantially a sequential process - unlike an operating system. If, on the other hand, you have a decent knowledge of stuff like memory management, disk allocation, threads, etc, then maybe you'd find the operating system more accessible than parts of the compiler.

Jonathan Leffler
+5  A: 

Operating systems are an endless playground to learn the ins/outs of programming. Every where you look there is something to be learned and the OS is an exhibit of the absolute fundamentals of programming.

Whether it's learning about I/O, Scheduling, Processes, Threads, Parsing, etc... an OS can show you the world. Therefore, I would recommend the OS book as it will give you the most practical skills. Doing this, you'll ultimately learn the foundational skills necessary to build compilers.

Scott Saad
+2  A: 

Understanding Compiler theory in-depth is very important in conceptually analyzing and solving many computing problems.

Understanding OS is also essential to correctly implement the solution.

Learn them both. I always regret for not paying attention to both of them earlier in my career.

Updated: If you are picking which is the first to study, then I'd rather vote for Compiler. I personally have more fun working in conceptual domain. And recent advancement in computing allow most of the problems to be solved without dealing with too many details.

Sake
+1  A: 

Operating System Concepts is a foundation for everything you will ever see, hear, touch, smell or taste around software and hardware. So here is your answer.

The compiler book should be later in line and not necessarily next - you will learn a lot from it but it is not necessarily must-know for being a good programmer.

grigory
I forgot everything you breathe too but you got the point :-)
grigory
A: 

If I had the books (actually I've) I will first finish the operating systems one first because this will give me more insight into how the underlying things work. Knowledge of Compilers and Assembly Language is very important if you want to become a programmer.

I've read both but why I'm not a good programmer :'(

TheVillageIdiot
+1  A: 

I'd go with compilers first, followed by system architecture (CPU, ASM, MMU, DMA, and a few more TLSs), then OSs

For the stuff I like doing, the interaction with the compiler and the machine it's self is a lit more important than with the OS.

BCS
A: 

Should you study operating systems or compilers? yes.

Henrik Paul
+1  A: