Thanks for sharing this point. As I experienced it I was impressed about how its helps. Either you directly use what you've learnt in a different context, or at least you gain confidence for your learning journey. I'm now a bit more convinced that this is the way to go. Very inspiring!
Рік тому+1
I was one of those that copy/paste a lot of lines of code. What a beautiful moment when I found about purrr::map() family functions. Thanks for sharing!
By always looking for the most general solution, you can actually make it worse. This can happen because the right level of generality is not always obvious. Committing to a particular programmming ideology (FP, OOP) early on will 1. require the computer to do additional work not needed to solve your problem (i.e. introducing type checking when your code doesn't need it or calling constructors) 2. make more it difficult add more functionality later, because you'll probably need to break up your "neat" little abstractions (usually functions or perhaps even classes if your one of those message passing OOP types). And if your code is *really* performance critical R should not be your language of choice. Generally I think the best way is to start with a more procedural style and then abstract whenever it becomes clear, that you would need to repeat yourself. Also, checkout Brian Will's videos.
I have a question for you; maybe you are the most relevant person to start this conversation with: why do courses/tutorials on R loops focus on base for loop while for the long-run progress one ought to use foreach anytime s\he can? I am prising foreach because of efficiency concerns + parallelization possibilities
Really depends what you want to teach. If you’re simply focusing on teaching the concept of repeating a computation, then simply using the base for/while loop is enough. But I agree that teachers/trainers should, at the end of such a chapter focusing on loops, at least mention the possibility to run loops in parallel.
All the best Bruno, you are a source of inspiration.
Thanks for sharing this point. As I experienced it I was impressed about how its helps. Either you directly use what you've learnt in a different context, or at least you gain confidence for your learning journey. I'm now a bit more convinced that this is the way to go. Very inspiring!
I was one of those that copy/paste a lot of lines of code. What a beautiful moment when I found about purrr::map() family functions. Thanks for sharing!
I'm watching your videos and I'd say you're doing a great job!
By always looking for the most general solution, you can actually make it worse. This can happen because the right level of generality is not always obvious. Committing to a particular programmming ideology (FP, OOP) early on will
1. require the computer to do additional work not needed to solve your problem (i.e. introducing type checking when your code doesn't need it or calling constructors)
2. make more it difficult add more functionality later, because you'll probably need to break up your "neat" little abstractions (usually functions or perhaps even classes if your one of those message passing OOP types).
And if your code is *really* performance critical R should not be your language of choice. Generally I think the best way is to start with a more procedural style and then abstract whenever it becomes clear, that you would need to repeat yourself. Also, checkout Brian Will's videos.
Nice tip. I would say that this mentality it's a programatic approach to problems.
Bruno I miss your contact! Most advanced R topics
More to come!
good channel
ain't this the truth!
I have a question for you; maybe you are the most relevant person to start this conversation with: why do courses/tutorials on R loops focus on base for loop while for the long-run progress one ought to use foreach anytime s\he can? I am prising foreach because of efficiency concerns + parallelization possibilities
Really depends what you want to teach. If you’re simply focusing on teaching the concept of repeating a computation, then simply using the base for/while loop is enough. But I agree that teachers/trainers should, at the end of such a chapter focusing on loops, at least mention the possibility to run loops in parallel.
I was here!