Code

Charles Petzold

Mentioned 24

A discussion of the history and future of coding theory celebrates the ingenuity of language systems and their uses from Braille and Morse code through binary codes to 32-bit operating systems.

More on Amazon.com

Mentioned in questions and answers.

This is a poll asking the Stackoverflow community what non-programming books they would recommend to fellow programmers.

Please read the following before posting:

  • Please post only ONE BOOK PER ANSWER.

  • Please search for your recommendation on this page before posting (there are over NINE PAGES so it is advisable to check them all). Many books have already been suggested and we want to avoid duplicates. If you find your recommendation is already present, vote it up or add some commentary.

  • Please elaborate on why you think a given book is worth reading from a programmer's perspective.

Note: this article is similar and contains other useful suggestions.

How to Win Friends and Influence People

by Dale Carnegie

How to Win Friends and Influence People

Although this was first published in 1936, the advice contained within is still as fresh and appropriate as ever. Don't be put off by the name. This isn't some underhand guide to having your way with unsuspecting victims, but rather common sense advice on how to get on with people, how to nurture relationships and make the most of yourself and your fellow man (and woman).

It is well known that technical folk (including programmers) are often thought of as not being terribly 'people oriented' (whether this is a justified stereotype or not is subject of another discussion) and so this book is an invaluable resource for teaching you the finer points of human interaction.

It's warm, heartfelt, sturdy, straightforward and timelessly written. Highly recommended.

The Goal: A Process of Ongoing Improvement

by Eliyahu M. Goldratt and Jeff Cox

To elaborate: It is a book on how to approach problems. To identify bottlenecks in your system and work on them. So in short, it isn't a programming book, but shows (in novel format) how to problem solve -- and is thus very valuable to a programmer.

[Update Gishu] It's an eyeopener on how the throughput of your entire system depends on the bottlenecks. Optimizing other stages/operations will not produce any results. Although this is ingrained in developers who have had experience optimizing a scenario in their app; however zooming out to a more higher level and applying this can have profound gains. Beck's XP Book has a dedicated chapter on the Theory Of Constraints. Programmers who move onto Leads/PMs will find this a valuable addition to their toolkit.

Surely You're Joking, Mr. Feynman!

alt text

This book will inspire anyone to think and be original.

This might not be a popular one, but

Gravity's Rainbow

by Thomas Pynchon

Gravity's Rainbow

Gravity's Rainbow is my favorite book of all time. I read through the whole thing last summer, and I'm in the process of reading it again. From a writer's point of view, it's pure, beautiful art. However, I recommend it here because it really forces the reader to think and make a lot of mental connections.

Of course, this book has a reputation for being impossible to finish. It's definitely the hardest book I've ever read. Pick it up at your own risk.

Don't Make Me Think by Steve Krug. An essential book about web usability. As Krug says, "Common sense isn't always obvious."

alt text

(Hint: Amazon.com has good usability)

Update: This is now part of the library at work. I've gotten about five people to read it so far. 100% positive reviews, predictably.

Here's a strange one for you all to think about.

On The Road by Jack Kerouac.

It's a modern classic that everybody should read, and I'd be very surprised if English or Media Studies students weren't recommended to read it at some time. Reading should not only be informative and educational, but enjoyable as well. If you're not going to read a book for pure fun now and again then you'll only end up frustrated with the books you need to read as a programmer/developer.

This book is a real eye-opener; a book that'll really make you think about your own life, and for a programmer whom spends their day dealing with pure thought-stuff it's a great way to get you thinking on a different track.

I would heartily recommend Jennifer Government to any software developer. Amazon Wikipedia

It's a very fast paced action story that's excellent to clear your head with. It's a fun book to read (will make you laugh), and the characters are rather tragic (will make you feel more satisfied at work). This is one of those books that is hard to explain the content without fear that people will think you different and odd, but all the same you must tell everyone about (I.e. makes you talk to people).

The Humane Interface by Jef Raskin.

You can see some of the effects of these ideas in Aza Raskin's (Jef's son) Enso project and the Ubiquity Firefox add-on.

Kicking the Sacred Cow

Questioning the Unquestionable and Thinking the Impermissible

by James P. Hogan

alt Kicking the Sacred Cow

Masters of Doom !!

God programmer meet God marketing guy, and no it's not Steve Woz and Steve Jobs, but it's the Johns, Carmack and Romero.

Business, gaming and programming all rolled into one. a definitely page turner all the way until the end.

The Mythical Man-Month

by Fred Brooks

The Mythical Man Month

My personal opinion is, apart from programming, in life we need to find a balance, about everything (or keep striving for it). Many times, I have found myself getting too immersed in one aspect of life (frequently programming/work) at the cost of others. Over the years I have learnt to recognize this and act accordingly.

In work, sometimes I have come across pretty difficult people, making it hard to work with them (not just my opinion, but also of other team members). Previously I used to try hard to convince them, make them more helpful, etc. and get frustrated when I don't succeed.

But this book Tigana, by Guy Gavriel Kay helped me understand that sometimes a person can be inherently complex, hard to work with, without he/she helping it. It is a science fiction novel, and it may not be completely appropriate here, but it helped me work better with my team, so I am linking to it here. It helped me become more objective in dealing with people I work with.

-Omer

Jeffrey K. Liker - The Toyota Way (Amazon link). A good if at times semi-boring read, but loads of information from the company which invented Lean.

Games People Play by Eric Berne.

alt text

IMHO it is a very useful aid to understand and deal with office politics (among others).

We think we’re relating to other people – but actually we’re all playing games.

Forty years ago, Games People Play revolutionized our understanding of what really goes on during our most basic social interactions. More than five million copies later, Dr. Eric Berne’s classic is as astonishing–and revealing–as it was on the day it was first published. This anniversary edition features a new introduction by Dr. James R. Allen, president of the International Transactional Analysis Association, and Kurt Vonnegut’s brilliant Life magazine review from 1965. We play games all the time–sexual games, marital games, power games with our bosses, and competitive games with our friends. Detailing status contests like “Martini” (I know a better way), to lethal couples combat like “If It Weren’t For You” and “Uproar,” to flirtation favorites like “The Stocking Game” and “Let’s You and Him Fight,” Dr. Berne exposes the secret ploys and unconscious maneuvers that rule our intimate lives. Explosive when it first appeared, Games People Play is now widely recognized as the most original and influential popular psychology book of our time. It’s as powerful and eye-opening as ever.

alt text

As well as the mentioned Gadwell's Tipping Point, Blink is a good choice.

A Brief History of Everything by Ken Wilber.

Front cover

In the ambitiously titled A Brief History of Everything, Wilber continues his search for the primary patterns that manifest in all realms of existence. Like Hegel in the West and Aurobindo in the East, Wilber is a thinker in the grand systematic tradition, an intellectual adventurer concerned with nothing less than the whole course of evolution, life's ultimate trajectory—in a word, everything. . . . Combining spiritual sensitivity with enormous intellectual understanding and a style of elegance and clarity, A Brief History of Everything is a clarion call for seeing the world as a whole, much at odds with the depressing reductionism of trendy Foucault-derivative academic philosophy.

