3:35 being one liner and multiple lines sometimes have nothing to do with code complexity. Also just because one use loops and the other uses recursion. It also doesn't say anything about complexity. But yes if you overengineer something it always tend to get more complex. "Complexity is not really about what type of coding someone use, but how someone use it. "
as a Cybersecurity specialist, gatta tell you, don't mistake simple code for vulnerable code. always have your input validations there. sometimes you need to cover all the possibilities. write simple, but also watch out for the part that can be broken by malicious fellas out there
0:50 this is a ridiculous code example, it is reductive beyond any measure. 3:40 you've made code much slower (and harder to step through in a debugger) by converting iteration into recursion. this is terrible advice
I was thinking the same. While I agree with the message of the video (keep things simple) the example at 3:40 is a bad one. I personally like recursion but it can easily make the code harder to read and debug. There's a reason why it's banned at NASA for example. Just because a piece of code became less lines it doesn't mean it's simpler.
@@jeffreyjdesir it's not subjective when you need the code working. i wouldn't say a thing if it was directory scanning or some parsing, because it can rarely get more than 20 frames deep. but in recursive math functions this is actually a practical consideration. Edit: i've checked and factorial(21) overflows uint64, so in reality stack depth is not even a top concern here.
that code will optimize into the same exact loop, so in practice it's not slower. the main reason to avoid recursion is because of weak devs who spent their whole careers avoiding recursion for no reason other than being scared to think, when they encounter it, their eyes go wide with disbelief, shock, and fear
if the engineers at OpenAI followed the "simplicity argument" the ChatGPT program would probably be the following code: def chat(input_dialogue): print("Hi, I'm ChatGPT. I may not know how to reply to '"+input_dialogue+"', but my source code is really simple to read. Just try it.") Hey, I just created the simplest AI in the world...
Yeah but sometimes you just have to check for possible scenarios. If you are paid to make an app and don't put some code to check if the user actually inputs a number and then the product is published, all the users who will not input a number will get errors. There will probably not be many of them but still your product would not be as good as if you had written just 2 more lines of code.
>be me >be 12 >try to write a program to use as a template for all my other projects >get stuck at the fps part >be stupid >calculate fps as the {sum of 1000/ms in each frame}/totalFramesCounted >leave it >wonder why am i getting -2³¹ fps if higher than a certain number >leave >enter, now a 13 year old >read my code >realizes I could've just used totalFramesCounted >realizes i was just dividing n² by n >realizes i was literally counting the frames in a second >fix it >leave >enter, now still a 13 year old but older >click on a video >it's about programming >gets the idea to type my encounter i had >types it out as a comment >pure satisfaction
@@o_glethorpe why would you think I'm trying to impress someone by my age?? anyways do they now actually teach programming in kindergartens or was that just some sort of an ego destroyer?
I think complex code is an intermediary step towards reaching simple code, and that's a bit in contradiction of what the video implies, the video implies that we pick complexity, not as a necessary evil (or an intermediary step) but that's just because we think is better I personally tried to write simple code from the very start and I'd just spend like x3ish the time to write the same end code because I would really wanna avoid complexity, but avoiding complexity as a middle step is fundamentally avoiding exploration and therefore understanding the problem becomes much slower
I like your channel, but you should spend some time on your English pronunciation. Most is good, but a couple sounds are off, notably the “sh” sound. You turn these into “s” sounds and it’s quite jarring. Function should be funk-shun instead of funk-son. That sh comes from starting with a closed teeth s, then drawing the tip of the tongue up and back without touching the roof of your mouth. It should soften that s and get you to the right sound. Keep it up!
Hmm, this is not really about me. I hope the best for codemunk. I do know that language barriers inhibit communication and limit reach. I’d like for his reach not to be limited by his presentation. If he doesn’t get any feedback of this sort, he won’t do anything about it. Problem is that native English speakers will notice it and will judge his videos on it. I’d prefer that didn’t happen. It’s literally just a couple small things because most of his pronunciation is perfect.
0:31 An idiot admires complexity, a genius admires simplicity
3:35 being one liner and multiple lines sometimes have nothing to do with code complexity.
Also just because one use loops and the other uses recursion. It also doesn't say anything about complexity.
But yes if you overengineer something it always tend to get more complex.
"Complexity is not really about what type of coding someone use, but how someone use it. "
A foolish admires complexity
A genius admires simplicity
as a Cybersecurity specialist, gatta tell you, don't mistake simple code for vulnerable code. always have your input validations there. sometimes you need to cover all the possibilities. write simple, but also watch out for the part that can be broken by malicious fellas out there
Agreed. Some early returns for checking state and arguments never hurts.
0:50 this is a ridiculous code example, it is reductive beyond any measure.
3:40 you've made code much slower (and harder to step through in a debugger) by converting iteration into recursion.
this is terrible advice
Tail call optimization and memoization help with recursive algorithms …it’s almost all subjective but comes down to what have you actually made 😮
I was thinking the same. While I agree with the message of the video (keep things simple) the example at 3:40 is a bad one. I personally like recursion but it can easily make the code harder to read and debug. There's a reason why it's banned at NASA for example.
Just because a piece of code became less lines it doesn't mean it's simpler.
@@jeffreyjdesir it's not subjective when you need the code working.
i wouldn't say a thing if it was directory scanning or some parsing, because it can rarely get more than 20 frames deep. but in recursive math functions this is actually a practical consideration.
Edit: i've checked and factorial(21) overflows uint64, so in reality stack depth is not even a top concern here.
I hate when someone does things like in 3:40, it's like writing a design, without an enter button.
that code will optimize into the same exact loop, so in practice it's not slower.
the main reason to avoid recursion is because of weak devs who spent their whole careers avoiding recursion for no reason other than being scared to think, when they encounter it, their eyes go wide with disbelief, shock, and fear
The factorial example isn't great since recursion is more prone to bugs and is harder to debug. Also making it a one liner is bad for readability
“Make it as simple as possible, but not simpler”
Albert Einstein
0:18 that dude is literally what I had and did a few hours ago xD
Train youself in test driven development and you'll have simple code not just for trivial functions.😢 And tdd is not about tests btw.
then what is it about?
Loved the video❤
if the engineers at OpenAI followed the "simplicity argument" the ChatGPT program would probably be the following code:
def chat(input_dialogue):
print("Hi, I'm ChatGPT. I may not know how to reply to '"+input_dialogue+"', but my source code is really simple to read. Just try it.")
Hey, I just created the simplest AI in the world...
"Build simplicity, then add lightness." --Colin Chapman, founder of Lotus
God, this video was so good!
Yeah but sometimes you just have to check for possible scenarios. If you are paid to make an app and don't put some code to check if the user actually inputs a number and then the product is published, all the users who will not input a number will get errors. There will probably not be many of them but still your product would not be as good as if you had written just 2 more lines of code.
Jack Dorsey said "To make something simple is not so simple"
>be me
>be 12
>try to write a program to use as a template for all my other projects
>get stuck at the fps part
>be stupid
>calculate fps as the {sum of 1000/ms in each frame}/totalFramesCounted
>leave it
>wonder why am i getting -2³¹ fps if higher than a certain number
>leave
>enter, now a 13 year old
>read my code
>realizes I could've just used totalFramesCounted
>realizes i was just dividing n² by n
>realizes i was literally counting the frames in a second
>fix it
>leave
>enter, now still a 13 year old but older
>click on a video
>it's about programming
>gets the idea to type my encounter i had
>types it out as a comment
>pure satisfaction
Can you name it simple 😅
@blossoms2u nah that's impossible
They teach programming in kindergartens now dude, nobodys getting impressed by your age anymore
@@o_glethorpe why would you think I'm trying to impress someone by my age?? anyways do they now actually teach programming in kindergartens or was that just some sort of an ego destroyer?
My take is simple code is easy to write, hard to think of.
My code is always simple.
Where ?? I dont get it, what engine does it use to program?
I try to avoid complex things what do you mean
Thank you!! :)
I think complex code is an intermediary step towards reaching simple code, and that's a bit in contradiction of what the video implies, the video implies that we pick complexity, not as a necessary evil (or an intermediary step) but that's just because we think is better
I personally tried to write simple code from the very start and I'd just spend like x3ish the time to write the same end code because I would really wanna avoid complexity, but avoiding complexity as a middle step is fundamentally avoiding exploration and therefore understanding the problem becomes much slower
There is no paradox.
Less is less code to write too!
✅
I like your channel, but you should spend some time on your English pronunciation. Most is good, but a couple sounds are off, notably the “sh” sound. You turn these into “s” sounds and it’s quite jarring. Function should be funk-shun instead of funk-son. That sh comes from starting with a closed teeth s, then drawing the tip of the tongue up and back without touching the roof of your mouth. It should soften that s and get you to the right sound.
Keep it up!
How many languages do you speak fluently?
Hmm, this is not really about me. I hope the best for codemunk. I do know that language barriers inhibit communication and limit reach. I’d like for his reach not to be limited by his presentation. If he doesn’t get any feedback of this sort, he won’t do anything about it. Problem is that native English speakers will notice it and will judge his videos on it. I’d prefer that didn’t happen. It’s literally just a couple small things because most of his pronunciation is perfect.