Suggestions For The Next Edition

  • Please log in to reply
1 reply to this topic

#1 J+Schmidt


    New Member

  • Members
  • Pip
  • 1 posts

Posted 09 August 2014 - 12:39 AM

I've worked through the book up to the first lab - A Day at the Races - and I'm stuck. I haven't got a clue where to start, all I've got is the code snippets from the book. Is it supposed to be that hard, or am I missing something? Do I need to go back and re-read the chapters I've already done?

This is the first time learning a programming language and I felt like I was doing ok up until this point.

Hi Andrew, I wanted to quote the last post because this is exactly where I ran into a brick wall too. I got to the first lab and I had to give up on your book because I couldn't make sense of it. There were multiple interdependent classes and code diagrams that looked like exploded octopii. I stared at it for weeks, looked at solutions online and then I had to give up and try another book.

I looked up and found a free online collaborative textbook on C# written by Svetlin Nakov and many other authors. It's name is Fundamentals of Programming with C#. Please look it up. It's not a professional book at all. The authors are Bulgarian and English is their second language and this is obvious throughout the book. But, it has one amazing feature at the end of every chapter. 15-20 Exercise questions and hints to solving them.

I'm going to post a few exercises and their solutions from chapter 3:


2. Write a Boolean expression that checks whether a given integer is divisible by both 5 and 7, without a remainder.

9. Write an expression that checks for given point {x, y} if it is within the circle K({0, 0}, R=5) and out of the rectangle [{-1, 1}, {5, 5}]. Clarification: for the rectangle the lower left and the upper right cornersare given.

14. Write a program that checks if a given number n (1 < n < 100) is a prime number (i.e. it is divisible without remainder only to itself and 1).


2. Use a logical "AND" (&& operator) and the remainder operation % in division. You can also solve the problem by only one test: the division of 35 (think why).

9. Use the code from the previous task and add a check for the rectangle. A point is inside a rectangle with walls parallel to the axes, when in the same time it is right of the left wall, left of the right wall, down from the top wall and above the bottom wall.

14. Read about loops in the Internet or in the chapter “Loops”. Use a loop and check the number for divisibility by all integers from 1 to the square root of the number. Since n < 100, you can find in advance all prime numbers from 1 to 100 and checks the input over them. The prime Chapter 3. Operators and Expressions numbers in the range 1…100] are: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89 and 97.

The first few questions are easy, and then it gets harder. The last few questions are outside of the scope of the chapter. (Note that the hint for question 14 asks me to read another chapter and learn some concepts to finish this problem.) The textbook told me to look up classes and methods on MSDN and ask questions on stackoverflow if I get stuck.

Andrew, I want to give you some constructive criticism, so please don't be offended. After I did some chapters of Svetlin's book, I realized (I could be wrong) but I'd never been forced to try writing my own program from scratch when using your book. I had never been given a general problem like question 14. The first time I had to write a real program in your book was in Lab 1 and that was a full, multi-class complex program. That's why I couldn't do it.

Nakov's book is very traditional when it teaches ideas. Your book is better at teaching concepts. But your book uses all these weird pool puzzles and other fancy stuff to teach me HOW to program. But they don't work. I spent months on your book but when Nakov's book asked me to write a Hello World program from scratch, I realized that I didn't know how to structure the program. HFC# kept asking me to copy code into VS so I could learn how it worked, but after months of it, I didn't know that a namespace came first, the class second and Main method inside the class. I knew it theoretically, but when I was asked to write a program, I realized I didn't know.

There's that Chinese saying: I hear and I forget, I see and I remember, I do and I understand. Your book uses a very untraditional format and it's great at conveying concepts. It's good at actively teaching how code works. But learning code concepts is only the first part. The second part is forcing the student to learn to employ those concepts. For me, it requires repetition. I had to write out the namespace, class and Main methods many times before I stopped forgetting one of them and started to actively understand why they were there. I've heard someone say that you have to put in 100,000 lines of code to learn your first language. I think it's true.

Andrew, please look at Svetlin's book and the exercises section. If you can, please include 20 or 30 questions and hints at the end of each of your chapters in the next edition. Your book is a lot like a martial arts teaching video. No matter how good it is, unless the student stops watching TV and starts training in his basement, he's not going to become a martial artist. Pool puzzles and fill in blanks question are not helpful to a new comer to programming. Your book is really great at explaining concepts, but a programming is an art, and an artist becomes good only through a lot of practice. You must place obstacles that are challenging enough in front of the student. HFC# doesn't really do that til Lab 1 and that problem is way too hard for someone who hasn't been asked to write a basic program that solves an integer division problem.

Sorry for the length.

#2 AndrewStellman


    Andrew Stellman

  • O'Reilly Author
  • PipPipPipPipPipPipPipPipPipPipPip
  • 832 posts
  • Gender:Male
  • Location:Brooklyn, NY
  • Interests:Author of: "Head First C#", "Beautiful Teams", "Head First PMP", "Applied Software Project Management"

Posted 09 August 2014 - 08:23 AM

I'm glad you found another book that works with your learning style. Everyone learns differently, and many thousands of people have learned C# using our book. But while I would love it if every aspiring C# programmer buys Head First C#, the truth is that different people learn in different ways. I don't know of another book that gives readers as much practice coding as ours does, but if another book helped you, that's fantastic, and I'm glad that you let people know that it's out there for people who need a different teaching style than ours.

Please keep in mind that there's no rule that says that you can't use more than one book. Something I learned from my own many years of martial arts training is that often a technique is confusing at first, and makes sense only after you've seen it from a few different perspectives. I think the same thing is true of programming, and learning from more than one book is a good way to help provide that perspective.

My recommendation is that if you've found a book that works for your learning style, you take all that you can from it, and then in a few months come back to Head First C# -- and this time, do every one of the programming exercises without looking at the solutions. Because just like with martial arts, sometimes really learning something well means taking yourself out of your own comfort zone. I bet Lab 1 will seem much simpler by then.

If that works for you, I'd really like to hear about it.

Good luck with your C# learning!
Andrew Stellman
Author, Head First C#
Building Better Software --

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users