The Fountainhead by Ayn Rand. Atlas Shrugged is already on this list, but the Fountainhead deals more with craftsmanship and integrity, rather than supply-side economic theory. Definitely worth a read for anyone in a creative field.

Could not put this one down, The Evolution of Cooperation by Robert Axelrod. Its a fascinating read and as game theory books go it's pretty accessible.

Snow Crash By Neal Stephenson

alt text

Ender's Game by Orson Scott Card

alt text

The Dirty Dozen

alt text

An analysis of the 12 worst Supreme Court decisions

Great and interesting book about how our liberties are being trodden on by the government. Libertarian viewpoint, but objective.

A Random Walk Down Wall Street

Burton G. Malkiel

Nothing else will teach you better how to get a handle on your money.

Wikipedia article

alt text

Niccolo Machiavelli's The Prince. After wondering why people acted so strangely at work, this book was the first of many, that taught me why.

JPod

alt text

How was JPod not posted? It's like a (already posted) Microserfs with internet. It's typical Coupland novel, must read for every techie, geek, webz hipster.

Here are some quotes

"You googled her?" "Of course I did. Didn't you?" I'd somehow forgotten to perform this essential task.

“After a week of intense googling, we’ve started to burn out knowing the answer to everything. God must feel that way all the time. I think people in the year 2020 are going to be nostalgic for the sensation of feeling clueless.”

“It turns out that only twenty percent of human beings have a sense of irony – which means that eighty percent of the world takes everything at face value. I can’t imagine anything worse than that. Okay, maybe I can, but imagine reading the morning newspaper and believing it all to be true on some level.”

Amazon

Love is the Killer App by Tim Sanders - it's for every professional.

Nothing too programmer-specific, but being in the industry that we are, it helps immensly to have a positive mindset depicted in this book.

alt text

Note: I had to move this book from my previous answer to here, to comply with the question's specific rule that one post -> one answer

This is probably not going to be popular, but "If liberty means anything at all it means the right to tell people what they do not want to hear."

In the Beginning was the Command Line

by Neal Stephenson

It's very dated, but I have yet to find a single book (or essay for that matter) that gives a quasi-outsider's view of an industry that the public is apathetic to understand. The insights and descriptions are spot-on, even though the conditions have dramaticly changed over time.

In the Beginning was the Command Line

The Inmates Are Running the Asylum

by Alan Cooper

alt text

It's about using the right language to talk about projects - using stories (and personas) instead of 'features' to talk about stuff that needs to be realized. Also a lot of emphasis on interaction design and related activities. Delivering what is needed instead of what is asked for.

Beyond Code by Rajesh Setty

alt text

Also read these free manifestos

  1. 25 Ways to Distinguish Yourself
  2. Making the Most of Your Time: Going Beyond To-Do Lists

(Note: moved the other book to a separate answer)

Awaken the Giant Within by Anthony Robbins.

alt text

The Black Swan: The Impact of the Highly Improbable

alt text

This book as about why stock markets are not predictable like casinos and the lottary. It is very readable though querky. It will help you to understand when statistical techneques do not work, why math is not understanding, why project managers can't predict schedules and how they can with less effort.

The book does not go into heavy math but will give you a feal for when the math can and more ofter can not be used.

Author: Nassim Nicholas Taleb. Also wrote 'Fooled By Randomness'

Read it if you work with mathematics, statistics or finance - Or if you have a pension.

Simon Singh's Fermat's Last Enigma is one of the greatest books I have ever read.

This non-programming book has taught me a lot about running after the solution of a problem, no matter how old and complex it is.

alt text

I recommend

The Emperor's New Mind

by Roger Penrose

Somehow in the line of Godel, Escher, Bach but, I think, easier to read.

First Things First - another equal great book from Stephen R. Covey.

alt text

Dealing with people you can't stand:

http://www.amazon.com/Dealing-People-You-Cant-Stand/dp/0071379444

Dealing with People You Can't Stand: How to Bring Out the Best in People at Their Worst (Paperback) ~ Dr. Rick Brinkman (Author), Dr. Rick Kirschner (Author), Dr. Rick Kirschner (Author), Dr. Rick Brinkman (Author)

Sensation & Perception by E. Bruce Goldstein will really pull a lot of software engineers out of their comfort zones. I found it to be fascinating when I started thinking about effective scientific visualization techniques with the user's physiology and psychology in mind. Issues with the user's potential for color blindness, visual acuity, attention span and information processing abilities are just some of the reasons why I keep going back to this book.

If you're a Python developer, you will not get around viewing Monty Python stuff. But to quickly look up a quote you find in any Python doc, I really recommend those:

alt text

(as well as part two, they're great; Amazon) and

alt text

(Amazon)

Reading doesn't give you the great look of a puzzled Michael Palin or the anger of a furious John Cleese, but it still is a worthwhile lecture.

Cheers,

The Soul Of A New Machine

by Tracy Kidder

"The Ultimate History of Video Games" of course!

Why? Because in one book you get history, fun, anecdotes, business decisions, project management, opinions, wonderful quotes, the hardware and the software ... all in all portraying an industry that went through numerous cycles, ups and downs, deaths and reincarnations. But most of all: Steven Kent managed to make this book a very entertaining read, you'll be captivated by each chapter.

alt text

see Amazon.com

This is similar to another question. Here is a link to my answer over there.

Now, Discover Your Strengths is my favorite personal/career development book. It teaches the most successful people become successful by focusing on building on their strengths, rather than covering up weaknesses. This book helps you find out where your strengths lie.

Waltzing With Bears

by Tom DeMarco and Timothy Lister

Waltzing With Bears

Great background on what managing risk means and lots of good tools for quantifying risks. They discuss a risk estimation tool which uses statistics to produce a pragmatic and reality-based understanding of the effects that risks will have on a given projects completion date and confidence level.

The prologue on "The Ethics of Belief" is not to be missed.

The Effective Executive

Concise, bare essential and time-less!

alt text

The First Quarter : A 25-year History of Video Games. Unabashed old-school video game geekery.

alt text

One hundred years of solitude

by Gabriel Garcia Marquez

Hackers: Heroes of the Computer Revolution

by Steven Levy

Does a great job of outlining some of the eras in computing, from the enviroment that sprung up around the Tech Model Railroad Club at MIT, to the Homebrew Computing in the bay area, to the story of the game companies of the early 80s. Especially the MIT section has wonderful descriptions of hackers at work, doing what they do best (in a wholly non-technical writing style), bumming instructions, making the machine do their bidding, and in the mid-seventies, it describes the self-made community of hardware hackers (including Wozniak), who built their own computers. Hugely entertaining, and a good way to understand where some of these communities originate from (academics, hackers, tinkeres).

Cover for Hackers: Heroes of the Computer Revolution

The Fifth Discipline:.

Several important things: System thinking, System Archetypes, etc.

alt text

alt text

If you don't want your job to be outsourced (as have happened to many programmers) then you need to read this book, A Whole New Mind - Why Right-Brianers Will Rule The Future, actualize it, and put it into practice yesterday!

I would recommend: "Code" by Charles Petzold.

It completely opened my eyes on how computers actually work, explained and illustrated clearly. I learned that computers have no inherent understanding of numbers, letters, words or anything like that. These were human concepts and it was up to the computer programmer (at a very low level) to present they patterns of bits from computer memory to something users would find meaningful.

Despite its title, "Code" has nothing to do with coding, but explains how computers work at the electrical level.

Peopleware: Productive Projects and Teams

by Tom DeMarco and Timothy Lister

alt text

This classic book encourages us to think about the people instead of the process. It's full of practical advice on team building, productivity and office environments. It's a must read, not just for managers, but anyone related to software development.

Get two copies, one for you and one for your manager.

Zen and the Art of Motorcycle Maintenance

by Robert M. Pirsig

alt text

This book is many things, but you could say it's sort of a philosophical take on what it means to "grok" something.


Commentry from Garth Gilmore:

I credit this book with teaching me more about software development than any programming book I ever read.

The central thread in the book is how our romantic (artistic) and classical (technical/rational) perceptions of the world are both derived from how we perceive quality in the environment around us. This understanding is then applied to apparently mundane tasks like motorcycle maintenance.

To give some examples of how this applies to coding:

  • The section on how to approach the motorcycle with a 'quality mindset' that leads to progress is just as applicable to reaching 'the zone' in programming.
  • The section on 'gumption traps' that prevent progress and lead to you damaging the machine is priceless. The solutions that are presented work just as well when trying to modify legacy code without introducing bugs.
  • The section on how a purely classical description of an engine part is useless (because it lacks any place for the user to stand) should be read by anyone involved in requirements analysis.

Long story short its a good read :-)

