I truly want to dive into functional programming and design. Your videos and your sense of humor are remarkable and keep me watching you. Thanks for sharing your knowledge and experience.
Would love a video on how you extracted the best parts from Bertrand Meyer’s “Object-Oriented Software Construction” book. It’s a bit dense, but I have the sense that there are some powerful concepts in there, which you seem to have mastered. Great content as always!
Unrelated to the topic, but I really must commend how in each video you have your own captions instead of the generated ones. Coming from the same region as you, I am used to captions, although they are unnecessary as you speak clearly and proficiently, but it helps. Please, keep up the good work!
@@zoran-horvat I appreciate that as none-native speaker. 😊 Beside, each content has absolutely gold level of advice that I can’t afford easily from other. It’s like I’m having a programming mentor right next to me. Ha ha so goood it’s lucky to found this channel
@@perfumedeath6042 You can return favor by sharing it around :) But thank you for saying it. It makes me feel good to know that this content is helping others.
I appreciate your efforts in showcasing techniques for a more robust design. I had a question-what would be your opinion on overloading the "+" operator to append citations in the Citation class besides the Append method? This would allow the code to be written as: author1 + ", " + author2
I am generally avoiding to overload arithmetic operators in non-arithmetic problems. It is not possible to pass the operator around or to call it like a method. Its return type can also be confusing, in cases when it is not closed on the type that defines it. None of those issues exist with methods.
I have a habit to stay away from public fields that are not primitive types. I would rather make it a singleton property. .NET Runtime guarantees singleton properties initialised using the initialiser are thread-safe, and JIT compiler should be able to inline them in all places where they are used. Therefore, the performance should be the same as in the public readonly field.
@@RoozbehHosseiny Yes. I thought whether to bother with that or not, but now I think that maybe I should have. Your suggestion is a good one because singleton root objects, such as Empty, are perfectly aligned with immutable classes. The collection I use inside has its Empty singleton. By the way, the ImmutableList's Empty is a static readonly field, just as you suggested. I still think, however, that exposing the root element as a field is more suitable to libraries than to the domain code, mostly for psychological reasons.
Makes sense. The other reason to use methods with side effects is speed, often producing measurable improvement in CPU-bound algorithms. But in common scenarios of the kind read the database, calculate, dump it out - immutable design rules there.
@@zoran-horvatMy take: If you don't have SLAs, don't bring up 'performance' as a constraint. I've seen this trotted out 1000x for every time it's actually measured, and even less when it actually mattered! 'Faster' isn't a goal, fast enough to solve the problem, within budget, is. At that point, maybe a VM based, GCd language isn't the right choice at all. But we won't know until 'faster' is defined.
@@adambickford8720 I agree with that. A detail that is often ignored when talking about performance is network and database latency. While they are well inside the milliseconds range, the core execution of any functionality that consists code in a higher-order language will probably be microseconds. Any debate is futile until this time becomes comparable to communication latencies, and even that only after it causes concern to the customer.
Enroll video course *Beginning Object-Oriented Programming with C#* ► codinghelmet.com/go/beginning-oop-with-csharp Download the source code: www.patreon.com/posts/source-code-for-91115225 Learn from related videos: Clean Code Tip: Favor Method Chaining Over Nested Calls ► th-cam.com/video/zWn0O0xzWMA/w-d-xo.html Avoid Returning Null From Methods - There Is a Better Way To Write Them! ► th-cam.com/video/HRLdcMil7Ec/w-d-xo.html Master the Builder Pattern: The King of Creational Design Patterns in C# ► th-cam.com/video/3p93Q6ivbZ4/w-d-xo.html
Out of my dreams.. we use builders a lot to minimize business rules and then an interpreter to execute them. It's refreshing to see someone who has the brains, experience, and ability to convey useful knowledge... Thank you, sir.
for more than 2 authors this will be quite wasteful, converting rest of the authors even though they won't be used, ToCitations should be rewritten to ienumerable
That is an optimization in the microseconds spectre, where loading the authors from storage is in milliseconds. Any discussion about time spent to format output is irrelevant in any realistic database application.
@@zoran-horvat the feeling you described at beginning, that you weren't happy with the state how you left the code, this solution would keep me up and awake till i fix it, this time it is microseconds, but there will be time when this kind of thinking will get your in trouble, when you wave your hand at microsecond optimalization and then forget that it will repeat million times in some case.... All i'm saying is that i hate leaving code with visible flaw
Just feedback. Narrating the video like you're preaching or telling a story makes it hard to follow. I end up looking at your face rather than the code because the narration draws the users attention to the speaker. Also the code, perhaps should be simpler and more matter of fact, showing exactly how you transform a class with a complicate format method into one that simply returns a copy of itself with an append method that also takes itself. Good content tho.
An honest-to-goodness Google search about trying to understand fluent interface design brought me here. For me, this was spot-on. The narration is super impactful to me and resembles the kind of narration I have in my head while I work. It has some bravado, but there are good reasons for great code to feel profound. Edit: aftwr watching a few more videos, I'm convinced was wrong. The preachiness you talked about is really there. Shaming people for still feeling pain because they don't know a solution exists is... I dunno, less useful than celebrating the fact that the solution exists? Making the viewer defensive makes learning an uphill battle.
I truly want to dive into functional programming and design. Your videos and your sense of humor are remarkable and keep me watching you. Thanks for sharing your knowledge and experience.
Glad to hear it was useful to you. Keep learning!
It's a shame you don't have more views, this channel is goldmine
They will come.
Would love a video on how you extracted the best parts from Bertrand Meyer’s “Object-Oriented Software Construction” book. It’s a bit dense, but I have the sense that there are some powerful concepts in there, which you seem to have mastered. Great content as always!
Oh, that would be a worthy task! The OOSC book is packed with wisdom.
@@zoran-horvat it would make a fantastic series!
Unrelated to the topic, but I really must commend how in each video you have your own captions instead of the generated ones. Coming from the same region as you, I am used to captions, although they are unnecessary as you speak clearly and proficiently, but it helps. Please, keep up the good work!
That costs me nearly an hour of work per video :)
Indeed. The auto generated ones are often incorrect in both content and timing, the quality difference is pretty huge if you're paying attention.
@@zoran-horvat
I appreciate that as none-native speaker. 😊 Beside, each content has absolutely gold level of advice that I can’t afford easily from other. It’s like I’m having a programming mentor right next to me. Ha ha so goood it’s lucky to found this channel
@@perfumedeath6042 You can return favor by sharing it around :) But thank you for saying it. It makes me feel good to know that this content is helping others.
Fluent API is awesome. Makes code way easier to read and understand :)
Thanks for yet another useful tutorial 👍
You are my inspiration. I want to be as good as you
Thank you very much Sir, I am from Kolkata City , India🙏🙏
I appreciate your efforts in showcasing techniques for a more robust design.
I had a question-what would be your opinion on overloading the "+" operator to append citations in the Citation class besides the Append method? This would allow the code to be written as:
author1 + ", " + author2
I am generally avoiding to overload arithmetic operators in non-arithmetic problems. It is not possible to pass the operator around or to call it like a method. Its return type can also be confusing, in cases when it is not closed on the type that defines it. None of those issues exist with methods.
Thanks a lot for this awesome video .
but why you did not use public readonly static Citation Empty = new Citation(...); ?
I have a habit to stay away from public fields that are not primitive types.
I would rather make it a singleton property. .NET Runtime guarantees singleton properties initialised using the initialiser are thread-safe, and JIT compiler should be able to inline them in all places where they are used. Therefore, the performance should be the same as in the public readonly field.
@@zoran-horvatThanks for reply. But when ever we call Citation.Empty it will create a new instance of Citation. am I right ?
@@RoozbehHosseiny Yes. I thought whether to bother with that or not, but now I think that maybe I should have.
Your suggestion is a good one because singleton root objects, such as Empty, are perfectly aligned with immutable classes. The collection I use inside has its Empty singleton.
By the way, the ImmutableList's Empty is a static readonly field, just as you suggested. I still think, however, that exposing the root element as a field is more suitable to libraries than to the domain code, mostly for psychological reasons.
Is there any channel that is equivalent to this one but in Java programming language?
That is a good question!
"Look, Ma! It's a monad!"
I'm at the point where i consider `void` a code smell unless it's explicitly I/O.
Makes sense. The other reason to use methods with side effects is speed, often producing measurable improvement in CPU-bound algorithms. But in common scenarios of the kind read the database, calculate, dump it out - immutable design rules there.
@@zoran-horvatMy take: If you don't have SLAs, don't bring up 'performance' as a constraint. I've seen this trotted out 1000x for every time it's actually measured, and even less when it actually mattered!
'Faster' isn't a goal, fast enough to solve the problem, within budget, is. At that point, maybe a VM based, GCd language isn't the right choice at all. But we won't know until 'faster' is defined.
@@adambickford8720 I agree with that. A detail that is often ignored when talking about performance is network and database latency. While they are well inside the milliseconds range, the core execution of any functionality that consists code in a higher-order language will probably be microseconds. Any debate is futile until this time becomes comparable to communication latencies, and even that only after it causes concern to the customer.
Enroll video course *Beginning Object-Oriented Programming with C#* ► codinghelmet.com/go/beginning-oop-with-csharp
Download the source code: www.patreon.com/posts/source-code-for-91115225
Learn from related videos:
Clean Code Tip: Favor Method Chaining Over Nested Calls ► th-cam.com/video/zWn0O0xzWMA/w-d-xo.html
Avoid Returning Null From Methods - There Is a Better Way To Write Them! ► th-cam.com/video/HRLdcMil7Ec/w-d-xo.html
Master the Builder Pattern: The King of Creational Design Patterns in C# ► th-cam.com/video/3p93Q6ivbZ4/w-d-xo.html
Out of my dreams.. we use builders a lot to minimize business rules and then an interpreter to execute them. It's refreshing to see someone who has the brains, experience, and ability to convey useful knowledge... Thank you, sir.
Go meet your maker 😂
I just couldn't resist.
for more than 2 authors this will be quite wasteful, converting rest of the authors even though they won't be used, ToCitations should be rewritten to ienumerable
That is an optimization in the microseconds spectre, where loading the authors from storage is in milliseconds. Any discussion about time spent to format output is irrelevant in any realistic database application.
@@zoran-horvat the feeling you described at beginning, that you weren't happy with the state how you left the code, this solution would keep me up and awake till i fix it, this time it is microseconds, but there will be time when this kind of thinking will get your in trouble, when you wave your hand at microsecond optimalization and then forget that it will repeat million times in some case.... All i'm saying is that i hate leaving code with visible flaw
Just feedback. Narrating the video like you're preaching or telling a story makes it hard to follow. I end up looking at your face rather than the code because the narration draws the users attention to the speaker. Also the code, perhaps should be simpler and more matter of fact, showing exactly how you transform a class with a complicate format method into one that simply returns a copy of itself with an append method that also takes itself. Good content tho.
An honest-to-goodness Google search about trying to understand fluent interface design brought me here.
For me, this was spot-on. The narration is super impactful to me and resembles the kind of narration I have in my head while I work. It has some bravado, but there are good reasons for great code to feel profound.
Edit: aftwr watching a few more videos, I'm convinced was wrong. The preachiness you talked about is really there.
Shaming people for still feeling pain because they don't know a solution exists is... I dunno, less useful than celebrating the fact that the solution exists? Making the viewer defensive makes learning an uphill battle.
This Book application has to be one of the most over-engineered applications in the world.
Thank you stopping by.