📜 ⬆️ ⬇️

About the book “MS Visual C ++ 2010 in the .NET environment. Programmer’s Library

If you look at my book reviews (*), you may be suspected of bias, because the reviews are either positive or enthusiastic. This situation is explained quite simply: before embarking on reading a book, it is wise to perform “reconnaissance by force” and find out how useful and actual reading of a particular book is. If the reviews on the book are good, the author inspires confidence, and the topic is interesting, then there is every chance that you will not regret the lost time. If the reviews are purely negative and for a mile, they are drawn by the “For Dummies” presentation style in the worst sense of the word, then you should not waste time on such a book.

Today there will be an exception to this rule, primarily due to the fact that it is not really a review, but the results of the above-mentioned “reconnaissance in force”, but it was more than enough to form a very specific impression of this creation.

--------------------------------

image
Periodically, I look through the novelties that our domestic publishers indulge us in. And the other day I saw that Peter’s publisher published a book called “MS Visual C ++ 2010 in .NET” from the “Programmer’s Library” series (**) about Visual C ++ from Ziborova V.V. Since the fact that a book was published in such a series means a lot, then I was not too lazy to read the abstract, scroll through the content and a fragment of one of the chapters, and this is what I think about it.
')

1. Name and abstract



The name of the book, as well as its cover, is an important part of any book, since it is from them that the potential reader becomes acquainted with it. In this case, it is desirable that the title gives at least a minimal idea of ​​what the reader expects inside, and the look on the cover does not dislocate the eye. The title of this book hints that it will deal with C ++ / CLI (this is confirmed by the abstract), but what it doesn’t say is that the book is a collection of recipes.

Easy googling by the name of the author makes it clear that this is not the first creation of Comrade Ziborov; in addition to this book, he has two more: “ Visual Basic 2010 with examples ” and “ Visual C # with examples ” and even a cursory reading of annotations makes it clear that these are three acrobat brothers packed in different guises. However, in contrast to the two previous books published by the publishing house BHW-Petersburg, the comrades from the Peter publishing house decided not to scare potential readers with all sorts of “examples”, but to call the book more streamlined, which is quite logical.

Quote: "There are many different authors' original solutions to programming problems that the reader cannot find on the Internet."

Creator annotations frankly zhzhot. I understand everything, each of us has a tendency to exaggerate, but to write that there is an “original author's solution” in the collection of advice, this is an obvious search. Anyway, how in our age of the Internet can we talk about unique solutions that can not be found on the Internet? After all, if they are so unique, then they will be trumpeted in all known software development forums and in a week they will cease to be unique. Although, it must be admitted, the “unique” tips are really present in the book, but more on that later.

2. Content



The following, after the title of the book and a short annotation, is the table of contents. Often it is the table of contents, and not a summary, that makes it clear to the reader what is waiting for him inside. The reader can get an idea of ​​what he will receive as a result of what topics will be considered, how much is devoted to these or other sections in order to estimate more precisely what is at stake and what is the depth of the material under consideration.

Even if the book is based on examples, it is desirable that they be grouped in such a way as to simplify the perception of the new material as much as possible. So, for example, it is reasonable at one point in time to give a minimum of new concepts, considering topics from simple to more complex, considering the most coherent concepts in one chapter. This will allow the reader to "immerse" in the topic under consideration and "abstract" from unnecessary details, focusing on the most important thing.

Now let's look at the content:

Chapter 1. The simplest program with a screen form and controls.

...

Example 6. Controlling font style with a CheckBox control

Example 7. Bitwise XOR operator

Example 8. TabControl tabs and RadioButton switches

First of all, start to get acquainted with a new programming language (and judging by the annotation, this is one of the target audiences of the book) from the user interface, and not from a simple console application? I know that there is a category of readers who, with minimal effort, want to see a “finished application”, but what does this have to do with C ++ / CLI? Indeed, in this case, the reader becomes acquainted not only with the new programming language, but also with the Win Forms library, which greatly complicates the perception of the material.

Then, I do not understand the grouping of topics. Well, who then will guess to find an example with “exclusive OR” in the chapter on “the simplest programs with a screen form”, and even between examples with CheckBox and TabControl? And in general, since they took up bit operators, it is wise to follow through and consider them all.

Chapter 2. Console Application Programming ... 47

Example 12. Input and output in the console application ... 47

...

Example 14. Calling the MessageBox :: Show method in a console application. Date and time format ... 51

Example 15. Calling Visual Basic Functions from the C ++ Program ... 52

Example 16. Dictionary is a remarkable data structure ... 53

It is hard for me to imagine how much completely heterogeneous information leans on the poor reader on just a dozen pages of the book (I specifically cited the page numbers). What is the value of considering the date and time format in the MessageBox example, and also in the chapter on console applications? And what is the use of calling Visual Basic functions from the C ++ program? Something seems to me that this is not the most common task and it does not help in any way to advance in learning the C ++ language. And the name of example 16 is generally similar to the phrase “C # in 15 minutes” that was unsuccessfully translated by an electronic translator.

Do you know why John Skit’s “C # In Depth” book reads so easily? For one simple reason: John examines one concept at a time (his famous phrase “one step at a time”, which he uses a dozen times in his book). This allows the reader to "abstract" from unnecessary details at a given time and focus on the main thing: the study of a particular concept of language. In programming, we constantly act in the same way to combat the inherent complexity of software; because we are guaranteed to get a “mass” if we dump dozens of unrelated concepts into one entity.