Simon Singh's The Code Book is a great book about how cryptography was born and how people is always trying to challenge it.

alt text

The Hitchhiker's Guide to the Galaxy

by Douglas Adams

alt text

Life, the universe, and everything

"See first, think later, then test. But always see first. Otherwise you will only see what you were expecting. Most scientists forget that." -- Wonko the Sane

Never Eat Alone: And Other Secrets to Success, One Relationship at a Time

by Keith Ferrazzi

cover

Comments from duplicate answer by Flory:
I did not think that I would like it before I got the book but I really enjoyed it. It is basically about how to build a relationships. Prior to reading it I expected it to be very trite and about how to use people for your own ends. Instead it was the opposite in how to be used to everyone's ends. Very interesting.

What is the name of this book?, by Raymond Smullyan. It is a wonderful book of puzzles about the intricacies of logic.

Hyperspace: A Scientific Odyssey Through Parallel Universes, Time Warps, and the 10th Dimension

by Michio Kaku

alt text

There's a lot of space out there to get lost in.
-- John Robinson, Lost in Space

Cryptonomicon

by Neal Stephenson

Cryptonomicon by Neal Stephenson

This book follows parallel stories of a World War II code breaker and his present day descendant, and deals a lot with the development of computers (Alan Turing is actually a character in the book). A geek's must-read!

Stranger in a strange land because every programmer should grok the word "GROK".

Lessons Learned in Software Testing by Kaner, Bach, and Pettigrew. Brilliant book, easy to read.

The Thermodynamics of Pizza by Harold Morowitz.

This could have all kinds of morals, depending on how you take it. 1. You can use science to improve EVERYTHING! :-) 2. Make sure you choose the right level of abstraction when designing and coding. 3. You can really improve your life if you just take a few minutes to think about it.

etc.

Getting Things Done

by David Allen.

alt text

The Moon Is A Harsh Mistress

Amazon - Wikipedia

The Moon Is A Harsh Mistress

Written in 1966 this classic science fiction novel takes place on the penal colony Luna (the moon). The story is told by the only programmer/computer repairman on Luna, Manuel. Manuel has a secret. The master computer (Mike) that controls all of Luna has become a sentient AI and happens to have Manuel as its only friend. Mike is rough around the edges at first, its speech is fuzzy and it plays childish but dangerous jokes with its god-like abilities. As time wears on Mikes abilities fully develop into a mature being. With Manuel's guidance they will go on an adventure together that spurs the revolution of freeing Luna from Earth!

This novel is the first Robert A. Heinlein novels I have read but will certainly not be the last. The fact that this book was written in 1966 still astonishes me! It has barely any dated parts and could easily pass for a contemporary novel. It wont he Hugo award for best novel.

Truly one of the better "programmer" style novels I have read. Great adventure the whole way through. If anyone has a suggestion as to which Heinlein novel I read next, please leave a comment!

Written in 1950, Dianetics: The Evolution of a Science describes the optimum computer as an introduction to a science of the mind.

Nineteen Eighty Four

by George Orwell

1984

The Curious Incident of the Dog in the Night-Time

by Mark Haddon

alt text

It will give you some perspective of your odd co-workers.

Blink:

This is an amazing book that details some very counter-intuitive conclusions about the LACK of THINKING actually predominates our decision process.

Player Piano by Kurt Vonnegut

Beyond Fear by Bruce Schneier.
Beyond Fear Book

From Amazon: "Schneier provides an interesting view of the notion of security, outlining a simple five-step process that can be applied to deliver effective and sensible security decisions. These steps are addressed in detail throughout the book, and applied to various scenarios to show how simple, yet effective they can be....Overall, this book is an entertaining read, written in layman's terms, with a diverse range of examples and anecdotes that reinforce the notion of security as a process".

Or just consider it a straight read on understanding what security means - whether for computers or in real life. It can give you the tools to handle the ginormous amounts of FUD we encounter every day.... And it's entertaining, besides. (Even got my father to read it, and he's enjoying it...)

Universal Principles of Design, by William Lidwell, Kritina Holden, and Jill Butler

Universal Principles of Design

One of this biggest issues I have with many programs I have used is the lack of design put into the interface and into the product. This book goes in-depth describing how to enhance the usablilty within a interface. It also tells you all of the basic principals and rules of design, and they give many examples for many different applications whether its techinical or non-technical. The book reads a little like a college classroom book (and it probably is for many design schools), so it the not the most exciting thing to read, but I find the most informative when it comes to interface design.

The Tao of Physics by Fritjof Capra

One notable premise contained within this book reminds me of the saying "If you go far enough away, then you're on your way back home". For example, the Eastern and Western approaches to philosophy and science were so diametrically opposed for centuries but perhaps they're coming around the other side towards similar conclusions these days?

It may be 30 or so years old, but it's still very much worth the read.

alt text

My second choice would be to read Neuromancer by William Gibson (or watch The Matrix which is along the same lines I guess).

I can't believe I didn't see this already listed:

Dune

by Frank Herbert

Dune Cover

Dune is the pinnacle of Sci-Fi novels!

I've been really enjoying haiku recently. To that end, I'd very strongly recommend The Haiku Handbook: How to Write, Share, and Teach Haiku by William J. Higinson.

Book Cover

I recommend reading/writing haiku as a way to relax.

The Tipping Point is one of the best books that I have ever read.

Eats, Shoots & Leaves: The Zero Tolerance Approach to Punctuation

