Do students need traditional books? Do students need books to learn in courses? For example, I found that books often contain some mistakes and therefore it is better for me to study those things on the Internet where I can concentrate on one thing, learn the best knows methods of that subject and then move to the next. Okay, that course wasn't really advanced.

But if you have to decide whether one should write a traditional book or editable lecture notes like in http://stacks.math.columbia.edu/, which one would a lecturer choose?
No, Students don't need a book. They DO need good resources. 

Maybe its an eBook or a PDF compiled from your teaching notes or outline/slides (Hopefully cited well) and things like short stories needed for a language class can often be found online in their entirity, for free legally, when copyright has expired. 

For a language class, using a Sherlock Holmes story could prevent students from needing to buy a book as they're out of copyright. You can also look for material that is licensed as Creative Commons which allows for free use, such as material from MIT open courseware, Khan Academy, and P2P Univerity. You can learn more about Creative Commons for Education here.

Long story short, make good content, and use it legally, either by using stuff people have given to the public, or under doctrines such as Fair Use.