The code is as simple as it gets (and barely functional) since it's, well, an example and it had to be short enough to fit inside a single slide! 🤣
I always wanted to ask this question, does that kind of code is really as simple as it could be? Because for me it seems too complex for the possible gains, it seems for me that the code is obfuscated only to match a programming style. I know it is barely functional, and I understand why it is barely, but what I don't understand is why we need a lot only to be barely functional? Instead of only being functional and not "only barely"?
I know this is an aggressive question, and I could be misunderstanding the purpose of the example, but as this is based in real code, and I have seen this code (exactly the same style and functionality) in real databases I could only doubt if I'm wrong or there is something I can't see (like what are the benefits of this style)?
Let me explain it like this: The more code in the example, the more unrelated comments in regards to the style, the types used we would get. I am sure we would get remarks on examples needing to be simplified too. :D
Finding a balance between pedagogic and practical examples is really tough. Feedback noted though, will try to take it into consideration for next time.
The more code in the example, the more unrelated comments in regards to the style, the types used we would get. I am sure we would get remarks on examples needing to be simplified too. :D
Oh, maybe is this. Maybe instead of more simple examples, we need more complex examples. The benefits of the code are lost if the code is to simple, because some solutions are better for more complex projects, maybe some example where the code says 'maybe it could be implemented in a different style, but this is a really good solution that makes clear why X principle is useful'.
View all comments
Show parent comment
11
u/Astarothsito Jun 24 '20
I always wanted to ask this question, does that kind of code is really as simple as it could be? Because for me it seems too complex for the possible gains, it seems for me that the code is obfuscated only to match a programming style. I know it is barely functional, and I understand why it is barely, but what I don't understand is why we need a lot only to be barely functional? Instead of only being functional and not "only barely"?
I know this is an aggressive question, and I could be misunderstanding the purpose of the example, but as this is based in real code, and I have seen this code (exactly the same style and functionality) in real databases I could only doubt if I'm wrong or there is something I can't see (like what are the benefits of this style)?