by Lynne Truss

Becoming a better communicator in people language, I believe, makes you a better communicator in code. Punctuation is a very good place to start improving your writing.

The Game

Every programmer should read this book to learn how to pick up women.

The game

Fortune's Formula

alt text

Information theory, betting, value of information, etc.

Fantastic read.

Flow: The Psychology of Optimal Experience

by Mihaly Csikszentmihalyi

alt text

The best and most productive coding is done in a flow state. This is a psychological study of the phenomemon. Although the book is scientifically rigorous it remains accessible to the lay-person.

21st Century Jet: The Making of the Boeing 777, by Karl Sabbagh

From coffee cup holder to three-hundred-foot wing, this book is the story of how a group of people came to build a brand new aeroplane.

The book describes the development of the Boeing 777, from initial concept, through requirements gathering, design, development, testing, production, and delivery. The engineers and management implemented a new development system, overcame changing requirements, met strict safety requirements, and continually optimized the solution. It describes how the designers and engineers worked to make the aircraft easier, safer, and more intuitive for everyone who would come in contact with it (air crew, maintenence crews, and passengers).

Software developers can learn a lot from this book. It's very well written, it reads like a novel. I've read it twice and highly recommend it.

Boeing Computer Services president John Warner said, the Boeing 777 is "three million parts flying in close formation." Sounds like software to me.

Charles Perrow's "Normal Accidents" investigates what can happen when complex technology goes horribly wrong, and formulates his theory of the "normal accident": complex, tightly coupled systems will have accidents, because minor faults interact with catastrophic consequences. We see this all the time in programming and systems administration, and yet, as far as I know, few of these concepts are understood outside safety engineering.

(He also writes very well, and brings life to what could have been a rather dry book).

alt text

Joel Spolsky's "Best Software Writing I"

Women, Fire, and Dangerous Things

by George Lakoff

alt text

It's a book about how people categorize things, and about reasoning in general. It's long and extremely boring for some people, but it is still great.

If you live on the Unix side of the world, The Art of UNIX Programming by Eric Raymond (see also here). Despite its title, it is not a programming book, and it contains very few lines of code indeed. It's the best book I know about the Unix philosophy.

I found Zero: The Biography of a Dangerous Idea to be pretty decent. He has a followup to this called Decoding the Universe: How the New Science of Information Is Explaining Everything in the Cosmos, from Our Brains to Black Holes which I have but haven't read yet so I can't comment on how it is.

alt text

Secret Rendezvous by Kobo Abe. Abe's the frickin' man, man.

http://www.fantasticfiction.co.uk/images/n4/n24878.jpg

But seriously, if you like Murakami, you owe it to yourself to check out Abe.

Happiness is a Choice by Barry Neil Kaufman

It's a great book that can help you understand you can choose how to feel. Turns out you can be responsible for a lot more of your emotions than you think.

Another one from a different angle from prior posts: Gödel, Escher, Bach: an Eternal Golden Braid, by Douglas Hofstadter.

alt text

The Four Steps to Epiphany

I can not believe this book has never been mentioned!! It is one of the best book about product management I have read in years. If you are working for a startup, it is a must read.

alt text

The Milkshake Moment: Overcoming Stupid Systems, Pointless Policies and Muddled Management to Realize Real Growth by Steven Little

The Milkshake Moment

The Right Stuff by Tom Wolfe

Amazon

Walter Murch's "In the Blink of an Eye"

Speed Reading, by Robert L. Zorn:

alt text

Or any other Speed Reading text. Learning my own quirks about how I read has helped me to be conscious of other aspects of how I think. Having the ability to control my reading speed has proven to be invaluable. I still choose to read books for pleasure at my previous reading speed with all its flaws.

The Illuminatus! Trilogy by Robert Shea and Robert Anton Wilson. In many ways, this book changed the way I do my thinking. Not sure whether it is good or bad to completely distrust anything and everything, but at least it keeps ones mind critical instead of automatically accepting something as truth without questioning.

The book also introduced me to the concepts of discordianism, which I find having quite a few interesting points.

Outliers: The Story of Success by Malcolm Gladwell

I just bought it on Audible last week and I can't stop listening to it. It goes through the factors of successful people (ex: Bill Gates, Bill Joy, The Beatles). Fascinating!

Enigma: The Battle for the Code

by Hugh Sebag-Montefiore

alt text

Having a bad week at work? Well at least when you can't figure out some algorithm people aren't dying in their hundreds in the freezing North Atlantic waiting on you to work it out.

As well as being a great read about the dawn of the modern computing age, this book can help with perspective.

Dreaming in Code

by Scott Rosenberg (Amazon Wikipedia)

Cover image

A great book about the development process. It also highlights how developers are doomed to keep repeating the same mistakes over and over again

Juggling for the Complete Klutz

Juggling is mandatory. All programmers must juggle. Sorry, it's a rule.

Rick Cook - The Wiz Biz

alt text

This is a compilation of the first two novels in a series, called 'Wizard's Bane' and 'Wizardry Compiled', respectively.

It all began when the wizards of the White League were under attack by their opponents of the Black League and one of their most powerful members cast a spell to bring forth a mighty wizard to aid their cause. What the spell delivers master hacker Walter "Wiz" Zumwalt. With the wizard who cast the spell dead, nobody can figure out what the shanghaied computer nerd is good for--because spells are not like computer programs.

Lots of in jokes for the Unix/Linux crowd to enjoy. Pretty much anybody in the software industry will enjoy it, I think.

Original Question

I am currently engaged in teaching my brother to program. He is a total beginner, but very smart. (And he actually wants to learn). I've noticed that some of our sessions have gotten bogged down in minor details, and I don't feel I've been very organized. (But the answers to this post have helped a lot.)

What can I do better to teach him effectively? Is there a logical order that I can use to run through concept by concept? Are there complexities I should avoid till later?

The language we are working with is Python, but advice in any language is welcome.


How to Help

If you have good ones please add the following in your answer:

  • Beginner Exercises and Project Ideas
  • Resources for teaching beginners
  • Screencasts / blog posts / free e-books
  • Print books that are good for beginners

Please describe the resource with a link to it so I can take a look. I want everyone to know that I have definitely been using some of these ideas. Your submissions will be aggregated in this post.


Online Resources for teaching beginners:


Recommended Print Books for teaching beginners

In my biased opinion, C is the best point to start. The language is small, it's high level features are ubiquitous and the low level features let you learn the machine.

I found the C Primer Plus, 5th Edition very helpful as a beginning programmer with almost no programming experience. It assumes no prior programming experience, fun to read and covers C in depth (including the latest C99 standard).

I highly recommend Python Programming: An Introduction to Computer Science 2nd Edition by John Zelle. It is geared towards beginners, and deals with the semantics of programming. After reading you will be able to pick up other languages much faster because of Zelle's semantic vs. syntactic approach. Check it out!

Is there a programming language "below" Assembly?

And to go even lower, (not that the word "language" is appropriate for "machine" language or for even lower physical layers), but below machine language is the configuration of the many gates and switches used to actually implement each binary opcode for the particular hardware (CPU) involved... A great book to read that covers this even lower level is by Charles Petzold, called "CODE"

