At the moment I am reading Schildt in C #. But as you know, the theory needs to be combined with practice and it is useful to write a curriculum that covers several topics of the textbook at once. I am already finishing reading the chapter on events. I chose several options for applications that I want to write. It happens that the read theory does not make sense to use in the program. And if you do not practice, the reading is forgotten. The question arises how, in this case, to combine theory with practice. In fact, I read a textbook every day and then I write something.

    2 answers 2

    Writing study programs covering many chapters at once is, of course, useful. This will teach you how to structure the program correctly, think about architectural moments in advance and develop a good style. But you are almost guaranteed not to need 80% of the subtle points that the language carries. And if now your goal is to study the language, I advise you to use any ambiguity in the book, as a reason to turn to the compiler.

    For example, you are studying events now. Try to find out with the help of the compiler:

    1. Whether a subscription to an event in an accessible object is a bailout from the garbage collector.
    2. Try to implement your "weak subscriptions" through delegates and WeakReference , which will not have this property.
    3. Try to subscribe one event to another.
    4. And so forth

    The task list is limited only by your imagination.

      Any theory is a basis for practice, a base so to speak. Naturally, without practicing something, you gradually forget it. However, it is necessary to write curricula not only to memorize the theory well, but also to develop thinking on the “wave” of a particular programming language. They say that you remember spoken languages ​​well when you start thinking about them!) In programming as well.