Chapter 12. Other tasks solved using Windows Application

Example 98. Form transparency control

Example 99. GMT time in translucent form

Example 102. Playing operating system sounds

If in the chapters devoted to a specific topic there was a leapfrog, then what about a chapter that is specifically devoted to everything at once. When the reproduction of sounds (by the way, is also a very dubious topic) is considered alongside GMT, and even in a translucent form, it causes at least a smile. Is it really not possible to get at all Greenwich Mean Time in an opaque form or without a form?

Between chapters 2 and 12, the author considers almost all the topics on which Troelsen took about a thousand pages: from working with files, finishing with ADO.NET technology and using AutoCAD functions and creating a PDF file. Apparently, interaction with AutoCAD is really a killer feature, since this is stated in the annotation, but for some reason it seems to me that this is not such a frequent task, but oh well, this is a matter of taste. Go ahead. More precisely, we are going back one chapter, to which I want to devote a separate section.

3. Chapter 11. Using LINQ technology .

This chapter should be given a separate section for two reasons. Firstly, in C ++ / CLI there is no syntactic sugar for creating anonymous delegates (C ++ 0x lambda doesn’t count, this is quite another matter), which makes using LINQ very ... let's say, a wordy thing. And secondly, it is this chapter that is openly accessible on the publisher's website, so that we can get acquainted not only with the content, but also with the content.

Since this book is still a collection of examples, let's immediately consider the beginning of one of them:

bool ( String ^ S)
{
// , true:
bool A = false ;
if (S->Length == 6) A = true ;
return A;
}
String ^ 2( String ^ S)
{
// :
S = S->ToUpper();
return S;
}

* This source code was highlighted with Source Code Highlighter .


So, the annotation says that this book is intended “for novice programmers, intermediate level programmers, as well as for programmers who have experience developing in other languages ​​and who wish to master the new language MS Visual C ++ / CLI at an accelerated pace.” But here, in a dozen lines of code, a whole bunch of "smells":

  1. use of Russian names ;
  2. use of non-informative names of functions and variables ; never, never, never, no, you did not understand, never call in this way the names of functions and variables ; This is a bullshit, not having the right to exist even in the examples! The funny thing is that the very first section of this book is called: What is a “good programming style”? Apparently the author took the last three words in quotes intentionally. What are the names for Predicate and Predicate2, and how can the reader be helped by the name of variable A?
  3. change the value of the parameters ; I remind you that changing the value of the parameters is considered a move, since the reader of the code must clearly understand that the original object S in the Predicate2 method has not changed, since the link itself is passed by value.
  4. invalid naming style; Parameters and local variables in the .Net environment are commonly referred to as camelCase, names like S and A contradict this rule.
  5. Predicate2 is not a predicate ; for example, it always seemed to me that the predicate is such crap that returns true or false , and fast googling confirms this opinion .


I'm not talking about the fact that you can reduce the number of lines in the method from 3 to one:

bool LengthEqualToSix( String ^ s)
{
return s->Length == 6;
}

* This source code was highlighted with Source Code Highlighter .


Next comes the use of all these “predicates” using the static methods of the Enumerable class. But since in the C ++ / CLI language there are no such things as extension methods and Method Group Conversion, this is not the best way to see it:

// , - :
auto = Enumerable::Where< String ^>(, gcnew
Func< String ^, bool >());
// :
= Enumerable::OrderBy(, gcnew
Func< String ^, String ^>(2));

* This source code was highlighted with Source Code Highlighter .


There are other pearls, such as defining a field named: bool Smokes; in the Employee class, or creating a list of employees by an array of employees before using the methods of the Enumerable class (apparently the author does not know that the static methods of the Enumerable class are applicable to the array in the same way as the sheet); and predicates of the following form:

bool ( S)
{
// , :
bool A = false ;
if (S. == false ) A = true ;
return A;
// :
// return !S.;
//
}

2( t)
{
return t;
}

* This source code was highlighted with Source Code Highlighter .


What the author did not like the alternative entry and why the variable of the Month type is called t, and why only in this case the variable name is written in lower case, I do not know.

Conclusion



I want to be understood correctly: I have not the slightest complaint about the author, who wrote one book and replicated it, using examples in different programming languages. And I would have no questions for the publisher if the cover of this book were yellower and it appeared in the series For Dummies. But to produce SUCH in the popular and well-known series, along with the famous works of such world-renowned experts as Spolsky, Box, Hunt, McConnell and many others, it seems just a crime.

Guys, publishers, there are a lot of interesting books on programming on the .Net platform, including in C ++ / CLI, which can take a worthy place in the programmer’s library, but this book is clearly not one of those (***).

As for the potential reader, I simply don’t see it for this book: the examples in the book are too low in quality to be used even by a beginner, and the style of narration and grouping of the material is such that they hardly linger in the head of an unprepared reader. The reader will be prepared to treat this book more like a humorous book, rather than like a book on programming.

Yes, I almost forgot not to rummage for a long time, here’s the content , but here’s a fragment of the chapter .

---------------

(*) All my reviews, as well as some reviews and book announcements can be found here .

(**) It must be said that this series includes quite good books, such as Ekkel's Java Philosophy, Martin's Pure Code, Design Patterns, a gang of four, and many others. I mean, this is not a series like “Learn everything in 15 minutes in a dream”, this is quite a serious series of books.

(***) As a starting point when searching for books on programming on the .Net platform, you can build on the following list: Classic books on C # /. NET .

Source: https://habr.com/ru/post/126926/


All Articles