In an attempt to be a better programmer, I am planning to read a lot of books and learn at least one new language (which I think is going to be python) during the 3-month long holiday that I am going to have.

The list of books that I am planning to read --

Ebooks:

The list of things that I want to do --

  • Start using Linux (probably starting with Ubuntu).
  • Learning to use the bunch of tools mentioned here.
  • Setup a blog (hopefully).

I enjoy watching lectures as well, so, along with Introduction to Algorithms I am going to watch a bunch of Stanford Courses.

A little background: I am a 17 year old guy and I really enjoy programming and every aspect related to it. I have been programming in C and C++ for a while now. The former is more stronger than the latter. I was hoping to utilize the time that I have got on hand thoroughly. Any changes needed with the plan or any additions?

EDIT: Did not mention programming projects.

  1. Making a game using Allegro.
  2. Using QT4 to create a GUI-based database for my school.

Do not just passively read all that information, instead practice after every book chapter or lecture. Practice by writing those algorithms or regexpes for yourself, check your previous code in the light of what code complete has taught you and so on.

If that doesn't give you enough time to do it all, doesn't matter, you better learn properly instead of swallowing material as fast as you can. And all of that is probably too much to do it in only three months anyway, so prioritize by your interests. Take one book and a set of lectures and go at them until finished, then pickup the next, never forgetting to put in practice the concepts shown.

Along with the excellent books you and others listed here I recommend The Little Schemer which will give you a perspective of functional programming. Do not lock yourself into imperative languages (C, C++, C#, Pascal, Java,.. ) while you can dive into different paradigms easily. 17 is a great age :-) Enjoy your journey!

These probably won't fit within your three month plan, but should you wish to master C and Unix, long have I been glad that I spent the time to follow The Loginataka. After that, I found Lions' Commentary on UNIX 6th Edition to be deeply enlightening.

I would add the following two books if you haven't read them already:

Programming Pearls by Jon Bentley

Code by Charles Petzold

Even as it stands, you're going to have a very busy, hopefully productive break. Good luck!

Response to question edit: If you're interested in learning about databases, then I recommend Database in Depth by Chris Date. I hope by "create a GUI-based database" you mean implementing a front-end application for an existing database back end. There are plenty of database solutions out there, and it will be well worth it for your future career to learn a few of them.

I have absolutely no programming experience but need to learn Java - enough to take a J2ME fasttrack course. I only have 10 weeks. Can I do this? What's your advice about the best resources I can use ?(currently using Sun's Java Tutorials).

10 weeks? Apparently you can do it in 24 hours!

http://www.amazon.com/Sams-Teach-Yourself-Programming-Hours/dp/0672328445

EDIT:

Okay, so only 1 person found my answer amusing, but not amusing enough to upvote. The real question is how good do you need to be in 10 weeks?

If you get yourself a good book (the one linked above has some good reviews on Amazon), then in 10 weeks you might be proficient enough to do something useful in Java, but it takes years to become expert. Any time spent between 10 weeks and several years will move you from beginner towards expert.

Oh and read Teach Yourself Programming in Ten Years.

Learning to program for the first time is kind of like learning a foreign language. You will easily be able to recreate the phrases you are taught, but you will lack the understanding of the context for why it is done that way, and will thus be unable to solve new problems effectively. It simply takes time.

If you're a first-time programmer, I really can't recommend Java. Python would be much better (disclaimer: Python fan-boy, but for good reasons).

However, I don't think a beginner could do much better than Head First Java

It depends on how hard you want to work, but yes it's possible. The problem you are going to have is that you have to learn to program along with learning java. These are two very different things. Programming is knowing how to read and write logic and Java is a language you write it in. If you have a math or physics background, this is going to be a lot easier, as you are already exposed to thinking in such a manner.

If you don't have books on beginning Java I would go buy one of those.

I would also pick up the book Code (I would try and get through this in a few days, if not over the weekend if possible). Actually with 10 weeks I would do this first as it will be a foundation for what you'll need to know to program Java.

With 10 weeks, you are going to have to pretty much study every night to get the hang of it by the time you go to class. My best advice is that when you take the class, take lots of notes, and don't expect to understand everything. Most of what gets thrown at you there will probably go over your head at first and you'll forget. That's ok. After the class if over, go back and review the notes etc until it starts to make sense.

I'm computer science student who just finished my first Java course.. I'd say it's possible to learn Java on 10 weeks if you hard work on it. But you'll only get an intro! Programming is much more than just knowing the language (API, syntax etc)..

Best Java book ever: http://www.amazon.com/Introduction-Java-Programming-Comprehensive-Version/dp/0136012671/ref=sr_1_1?ie=UTF8&s=books&qid=1242328533&sr=8-1

I can sympathise... having once been in a similar predicament, though I did at least have some background. I concur with @ShawnMilo regarding Head Fist Java. Also recommend Sams Teach Yourself Java in 21 Days and, given that you say you have no programming background, I strongly urge you to look at The Oject Oriented Thought Process by Matt Weisfeld. I also concur with all the people on this thread who say that there's WAY more to programming than 'simply' learning one language (especially if it's Java). Having said that, good luck and god speed.

PS I'd +1 @Patrick McDonald for sense of humour, but I don't have enough rep!

PPS And another virtual +1 for @Robin. I was wondering when the Four Yorkshiremen would get in on this thread...

What makes all the words of a programming language actually do anything? I mean, what's actually happening to make the computer know what all of those words mean? If I verbally tell my my computer to do something, it doesn't do it, because it doesn't understand. So how exactly can these human words written into a language actually cause the computer to do some desirable activity?

A good book that talks about computers for non-engineers is 'Code' by Charles Petzold. I don't recall exactly if it covers exactly your question, but I think so. If you are interested enough to go farther it's a good choice.

Code

I don't know very well about RAM and HDD architecture, or how electronics deals with chunks of memory, but this always triggered my curiosity: Why did we choose to stop at 8 bits for the smallest element in a computer value ?

My question may look very dumb, because the answer are obvious, but I'm not very sure...

Is it because 2^3 allows it to fit perfectly when addressing memory ? Are electronics especially designed to store chunk of 8 bits ? If yes, why not use wider words ? It is because it divides 32, 64 and 128, so that processor words can be be given several of those words ? Is it just convenient to have 256 value for such a tiny space ?

What do you think ?

My question is a little too metaphysical, but I want to make sure it's just an historical reason and not a technological or mathematical reason.

For the anecdote, I was also thinking about the ASCII standard, in which most of the first characters are useless with stuff like UTF-8, I'm also trying to think about some tinier and faster character encoding...

Charles Petzold wrote an interesting book called Code that covers exactly this question. See chapter 15, Bytes and Hex.

Quotes from that chapter:

Eight bit values are inputs to the adders, latches and data selectors, and also outputs from these units. Eight-bit values are also defined by switches and displayed by lightbulbs, The data path in these circuits is thus said to be 8 bits wide. But why 8 bits? Why not 6 or 7 or 9 or 10?

