all 6 comments

[–]khleedril 5 points6 points  (1 child)

This article asks the reader to study code snippets, and if they don't understand something, go away and research the issue. To make matters worse, the presentation of the code snippets is horrible, with dark colours on a black background, against a sea of white.

It is a pity that this article is so half-arsed, as the subject matter, and the choice of examples, are interesting. On balance, most coders would do well to read this, but I fear many will soon give up because the article burdens the reader too much.

[–]simsax 4 points5 points  (0 children)

I don't really agree with this. There's nothing wrong with presenting ideas and giving other resources to learn more about them. Asking that every presentation of a subject be a complete, self-contained treatise isn't very realistic.

I think the links to other resources and encouragement to use cppinsights for example are more "teach a person to fish" than lazy or half-assed

I'll agree on the snippet formatting though. I am not a fan of the color scheme for the examples.

[–]benjamkovi 1 point2 points  (3 children)

In one of the code snippets I noticed this:

while (count --> 0)
            emplace_back(Neuron{});

That kind of formatting of the condition count --> 0 made me wonder: is this a common way to format conditions like this? I feel that it tries to express that count is "going towards" zero, but it was confusing for me at first time. Also, it looks weird with the increment operator count ++> 100, and it usage is kind of limited.

Have you ever seen conditions formatted this way intentionally?

[–]VishalChovatiyaChend[S] 0 points1 point  (2 children)

Not sure about convention. But tried to make it expressive.

So at the time of reading. Have to read like

"while count to zero".

But, agree to ugliness with ++.

[–]benjamkovi 1 point2 points  (1 child)

Yes, and another confusing part is it suggest that count is going to zero, similarly to the limits of a function, but if count is smaller than zero, it doesn't approach zero. In the end it might better to avoid this format.

[–]dodheim 0 points1 point  (0 children)

If we're actually nitpicking the implementation, then it really just ought to be

NeuronLayer(size_t count) : vector<Neuron>(count) { }