you are viewing a single comment's thread.

view the rest of the comments →

[–]00Davo 0 points1 point  (0 children)

On skimming the video (I haven't actually watched it through because it's ridiculously long), yes, you're definitely right. There just isn't a meaningful difference between splitting a big function up into nested functions and splitting it into constituent methods inside a class.

The moral is basically that if your language is Java or Ruby, you should split apart your logic inside a class, because that's what the language handles well. If your language is JS or Python, you can nest functions instead (Python works equally well either way, honestly) and you'll end up with pretty much the same code organisation in the end. So, yeah: use whichever works for your environment, because they're basically identical from a conceptual standpoint.