... there's really no reason why it had to be built that way. Eight bits just seemed at the time to be a convenient amount, a nice biteful of bits, if you will.

...For a while, a byte meant simply the number of bits in a particular data path. But by the mid-1960s. in connection with the development of IBM's System/360 (their large complex of business computers), the word came to mean a group of 8 bits.

... One reason IBM gravitated toward 8-bit bytes was the ease in storing numbers in a format known as BCD. But as we'll see in the chapters ahead, quite by coincidence a byte is ideal for storing text because most written languages around the world (with the exception of the ideographs used in Chinese, Japanese and Korean) can be represented with fewer than 256 characters.

I am working through a problem which i was able to solve, all but for the last piece - i am not sure how can one do multiplication using bitwise operators:

0*8 = 0

1*8 = 8

2*8 = 16 

3*8 = 24 

4*8 = 32

Can you please recommend an approach to solve this?

To multiply by any value of 2 to the power of N (i.e. 2^N) shift the bits N times to the left.

0000 0001 = 1 

times 4 = (2^2 => N = 2) = 2 bit shift : 0000 0100 = 4

times 8 = (2^3 -> N = 3) = 3 bit shift : 0010 0000 = 32

etc..

To divide shift the bits to the right.

The bits are whole 1 or 0 - you can't shift by a part of a bit thus if the number you're multiplying by is does not factor a whole value of N ie.

since: 17 = 16  + 1 
thus:  17 = 2^4 + 1

therefore: x * 17 = (x * 16) + x in other words 17 x's  

thus to multiply by 17 you have to do a 4 bit shift to the left, and then add the original number again:

==> x * 17 = (x * 2^4) + x 
==> x * 17 = (x shifted to left by 4 bits) + x 

so let x = 3 = 0000 0011 

times 16 = (2^4 => N = 2) = 4 bit shift : 0011 0000 = 48

plus the x (0000 0011)

ie.

    0011 0000  (48)  
+   0000 0011   (3)
=============
    0011 0011  (51)

Edit: Update to original answer. Charles Petzold has written a fantastic book 'Code' that will explain all of this and more in the easiest of ways. I thoroughly recommend this.

I am not well acquainted to the compiler magic. The act of transforming human-readable code (or the not really readable Assembly instructions) into machine code is, for me, rocket science combined with sorcery.

I will narrow down the subject of this question to Win32 executables (.exe). When I open these files up in a specialized viewer, I can find strings (usually 16b per character) scattered at various places, but the rest is just garbage. I suppose the unreadable part (majority) is the machine code (or maybe resources, such as images etc...).

Is there any straightforward way of reading the machine code? Opening the exe as a file stream and reading it byte by byte, how could one turn these individual bytes into Assembly? Is there a straightforward mapping between these instruction bytes and the Assembly instruction?

How is the .exe written? Four bytes per instruction? More? Less? I have noticed some applications can create executable files just like that: for example, in ACD See you can export a series of images into a slideshow. But this does not necessarily have to be a SWF slideshow, ACD See is also capable of producing EXEcutable presentations. How is that done?

How can I understand what goes on inside an EXE file?

Both your curiosity and your level of understanding is exactly where I was at one point. I highly recommend Code: The Hidden Language of Computer Hardware and Software. This will not answer all of the questions you ask here but it will shed light on some of the utterly black magic aspects of computers. It's a thick book but highly readable.

I'm a beginning programmer reading K&R, and I feel as if the book assumes a lot of previous knowledge. One aspect that confuses me is the actual representation, or should I say existence, of variables in memory. What exactly does a data type specify for a variable? I'm not too sure of how to word this question... but I'll ask a few questions and perhaps someone can come up with a coherent answer for me.

When using getchar(), I was told that it is better to use type "int" than type "char" due to the fact that "int" can hold more values while "char" can hold only 256 values. Since we may need the variable to hold the EOF value, we will need more than 256 or the EOF value will overlap with one of the 256 characters. In my mind, I view this as a bunch of boxes with empty holes. Could someone give me a better representation? Do these "boxes" have index numbers? When EOF overlaps with a value in the 256 available values, can we predict which value it will overlap with?

Also, does this mean that the data type "char" is only fine to use when we are simply assigning a value to a variable manually, such as char c = 'a', when we definitely know that we will only have 256 possible ASCII characters?

Also, what is the actual important difference between "char" and "int"? If we can use "int" type instead of "char" type, why do we decide to use one over the other at certain times? Is it to save "memory" (I use quotes as I do not actually how "memory" exactly works).

Lastly, how exactly is the 256 available values of type char obtained? I read something about modulo 2^n, where n = 8, but why does that work (something to do with binary?). What is the modulo portion of "modulo 2^n" mean (if it has any relevance to modular arithmetic, I can't see the relation...)?

G'day,

To go deeper, I'd highly recommend Charles Petzold's excellent book "Code"

It covers more than what you ask, all of which leads to a better understanding of what's actually happening under the covers.

HTH

What would be a good methodology for learning how computers and computer programming works?

For example, would you recommend learning how circuits work, then assembly language, and then higher level languages?

Thats a tall order.

Hardware side:

  • build a cheap computer, I've always liked Arstechnica's build guides.
  • Read tons of architecture articles.
  • Install different OSs (windows, linux, etc)

Software side:

  • Learn Assembly
  • Starter book on C
  • Deep C Secrets by Peter Van Der Linden (awesome book)

Random other good books

Keep reading, keep asking questions, keep learning.

You could read Code: The Hidden Language of Computer Hardware and Software from Charles Petzold. It provides a very nice historical perspective on the development of computers.

It's a easy and very good read in my opinion.

I wanted to learn exactly what you're looking for. Of course, the full answer is: never stop learning etc... but if you want the most condensed self-paced crash course, read Charles Petzold's Code: The Hidden Language of Computer Hardware and Software then read The Elements of Computing Systems: Building a Modern Computer from First Principles.

This will jump-start your overall understanding better than a half dozen or more specialized university courses.

There's no magic bullet here and these books don't contain any secrets. They are just super-focused with exactly the goal of understanding computer related concepts in an accessible way from top to bottom.

Read Danny Hillis's The Pattern on the Stone. Learn to program. After you've been programming for a while, if you're still interested, check out The Elements of Computing Systems: Building a Modern Computer from First Principles. By then you'll have seen plenty of pointers to more things to study.

I am looking for some good text books in the public domain, which could be used to teach computing to school kids aged (10-15). I couldn't get any googling for it. Can somebody out there point me to good links. If text books are not available any information on what is taught commonly to this age group as part of computing curriculum will be helpful.

Think Python would be my first choice for teaching programming. The book is free, python is free, and some really good IDE's are free - Stani's Python editor or Wing IDE 101. This provides a really good environment and set of resources for teaching programming to kids in that age range. If programming is a bit much for the younger kids, PyGame can be used to get simple graphics on the screen fast - and that is a great way to hold onto attention span.

EDIT: I just ran across a great book for introducing computer programming to kids (and other beginners): Hello World! Computer Programming for Kids and Other Beginners. This book uses Python as the programming language, and the projects are all simple games. Overall, this is a great book for introducing kids to computer programming.

"Computing" is an awfully broad topic. Do you mean teaching them how a computer works (like on the inside), or how to use computer applications (word processing/spreadsheet/internet), or how to program them? I think all three would be good topics for 10-15 year olds.

My dad, a computer engineer, taught me much of the above on my own around that age (of course, it depends upon how motivated your students are). Mostly it was through experimentation, and asking questions. I'll point out a few good resources that I went through when I was that age. While these books aren't public domain, they're not that expensive (you can purchase all the books I mention below for under $100US at the time of this answer, cheaper than a single college textbook; the movies you could try finding at your local library). Note some of these are from MS-DOS 3.x era of 10-12 years ago, but honestly, the basic concepts haven't changed that much. The IBM PC platform still has the same architechture, it's just been upgraded. Applications have changed though.


How a computer works

  • You might want to teach about all of the different parts in a modern computer tower by opening one up and explaining to them what each part is and does, and how they hook together. It doesn't even need to work, you just need to be able to show them stuff. A good, simple book that explains the parts of a computer is How Computers Work by Ron White. I believe there is also a Magic School Bus episode on this ("The Magic School Bus Gets Programmed", Episode 50 From Season 4).
  • After that you may want to explain about the startup process, and how the computer first turns on, and doesn't know anything. Then you could explain about how the BIOS chip finds all the various things hooked to the motherboard, and then uses the hard-drive to start the Operating System (Windows/OS X).
  • There are some interactive programs that describe how all of these things work, although I can't think of any off the top of my head. There was an old learning program called "What's in that Box" that I used, but it's so outdated now its useless.
  • If you have really motivated students, you may want to introduce them to the electronic foundations of the computer, and binary numbers and gates. A good (teacher level) introduction to these things is Charles Petzold's Code. You try explaining how computers talk about things using 1s and 0s. Also, there is a Bill Nye the Science Guy episode on this (Season 4, Episode 78).

How to use applications

Honestly, I'm really not sure what to tell you here, but I imagine you can find lots of tutorials on this if you google. Explaining Word, Excel, etc. to students is beneficial and I imagine widespread. NB: Teach students how to touch-type at that age. I didn't learn how to touch-type until I was in middle of HS, and it was hard. By that time, I had already learned how to do stuff on computers and play games on the keyboard, and so had my fingers memorized to go to all the wrong spots. If you catch them early, they'll do well.


How to program

  • The way I learned how to program at age 10 was this way using a language called BASIC (BTW, that link gives lots of other ideas for learning how to program at a young age). I'm certain others will have good answers on this too. A book that I used to learn from after that was QBasic by Example, that a computer bookstore owner gave to me when I was 12 from his throw-away pile. That was my programming bible, and I read it cover-to-cover.
  • Note, though, that some students will want to do "cool" things when learning how to program; admittedly, how I learned would not be classified as cool. My old computer science prof from undergrad is involved in a program with inner-city kids that teaches them how to program robots using a language called LOGO, Sun's SunSPOTS, and LEGO Mindstorms NXT (depending upon the class focus). You basically give commands to the robot and it does them, and you can watch the robot do what you told it to do. Very cool, and interactive. It can get them thinking about programming, and how its about telling the computer/robot what to do, and how you can be a "robot commander" or "computer commander." This is, essentially, what computer programmers do everyday.
  • The new children's show Cyberchase teaches critical thinking skills that are a foundation to programming skills.

Just some thoughts to get you started. I think many kids would appreciate a hands-on approach; most of those in the industry got started because of hands-on exposure and not rote book-learning. The above early education, along with some books, worked for me, most of that stuff I rattled off from memory.

Also check out Woz.org; Steve Wozniak (programmer/hardware engineer, designer of the Apple ][) now teaches grade school children computers.

I'm looking for a laymen's introduction to computer hardware and organization. Here are some of the topics I would like to cover.

  1. Brief intro to electronics.

  2. Gates and state machines, intro to register transfer and timing.

  3. Basic CPU design. Control.

  4. Microprogrammed CPU design.

  5. Cache systems.

  6. Memory hierarchy:registers, cache, RAM

  7. Virtual memory organization.

  8. Disk storage systems.

  9. Internal busses-front side, memory, PCI

  10. Internal busses for storage-IDE, SATA, SCSI

  11. External busses-USB and firewire

  12. Display systems and GPUs

I would prefer free resources online, but if nothing is available a book is fine as well. I have no background with hardware so an introductory text would be wonderful. Also I'm sorry if this isn't directly programming but I don't know where else to ask.

The Art of Electronics by Horowitz and Hill is a great one for hobbyist on electronics.

For computer architecture Computer Organization and Design: The Hardware/Software Interface

For RTL design VHDL for Programmable Logic

I would recommend the book "Code" by Charles Petzold. It covers a lot of how the low level of a computer works from a layman's perspective. Not everything on your list is included, but it will give you a good start.

Tanenbaum's Structured Computer Organization was my intro into the 'levels' of computers. It's quite logical, approaching each level built on the previous.

I've often thought of doing a similar one, stretching from quantum physics through classical physics, electronics, integrated circuits, microcode, machine code, compilers, interpreters, VMs and so on, but I fear that would be about as possible as Knuth's 12-volume series. I hope he has a child to carry on the work :-).

As mentioned already Code: The Hidden Language of Computer Hardware and Software is a great book that covers the fundamentals.

Here are a couple of other books:

Computer Architecture: A Quantitative Approach

The Essentials of Computer Organization and Architecture

Upgrading and Repairing PCs

Here's a good site:

PC Architecture

i got really confused every time when i encounterd bit operations,especially those shifts,rotates,overflow things etc.I wonder if there's any book/article on the web introducing boolean algebra,which could give me a solid background of boolean algebra,thanks!

At university we used a book called Introduction to Logic Design. Covered everything from boolean algebra up to FPGA stuff. Pretty comprehensive and it has a fair amount of exercises.

Two really great books come to mind.

Also, online you can read Bit Twiddling Hacks.

I just spent some time at Bart de Smet's online blog and found it to be not only useful information for developers but at the same time interesting, fun, reading. The author obviously not only knows his subject matter, but has a talent for making his writing enjoyable to read:

...80 centimeters behind me lies the answer in dead tree format. I reach out to my bookshelve. A blue book, purchased 08/03/03 in Ghent according to a sticker on the back, is removed from its spot where it's been sitting since its overseas transportation almost two years ago. Not too dusty though. The title is still clearly readable: Windows Server 2003 TCP/IP Protocols and Services. Yes, I admit. I even posess books on IIS 6.0, Exchange 2003, Active Directory Services and PKI in Windows Server 2003...

What am I looking for anyway? Oh yes, huge number of connections in CLOSEWAIT state. Luckily, the Book Browser service declared a dependency on the Indexer service. It's consulted to load pages in the upper range of the dead tree volume, triggering a search algorithm for LCID 1033, and responds to the "CLOSEWAIT" query with an offset 329...

Another good example of this type of writing is the classic Philip and Alex's Guide to Web Publishing which was 90s book on how to set up a web server but had a very subjective and informative writing style which kept you reading it like a novel as you learned different strategies for connecting a database to HTTP/HTML. The book was also choc full of random color pictures he had taken on his journeys around the world which made it one-of-a-kind.

I want to find more writing of this genre: e.g. writing that takes WPF and ASP.NET MVC and makes it juicy and fun and connects it to a wider range of knowledge/experience, writing which teaches you MVVM but also dabbles in philosophy and draws parallels between object-oriented patterns and Greek thought or Aristotle's drive to organize the world in a hierarchy, etc.

Who are the best developer/authors out there who are going beyond mere transmission of information, authors who combine their knowledge of IT and their writing talent to produce enjoyable literature that is useful to developers at a technical level?

CODE: The Hidden Language of Computer Hardware and Software

By Charles Petzold

This is a good book for conceptual hardware design. Petzold may be the best computer tech writer around.

http://www.charlespetzold.com/code/

http://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/0735611319

I was wondering how computer would look if trinary logic was used. It seems like the bigger the base , the more memory can be utilized. I'll explain. Binary address with length of 32 -> allows you to represent 2^32 possible values. Trinary address -> 3^32 , which is ~ 431439 bigger than the binary one .

It seems like it is much better. Also , the hardware way of doing it could be done easly -> 2 means strong current, 1 means weak current , and 0 no current. Of course it is much more complicated, but the idea is simple. However , i couldnt find any reffrence to any new research or new computer using this kind of logic.

So , my question is why not using 3 numbers logic ? or any n -number logic ( n>2 ) ? What is stopping us from doing that ?

At their base, computers use switches, which have two states. On and Off. When dealing with electronic current, at the most basic level, those are your two options. While in theory you probably could have multiple amounts of electricity count as different bits, it would be complicated.

This book, Code, by Charles Petzold, explains how computers work, from the ground up all the way through building a basic processor unit. I think that you'll have a lot to gain by giving it a read.

I can't say I fully understand how compilers work. Moreover, I know little thing about them. However, I have always wonder how is it possible for a machine to understand the code we write in a document.

I know that what we wrote it is translated to something (if you could also give me some details of a compilation it would be great) and then after certain operations a binary code emerges.

But how can a circuit understand and operate with 0s and 1s. I have some formation on computer architecture, i know how a transistor works and how an ALU works and how it is implemented. I know how a RAM works (more or less, so any further explanation will be great too) and also the HDD.

But, i get lost when trying to imagine how a compiler engenders magical thing (at least for me) that fits perfectly in a tangible machine.

It amazes me. That that we take for granted every day, it is so conceptually great. The cooperation between an abstract code and a physical machine... amazing.

Do not worry to go deep in the machine guts if necesary in your answer, i find it really interesting and maybe you can enlighten me. The more details you give to describe this process the better.

Stackoverflow is not the appropriate venue for this kind of question, but if you'll just read this book it explains exactly what you're asking: http://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/0735611319

The question basically says it all. I'm a noob so make it gentle.

For these languages, broadly, return ends the current function and returns execution flow to the calling function. You can optionally pass a value after the return statement which is the result of the current function in the context of the calling function.

For example:

void CallingFunction() {
    int x = OtherFunction();
}

int OtherFunction() {
    return 3;
}

The return statement ends OtherFunction(), i.e. any other statements after the return would not be executed, and the value of x in CallingFunction() will be 3, since that is what OtherFunction() returned.

This idea of functions and returning values is a very basic, core concept for this style of programming. As others have pointed out in the comments, you really should check out a book or find a mentor who can help you get started.

Code is a very easy to read, high-level overview of the concepts you'll need.

Can anyone recommend some tips for understanding PC memory? I just can't seem to get it. I've read various chapters from books on memory and the stack and such, looked for info online, and tried playing with debuggers and programming stuff, but nothing seems to click.

Is there perhaps a simpler approach I could take, or a particularly intuitive tutorial someone could recommend?

Thankyou

http://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/0735611319/ref=sr_1_1?ie=UTF8&qid=1306226404&sr=8-1

Is a very good book for architecture in general.

But essentially memory is just a collection of circuits organized in rows and columns that "remember" the input. Input being 0 or 1. There is really nothing extraordinary happening.

try this. there is a tape somewhere there. be patient, if you get through this.. then pick any popular computer architecture book. i recommend this.

Edit

ofcourse you'll need more source than just a wiki page. here. this should take only a couple of months.. but its worth it.

During debug, why is it when you look at a GUID object, there are strange variables inside the non-public members? This is what is shown in my debug for:

guid={7b15cd1-69f3-e2111-bd64-001dd8b82a4f}

_a  = 2065026481
_b = 27123
_c = -7663
_d = 189
_e = 100
_f = 0
_g = 29
_h = 216
_i = 184
_j = 42
_k = 79

It is not that strange. Fire up the Windows calculator by running Calc.exe. Click View + Programmer to select the built-in StackOverflow User Mode. Type '2065026481' and click the Hex radio button. Notice the similarity to the first part of the {guid} value.

Repeat for the other parts, you'll see the match.

Hexadecimal is the programmer's way to count with 16 fingers instead of 10. Having 16 fingers is a much better match for the way computers are built. They use a power of 2, not 10. Just ones and zeros, one hex digit covers 4 bits.

The bigger conclusion to draw from this is that a Guid is not just a random number. It is made up from parts. Those parts have a meaning, you can read RFC 4122 if you want to get to the bottom of it. Which is a good idea if you want to learn the way the machine works. Every carpenter should know how a hammer works. But they have to understand the nail first, I recommend this book to know what the nail looks like.

I want to go backwards and learn more about how compilers, processors and memory operate on my programs. I am also interested in the physics on which all of this depends. Any good references or books would be appreciated...

Pick up a book on "Computer Organization" or "Computer Architecture" on Amazon. This is what we used when I was in college. It's not too thick, and will give you the basics, from the gate level all of the way up to how memory is organized and programs are written. If, after this, you want to look deeper into the physics, then you'll want to pick up a book on semiconductor physics. (But if I were you I'd just start by looking up "logic gate", "diode", and "transistor" on wikipedia!)

Feynman has a nice bit on the Physics of Computation:

which addresses the second part of your question.

My first suggestion was going to be Code which has been suggested already. A better, but harder, book on the subject of processors is Computer Organization & Design by Hennessey & Patterson. You might look for an older edition on Amazon or Half.com. They'll be a lot cheaper and have basically the same information.

These will both teach you the basics of how a processor works, assembly language, etc. This will help you understand how your program will be interpreted and thus, what sort of performance bottlenecks might exist based on your design.

When timing certain processes, is it possible for either "user" or "system" time to be absolutely zero?

That is, the program does not spend time at all either outside or inside the kernel. Does such program exist?

No, there is no way for a program to take Zero Time. Even a one bit change takes a full clock cycle.

I suggest reading Code by Petzold

My question is simple because I am a beginner, so Can I program a full computer system with only using C++ language? Thanks.

You may be interested in this book. It explains how computers work, going from the lowest hardware level to a code. Cannot recommend it enough!