{"video_id":"NwDUbheiNrI","comment_count":240,"fetched_at":"2026-10-23T22:13:40+00:00","source":"innertube_next","comments":[{"id":"Ugz1T2oqPo0gvcdq-8J4AaABAg","text":"Learn for free on Brilliant for a full 30 days: https://brilliant.org/Lattice/. You’ll also get 20% off an annual Premium subscription.","author":"@Latticx","author_id":"UC2d2M7zinQWZU4-oD0nlORg","like_count":10,"published_time":"8 months ago"},{"id":"UgyOEjWOkV-kwP9n20N4AaABAg","text":"\"You can't read the code anymore, you need to mentally execute it.\" I think that is a very good definition for code that is too dense/complex. It is also a very subjective line.","author":"@tommihaapanen846","author_id":"UCvSI2UNMqk71fuc24MxOhcQ","like_count":233,"published_time":"8 months ago"},{"id":"UgypY8mYzv3rLgLefK54AaABAg","text":"Jokes on you my brain works slow so I always write boring code","author":"@longboye9935","author_id":"UCPg_-xj8iVwaVan0wA-x1vA","like_count":177,"published_time":"8 months ago"},{"id":"UgzRiGXik7-B6IdDtDx4AaABAg","text":"Chad move would be to comment out the original line saying “I could have done this but I decided to make it easier for you to comprehend”","author":"@fundamentaltheoremofe","author_id":"UC0C58OTlCpi783HfLnnImzg","like_count":259,"published_time":"8 months ago"},{"id":"UgyYyCL9XxT3cAWNEwN4AaABAg","text":"Don't let this man know about Haskell","author":"@uwuowoayaya","author_id":"UCjS1s2HoNJJnUrJeEn_Yw-w","like_count":521,"published_time":"8 months ago"},{"id":"Ugz6Ttke5bzkfz6grXZ4AaABAg","text":"As total newcomer to coding I'm in awe of the comment section on this video. It really shows how everybody's brain works differently, what everyone values in 'good code', different approaches. It really is like art.","author":"@Affenzunge","author_id":"UC-H_yCmPtKZyjC0Ng6D_keg","like_count":86,"published_time":"8 months ago"},{"id":"UgxgbGHf1_R640r7hTJ4AaABAg","text":"I like list comprehensions because they put the important thing front and center: we're summing the length of the words. With the loop version, you have to dig four lines and two indentations deep to finally see what's being added.","author":"@jamesarthurkimbell","author_id":"UC4LwM1TMMhGaafl1-jXttGg","like_count":162,"published_time":"8 months ago"},{"id":"UgwOmaFpXAkxBMjwI0V4AaABAg","text":"You can fix the functional code by putting the logic into separate functions. I don't understand why anyone would not do that.","author":"@VanStabHolme","author_id":"UCfFtW9qtB4kP_B15Ko9ut9w","like_count":376,"published_time":"8 months ago"},{"id":"UgyNkGeUV3-LDP_4Iy94AaABAg","text":"The inverse of this is modern enterprise Java, where every call is behind 20 layers of indirection and you never know who calls what from where.","author":"@MechMK1","author_id":"UCs15bKxTcA_PWIudVd6XWEQ","like_count":11,"published_time":"8 months ago"},{"id":"UgwD469Mw-W4kNRbeGl4AaABAg","text":"2:32 code formatters like ruff or black will split list comprehensions like this for you automatically.","author":"@funkdefied1","author_id":"UCElwv4m_Kk5d6ko9Je_lp4g","like_count":8,"published_time":"8 months ago"},{"id":"UgwuTsX7zjv0g3KX1vl4AaABAg","text":"the first JavaScript example is just a tooling problem, common with this language, with better debugging tools you can get the result for every call there","author":"@victor1882","author_id":"UCEgcKKr228O-yYquqoYE6Vw","like_count":7,"published_time":"8 months ago (edited)"},{"id":"Ugy_CxIYsP3vKyiNJi14AaABAg","text":"The initial python code already has a minor performance issue that you ended up fixing when making it more readable. The brackets make python create a list first, while without the brackets, sum works directly with the iterator.","author":"@CobaltSpace","author_id":"UCRfs9vydJ1pv5LTLTTpbFYQ","like_count":120,"published_time":"8 months ago"},{"id":"Ugwsmu4AbGvGTcnUA6B4AaABAg","text":"Python devs understand list comprehensions","author":"@robbyoconnor","author_id":"UCCwpS-o55SP1kM-4mVnT4ow","like_count":15,"published_time":"8 months ago"},{"id":"UgxgFv0YSDMtrQAiObR4AaABAg","text":"I agree for the most part, but splitting your function chain into a gazillion different states/variables like 3:39 makes it much less readable to people who know those iterator methods inside out. You're also changing the runtime characteristics a lot, which is probably a problem for large datasets.","author":"@ironnoriboi","author_id":"UCFfIMdkh0YuHccj6x8B_3OQ","like_count":84,"published_time":"8 months ago"},{"id":"Ugzzf05K2y9EtZiCYWN4AaABAg","text":"The main problem origin code is hard to read is because Python's list comprehensions are a poorly implemented method chaining. Nonetheless, the list comprehensions have a big benefit of being immutable, and not introducing any new variables, which is an actual pain in Python with its broken scoping rules.","author":"@KezVision","author_id":"UCFhuF30PglwrFR9lyXwzAyQ","like_count":1,"published_time":"8 months ago"},{"id":"UgztaMerqcAd27OpI4J4AaABAg","text":"This is something I feel Scala got right. You started with for, then have an if, and with yield","author":"@Feliks_WR","author_id":"UCP19T88sy9-kOoCVW7k9crg","like_count":0,"published_time":"8 months ago"},{"id":"Ugx3kdZ1UqMT1Z9coit4AaABAg","text":"3:21 I mostly do this type of stuff in ruby and rust.\n\nThere is the .inspect() method that lets you insert debug statements into the chain.\nTotally fine.\n\n(Edit: if the filter and map are too complex or har to read on their own the code should probably be split up. But I still prefer to have code organized like rather than just having it on consecutive rows in a for loop. I don’t want logically distinct pieces of code to bleed into each other.","author":"@HyperFocusMarshmallow","author_id":"UCaTlk_lHEVCSKWmA0pRGzhw","like_count":11,"published_time":"8 months ago (edited)"},{"id":"Ugy_lGtZ4XC6vmPWfn54AaABAg","text":"I can read this kind of dense code much easier. Intermediate variables and function calls make you have to trace through much more stuff to actually understand what something is.\n\nI do like splitting things into clear steps and commenting a lot. But the actual data transformations being compact and with little indirection makes it easier to understand.\n\nThe bad example at the start of the video is pretty much the clearest way to write this logic to my brain.\n\nI think you can also learn to “abstract” the patterns in the code in your head. You’ll look at a certain pattern and immediately know what is going on. And then if you want to “dive into” the abstraction you just have to look a little closer instead of having to jump to another function.","author":"@spaceowl5957","author_id":"UCNSop_Kwd8zSaOVmVEsS4tA","like_count":7,"published_time":"8 months ago"},{"id":"UgzFOj1A56bxl-frrI54AaABAg","text":"For me: Always prefer readability and clarity (for better maintainability). Let the compactness and brevity be the compiler's job.","author":"@ice.songpola","author_id":"UCilzSQgr61FQtb0J4rNewwQ","like_count":11,"published_time":"8 months ago (edited)"},{"id":"UgxrpKNjawubJjNf09d4AaABAg","text":"Even for the first one-liner you also just plain shouldn't create the list there when the generator works on its own.\nAlso, would've liked to see Haskell be mentioned in here.","author":"@RandomGamingDev","author_id":"UC_tlQNP3qH5J3_QUk7VSldg","like_count":35,"published_time":"8 months ago"},{"id":"Ugz1T2oqPo0gvcdq-8J4AaABAg","text":"Learn for free on Brilliant for a full 30 days: https://brilliant.org/Lattice/. You’ll also get 20% off an annual Premium subscription.","author":"@Latticx","author_id":"UC2d2M7zinQWZU4-oD0nlORg","like_count":10,"published_time":"8 months ago"},{"id":"UgyOEjWOkV-kwP9n20N4AaABAg","text":"\"You can't read the code anymore, you need to mentally execute it.\" I think that is a very good definition for code that is too dense/complex. It is also a very subjective line.","author":"@tommihaapanen846","author_id":"UCvSI2UNMqk71fuc24MxOhcQ","like_count":233,"published_time":"8 months ago"},{"id":"UgypY8mYzv3rLgLefK54AaABAg","text":"Jokes on you my brain works slow so I always write boring code","author":"@longboye9935","author_id":"UCPg_-xj8iVwaVan0wA-x1vA","like_count":177,"published_time":"8 months ago"},{"id":"UgzRiGXik7-B6IdDtDx4AaABAg","text":"Chad move would be to comment out the original line saying “I could have done this but I decided to make it easier for you to comprehend”","author":"@fundamentaltheoremofe","author_id":"UC0C58OTlCpi783HfLnnImzg","like_count":259,"published_time":"8 months ago"},{"id":"UgyYyCL9XxT3cAWNEwN4AaABAg","text":"Don't let this man know about Haskell","author":"@uwuowoayaya","author_id":"UCjS1s2HoNJJnUrJeEn_Yw-w","like_count":521,"published_time":"8 months ago"},{"id":"Ugz6Ttke5bzkfz6grXZ4AaABAg","text":"As total newcomer to coding I'm in awe of the comment section on this video. It really shows how everybody's brain works differently, what everyone values in 'good code', different approaches. It really is like art.","author":"@Affenzunge","author_id":"UC-H_yCmPtKZyjC0Ng6D_keg","like_count":86,"published_time":"8 months ago"},{"id":"UgxgbGHf1_R640r7hTJ4AaABAg","text":"I like list comprehensions because they put the important thing front and center: we're summing the length of the words. With the loop version, you have to dig four lines and two indentations deep to finally see what's being added.","author":"@jamesarthurkimbell","author_id":"UC4LwM1TMMhGaafl1-jXttGg","like_count":162,"published_time":"8 months ago"},{"id":"UgwOmaFpXAkxBMjwI0V4AaABAg","text":"You can fix the functional code by putting the logic into separate functions. I don't understand why anyone would not do that.","author":"@VanStabHolme","author_id":"UCfFtW9qtB4kP_B15Ko9ut9w","like_count":376,"published_time":"8 months ago"},{"id":"UgyNkGeUV3-LDP_4Iy94AaABAg","text":"The inverse of this is modern enterprise Java, where every call is behind 20 layers of indirection and you never know who calls what from where.","author":"@MechMK1","author_id":"UCs15bKxTcA_PWIudVd6XWEQ","like_count":11,"published_time":"8 months ago"},{"id":"UgwD469Mw-W4kNRbeGl4AaABAg","text":"2:32 code formatters like ruff or black will split list comprehensions like this for you automatically.","author":"@funkdefied1","author_id":"UCElwv4m_Kk5d6ko9Je_lp4g","like_count":8,"published_time":"8 months ago"},{"id":"UgwuTsX7zjv0g3KX1vl4AaABAg","text":"the first JavaScript example is just a tooling problem, common with this language, with better debugging tools you can get the result for every call there","author":"@victor1882","author_id":"UCEgcKKr228O-yYquqoYE6Vw","like_count":7,"published_time":"8 months ago (edited)"},{"id":"Ugy_CxIYsP3vKyiNJi14AaABAg","text":"The initial python code already has a minor performance issue that you ended up fixing when making it more readable. The brackets make python create a list first, while without the brackets, sum works directly with the iterator.","author":"@CobaltSpace","author_id":"UCRfs9vydJ1pv5LTLTTpbFYQ","like_count":120,"published_time":"8 months ago"},{"id":"Ugwsmu4AbGvGTcnUA6B4AaABAg","text":"Python devs understand list comprehensions","author":"@robbyoconnor","author_id":"UCCwpS-o55SP1kM-4mVnT4ow","like_count":15,"published_time":"8 months ago"},{"id":"UgxgFv0YSDMtrQAiObR4AaABAg","text":"I agree for the most part, but splitting your function chain into a gazillion different states/variables like 3:39 makes it much less readable to people who know those iterator methods inside out. You're also changing the runtime characteristics a lot, which is probably a problem for large datasets.","author":"@ironnoriboi","author_id":"UCFfIMdkh0YuHccj6x8B_3OQ","like_count":84,"published_time":"8 months ago"},{"id":"Ugzzf05K2y9EtZiCYWN4AaABAg","text":"The main problem origin code is hard to read is because Python's list comprehensions are a poorly implemented method chaining. Nonetheless, the list comprehensions have a big benefit of being immutable, and not introducing any new variables, which is an actual pain in Python with its broken scoping rules.","author":"@KezVision","author_id":"UCFhuF30PglwrFR9lyXwzAyQ","like_count":1,"published_time":"8 months ago"},{"id":"UgztaMerqcAd27OpI4J4AaABAg","text":"This is something I feel Scala got right. You started with for, then have an if, and with yield","author":"@Feliks_WR","author_id":"UCP19T88sy9-kOoCVW7k9crg","like_count":0,"published_time":"8 months ago"},{"id":"Ugx3kdZ1UqMT1Z9coit4AaABAg","text":"3:21 I mostly do this type of stuff in ruby and rust.\n\nThere is the .inspect() method that lets you insert debug statements into the chain.\nTotally fine.\n\n(Edit: if the filter and map are too complex or har to read on their own the code should probably be split up. But I still prefer to have code organized like rather than just having it on consecutive rows in a for loop. I don’t want logically distinct pieces of code to bleed into each other.","author":"@HyperFocusMarshmallow","author_id":"UCaTlk_lHEVCSKWmA0pRGzhw","like_count":11,"published_time":"8 months ago (edited)"},{"id":"Ugy_lGtZ4XC6vmPWfn54AaABAg","text":"I can read this kind of dense code much easier. Intermediate variables and function calls make you have to trace through much more stuff to actually understand what something is.\n\nI do like splitting things into clear steps and commenting a lot. But the actual data transformations being compact and with little indirection makes it easier to understand.\n\nThe bad example at the start of the video is pretty much the clearest way to write this logic to my brain.\n\nI think you can also learn to “abstract” the patterns in the code in your head. You’ll look at a certain pattern and immediately know what is going on. And then if you want to “dive into” the abstraction you just have to look a little closer instead of having to jump to another function.","author":"@spaceowl5957","author_id":"UCNSop_Kwd8zSaOVmVEsS4tA","like_count":7,"published_time":"8 months ago"},{"id":"UgzFOj1A56bxl-frrI54AaABAg","text":"For me: Always prefer readability and clarity (for better maintainability). Let the compactness and brevity be the compiler's job.","author":"@ice.songpola","author_id":"UCilzSQgr61FQtb0J4rNewwQ","like_count":11,"published_time":"8 months ago (edited)"},{"id":"UgxrpKNjawubJjNf09d4AaABAg","text":"Even for the first one-liner you also just plain shouldn't create the list there when the generator works on its own.\nAlso, would've liked to see Haskell be mentioned in here.","author":"@RandomGamingDev","author_id":"UC_tlQNP3qH5J3_QUk7VSldg","like_count":35,"published_time":"8 months ago"},{"id":"Ugz1T2oqPo0gvcdq-8J4AaABAg","text":"Learn for free on Brilliant for a full 30 days: https://brilliant.org/Lattice/. You’ll also get 20% off an annual Premium subscription.","author":"@Latticx","author_id":"UC2d2M7zinQWZU4-oD0nlORg","like_count":10,"published_time":"8 months ago"},{"id":"UgyOEjWOkV-kwP9n20N4AaABAg","text":"\"You can't read the code anymore, you need to mentally execute it.\" I think that is a very good definition for code that is too dense/complex. It is also a very subjective line.","author":"@tommihaapanen846","author_id":"UCvSI2UNMqk71fuc24MxOhcQ","like_count":233,"published_time":"8 months ago"},{"id":"UgypY8mYzv3rLgLefK54AaABAg","text":"Jokes on you my brain works slow so I always write boring code","author":"@longboye9935","author_id":"UCPg_-xj8iVwaVan0wA-x1vA","like_count":177,"published_time":"8 months ago"},{"id":"UgzRiGXik7-B6IdDtDx4AaABAg","text":"Chad move would be to comment out the original line saying “I could have done this but I decided to make it easier for you to comprehend”","author":"@fundamentaltheoremofe","author_id":"UC0C58OTlCpi783HfLnnImzg","like_count":259,"published_time":"8 months ago"},{"id":"UgyYyCL9XxT3cAWNEwN4AaABAg","text":"Don't let this man know about Haskell","author":"@uwuowoayaya","author_id":"UCjS1s2HoNJJnUrJeEn_Yw-w","like_count":521,"published_time":"8 months ago"},{"id":"Ugz6Ttke5bzkfz6grXZ4AaABAg","text":"As total newcomer to coding I'm in awe of the comment section on this video. It really shows how everybody's brain works differently, what everyone values in 'good code', different approaches. It really is like art.","author":"@Affenzunge","author_id":"UC-H_yCmPtKZyjC0Ng6D_keg","like_count":86,"published_time":"8 months ago"},{"id":"UgxgbGHf1_R640r7hTJ4AaABAg","text":"I like list comprehensions because they put the important thing front and center: we're summing the length of the words. With the loop version, you have to dig four lines and two indentations deep to finally see what's being added.","author":"@jamesarthurkimbell","author_id":"UC4LwM1TMMhGaafl1-jXttGg","like_count":162,"published_time":"8 months ago"},{"id":"UgwOmaFpXAkxBMjwI0V4AaABAg","text":"You can fix the functional code by putting the logic into separate functions. I don't understand why anyone would not do that.","author":"@VanStabHolme","author_id":"UCfFtW9qtB4kP_B15Ko9ut9w","like_count":376,"published_time":"8 months ago"},{"id":"UgyNkGeUV3-LDP_4Iy94AaABAg","text":"The inverse of this is modern enterprise Java, where every call is behind 20 layers of indirection and you never know who calls what from where.","author":"@MechMK1","author_id":"UCs15bKxTcA_PWIudVd6XWEQ","like_count":11,"published_time":"8 months ago"},{"id":"UgwD469Mw-W4kNRbeGl4AaABAg","text":"2:32 code formatters like ruff or black will split list comprehensions like this for you automatically.","author":"@funkdefied1","author_id":"UCElwv4m_Kk5d6ko9Je_lp4g","like_count":8,"published_time":"8 months ago"},{"id":"UgwuTsX7zjv0g3KX1vl4AaABAg","text":"the first JavaScript example is just a tooling problem, common with this language, with better debugging tools you can get the result for every call there","author":"@victor1882","author_id":"UCEgcKKr228O-yYquqoYE6Vw","like_count":7,"published_time":"8 months ago (edited)"},{"id":"Ugy_CxIYsP3vKyiNJi14AaABAg","text":"The initial python code already has a minor performance issue that you ended up fixing when making it more readable. The brackets make python create a list first, while without the brackets, sum works directly with the iterator.","author":"@CobaltSpace","author_id":"UCRfs9vydJ1pv5LTLTTpbFYQ","like_count":120,"published_time":"8 months ago"},{"id":"Ugwsmu4AbGvGTcnUA6B4AaABAg","text":"Python devs understand list comprehensions","author":"@robbyoconnor","author_id":"UCCwpS-o55SP1kM-4mVnT4ow","like_count":15,"published_time":"8 months ago"},{"id":"UgxgFv0YSDMtrQAiObR4AaABAg","text":"I agree for the most part, but splitting your function chain into a gazillion different states/variables like 3:39 makes it much less readable to people who know those iterator methods inside out. You're also changing the runtime characteristics a lot, which is probably a problem for large datasets.","author":"@ironnoriboi","author_id":"UCFfIMdkh0YuHccj6x8B_3OQ","like_count":84,"published_time":"8 months ago"},{"id":"Ugzzf05K2y9EtZiCYWN4AaABAg","text":"The main problem origin code is hard to read is because Python's list comprehensions are a poorly implemented method chaining. Nonetheless, the list comprehensions have a big benefit of being immutable, and not introducing any new variables, which is an actual pain in Python with its broken scoping rules.","author":"@KezVision","author_id":"UCFhuF30PglwrFR9lyXwzAyQ","like_count":1,"published_time":"8 months ago"},{"id":"UgztaMerqcAd27OpI4J4AaABAg","text":"This is something I feel Scala got right. You started with for, then have an if, and with yield","author":"@Feliks_WR","author_id":"UCP19T88sy9-kOoCVW7k9crg","like_count":0,"published_time":"8 months ago"},{"id":"Ugx3kdZ1UqMT1Z9coit4AaABAg","text":"3:21 I mostly do this type of stuff in ruby and rust.\n\nThere is the .inspect() method that lets you insert debug statements into the chain.\nTotally fine.\n\n(Edit: if the filter and map are too complex or har to read on their own the code should probably be split up. But I still prefer to have code organized like rather than just having it on consecutive rows in a for loop. I don’t want logically distinct pieces of code to bleed into each other.","author":"@HyperFocusMarshmallow","author_id":"UCaTlk_lHEVCSKWmA0pRGzhw","like_count":11,"published_time":"8 months ago (edited)"},{"id":"Ugy_lGtZ4XC6vmPWfn54AaABAg","text":"I can read this kind of dense code much easier. Intermediate variables and function calls make you have to trace through much more stuff to actually understand what something is.\n\nI do like splitting things into clear steps and commenting a lot. But the actual data transformations being compact and with little indirection makes it easier to understand.\n\nThe bad example at the start of the video is pretty much the clearest way to write this logic to my brain.\n\nI think you can also learn to “abstract” the patterns in the code in your head. You’ll look at a certain pattern and immediately know what is going on. And then if you want to “dive into” the abstraction you just have to look a little closer instead of having to jump to another function.","author":"@spaceowl5957","author_id":"UCNSop_Kwd8zSaOVmVEsS4tA","like_count":7,"published_time":"8 months ago"},{"id":"UgzFOj1A56bxl-frrI54AaABAg","text":"For me: Always prefer readability and clarity (for better maintainability). Let the compactness and brevity be the compiler's job.","author":"@ice.songpola","author_id":"UCilzSQgr61FQtb0J4rNewwQ","like_count":11,"published_time":"8 months ago (edited)"},{"id":"UgxrpKNjawubJjNf09d4AaABAg","text":"Even for the first one-liner you also just plain shouldn't create the list there when the generator works on its own.\nAlso, would've liked to see Haskell be mentioned in here.","author":"@RandomGamingDev","author_id":"UC_tlQNP3qH5J3_QUk7VSldg","like_count":35,"published_time":"8 months ago"},{"id":"Ugz1T2oqPo0gvcdq-8J4AaABAg","text":"Learn for free on Brilliant for a full 30 days: https://brilliant.org/Lattice/. You’ll also get 20% off an annual Premium subscription.","author":"@Latticx","author_id":"UC2d2M7zinQWZU4-oD0nlORg","like_count":10,"published_time":"8 months ago"},{"id":"UgyOEjWOkV-kwP9n20N4AaABAg","text":"\"You can't read the code anymore, you need to mentally execute it.\" I think that is a very good definition for code that is too dense/complex. It is also a very subjective line.","author":"@tommihaapanen846","author_id":"UCvSI2UNMqk71fuc24MxOhcQ","like_count":233,"published_time":"8 months ago"},{"id":"UgypY8mYzv3rLgLefK54AaABAg","text":"Jokes on you my brain works slow so I always write boring code","author":"@longboye9935","author_id":"UCPg_-xj8iVwaVan0wA-x1vA","like_count":177,"published_time":"8 months ago"},{"id":"UgzRiGXik7-B6IdDtDx4AaABAg","text":"Chad move would be to comment out the original line saying “I could have done this but I decided to make it easier for you to comprehend”","author":"@fundamentaltheoremofe","author_id":"UC0C58OTlCpi783HfLnnImzg","like_count":259,"published_time":"8 months ago"},{"id":"UgyYyCL9XxT3cAWNEwN4AaABAg","text":"Don't let this man know about Haskell","author":"@uwuowoayaya","author_id":"UCjS1s2HoNJJnUrJeEn_Yw-w","like_count":521,"published_time":"8 months ago"},{"id":"Ugz6Ttke5bzkfz6grXZ4AaABAg","text":"As total newcomer to coding I'm in awe of the comment section on this video. It really shows how everybody's brain works differently, what everyone values in 'good code', different approaches. It really is like art.","author":"@Affenzunge","author_id":"UC-H_yCmPtKZyjC0Ng6D_keg","like_count":86,"published_time":"8 months ago"},{"id":"UgxgbGHf1_R640r7hTJ4AaABAg","text":"I like list comprehensions because they put the important thing front and center: we're summing the length of the words. With the loop version, you have to dig four lines and two indentations deep to finally see what's being added.","author":"@jamesarthurkimbell","author_id":"UC4LwM1TMMhGaafl1-jXttGg","like_count":162,"published_time":"8 months ago"},{"id":"UgwD469Mw-W4kNRbeGl4AaABAg","text":"2:32 code formatters like ruff or black will split list comprehensions like this for you automatically.","author":"@funkdefied1","author_id":"UCElwv4m_Kk5d6ko9Je_lp4g","like_count":8,"published_time":"8 months ago"},{"id":"UgwOmaFpXAkxBMjwI0V4AaABAg","text":"You can fix the functional code by putting the logic into separate functions. I don't understand why anyone would not do that.","author":"@VanStabHolme","author_id":"UCfFtW9qtB4kP_B15Ko9ut9w","like_count":376,"published_time":"8 months ago"},{"id":"UgwuTsX7zjv0g3KX1vl4AaABAg","text":"the first JavaScript example is just a tooling problem, common with this language, with better debugging tools you can get the result for every call there","author":"@victor1882","author_id":"UCEgcKKr228O-yYquqoYE6Vw","like_count":7,"published_time":"8 months ago (edited)"},{"id":"UgyNkGeUV3-LDP_4Iy94AaABAg","text":"The inverse of this is modern enterprise Java, where every call is behind 20 layers of indirection and you never know who calls what from where.","author":"@MechMK1","author_id":"UCs15bKxTcA_PWIudVd6XWEQ","like_count":11,"published_time":"8 months ago"},{"id":"Ugy_CxIYsP3vKyiNJi14AaABAg","text":"The initial python code already has a minor performance issue that you ended up fixing when making it more readable. The brackets make python create a list first, while without the brackets, sum works directly with the iterator.","author":"@CobaltSpace","author_id":"UCRfs9vydJ1pv5LTLTTpbFYQ","like_count":120,"published_time":"8 months ago"},{"id":"Ugwsmu4AbGvGTcnUA6B4AaABAg","text":"Python devs understand list comprehensions","author":"@robbyoconnor","author_id":"UCCwpS-o55SP1kM-4mVnT4ow","like_count":15,"published_time":"8 months ago"},{"id":"UgztaMerqcAd27OpI4J4AaABAg","text":"This is something I feel Scala got right. You started with for, then have an if, and with yield","author":"@Feliks_WR","author_id":"UCP19T88sy9-kOoCVW7k9crg","like_count":0,"published_time":"8 months ago"},{"id":"Ugx3kdZ1UqMT1Z9coit4AaABAg","text":"3:21 I mostly do this type of stuff in ruby and rust.\n\nThere is the .inspect() method that lets you insert debug statements into the chain.\nTotally fine.\n\n(Edit: if the filter and map are too complex or har to read on their own the code should probably be split up. But I still prefer to have code organized like rather than just having it on consecutive rows in a for loop. I don’t want logically distinct pieces of code to bleed into each other.","author":"@HyperFocusMarshmallow","author_id":"UCaTlk_lHEVCSKWmA0pRGzhw","like_count":11,"published_time":"8 months ago (edited)"},{"id":"Ugzzf05K2y9EtZiCYWN4AaABAg","text":"The main problem origin code is hard to read is because Python's list comprehensions are a poorly implemented method chaining. Nonetheless, the list comprehensions have a big benefit of being immutable, and not introducing any new variables, which is an actual pain in Python with its broken scoping rules.","author":"@KezVision","author_id":"UCFhuF30PglwrFR9lyXwzAyQ","like_count":1,"published_time":"8 months ago"},{"id":"UgzFOj1A56bxl-frrI54AaABAg","text":"For me: Always prefer readability and clarity (for better maintainability). Let the compactness and brevity be the compiler's job.","author":"@ice.songpola","author_id":"UCilzSQgr61FQtb0J4rNewwQ","like_count":11,"published_time":"8 months ago (edited)"},{"id":"Ugy_lGtZ4XC6vmPWfn54AaABAg","text":"I can read this kind of dense code much easier. Intermediate variables and function calls make you have to trace through much more stuff to actually understand what something is.\n\nI do like splitting things into clear steps and commenting a lot. But the actual data transformations being compact and with little indirection makes it easier to understand.\n\nThe bad example at the start of the video is pretty much the clearest way to write this logic to my brain.\n\nI think you can also learn to “abstract” the patterns in the code in your head. You’ll look at a certain pattern and immediately know what is going on. And then if you want to “dive into” the abstraction you just have to look a little closer instead of having to jump to another function.","author":"@spaceowl5957","author_id":"UCNSop_Kwd8zSaOVmVEsS4tA","like_count":7,"published_time":"8 months ago"},{"id":"UgxgFv0YSDMtrQAiObR4AaABAg","text":"I agree for the most part, but splitting your function chain into a gazillion different states/variables like 3:39 makes it much less readable to people who know those iterator methods inside out. You're also changing the runtime characteristics a lot, which is probably a problem for large datasets.","author":"@ironnoriboi","author_id":"UCFfIMdkh0YuHccj6x8B_3OQ","like_count":84,"published_time":"8 months ago"},{"id":"UgxrpKNjawubJjNf09d4AaABAg","text":"Even for the first one-liner you also just plain shouldn't create the list there when the generator works on its own.\nAlso, would've liked to see Haskell be mentioned in here.","author":"@RandomGamingDev","author_id":"UC_tlQNP3qH5J3_QUk7VSldg","like_count":35,"published_time":"8 months ago"},{"id":"Ugz1T2oqPo0gvcdq-8J4AaABAg","text":"Learn for free on Brilliant for a full 30 days: https://brilliant.org/Lattice/. You’ll also get 20% off an annual Premium subscription.","author":"@Latticx","author_id":"UC2d2M7zinQWZU4-oD0nlORg","like_count":10,"published_time":"8 months ago"},{"id":"UgyOEjWOkV-kwP9n20N4AaABAg","text":"\"You can't read the code anymore, you need to mentally execute it.\" I think that is a very good definition for code that is too dense/complex. It is also a very subjective line.","author":"@tommihaapanen846","author_id":"UCvSI2UNMqk71fuc24MxOhcQ","like_count":233,"published_time":"8 months ago"},{"id":"UgzRiGXik7-B6IdDtDx4AaABAg","text":"Chad move would be to comment out the original line saying “I could have done this but I decided to make it easier for you to comprehend”","author":"@fundamentaltheoremofe","author_id":"UC0C58OTlCpi783HfLnnImzg","like_count":259,"published_time":"8 months ago"},{"id":"UgypY8mYzv3rLgLefK54AaABAg","text":"Jokes on you my brain works slow so I always write boring code","author":"@longboye9935","author_id":"UCPg_-xj8iVwaVan0wA-x1vA","like_count":177,"published_time":"8 months ago"},{"id":"UgyYyCL9XxT3cAWNEwN4AaABAg","text":"Don't let this man know about Haskell","author":"@uwuowoayaya","author_id":"UCjS1s2HoNJJnUrJeEn_Yw-w","like_count":521,"published_time":"8 months ago"},{"id":"Ugz6Ttke5bzkfz6grXZ4AaABAg","text":"As total newcomer to coding I'm in awe of the comment section on this video. It really shows how everybody's brain works differently, what everyone values in 'good code', different approaches. It really is like art.","author":"@Affenzunge","author_id":"UC-H_yCmPtKZyjC0Ng6D_keg","like_count":86,"published_time":"8 months ago"},{"id":"UgwOmaFpXAkxBMjwI0V4AaABAg","text":"You can fix the functional code by putting the logic into separate functions. I don't understand why anyone would not do that.","author":"@VanStabHolme","author_id":"UCfFtW9qtB4kP_B15Ko9ut9w","like_count":376,"published_time":"8 months ago"},{"id":"UgxgbGHf1_R640r7hTJ4AaABAg","text":"I like list comprehensions because they put the important thing front and center: we're summing the length of the words. With the loop version, you have to dig four lines and two indentations deep to finally see what's being added.","author":"@jamesarthurkimbell","author_id":"UC4LwM1TMMhGaafl1-jXttGg","like_count":162,"published_time":"8 months ago"},{"id":"Ugy_CxIYsP3vKyiNJi14AaABAg","text":"The initial python code already has a minor performance issue that you ended up fixing when making it more readable. The brackets make python create a list first, while without the brackets, sum works directly with the iterator.","author":"@CobaltSpace","author_id":"UCRfs9vydJ1pv5LTLTTpbFYQ","like_count":120,"published_time":"8 months ago"},{"id":"UgyNkGeUV3-LDP_4Iy94AaABAg","text":"The inverse of this is modern enterprise Java, where every call is behind 20 layers of indirection and you never know who calls what from where.","author":"@MechMK1","author_id":"UCs15bKxTcA_PWIudVd6XWEQ","like_count":11,"published_time":"8 months ago"},{"id":"Ugwsmu4AbGvGTcnUA6B4AaABAg","text":"Python devs understand list comprehensions","author":"@robbyoconnor","author_id":"UCCwpS-o55SP1kM-4mVnT4ow","like_count":15,"published_time":"8 months ago"},{"id":"UgwD469Mw-W4kNRbeGl4AaABAg","text":"2:32 code formatters like ruff or black will split list comprehensions like this for you automatically.","author":"@funkdefied1","author_id":"UCElwv4m_Kk5d6ko9Je_lp4g","like_count":8,"published_time":"8 months ago"},{"id":"UgxgFv0YSDMtrQAiObR4AaABAg","text":"I agree for the most part, but splitting your function chain into a gazillion different states/variables like 3:39 makes it much less readable to people who know those iterator methods inside out. You're also changing the runtime characteristics a lot, which is probably a problem for large datasets.","author":"@ironnoriboi","author_id":"UCFfIMdkh0YuHccj6x8B_3OQ","like_count":84,"published_time":"8 months ago"},{"id":"UgwuTsX7zjv0g3KX1vl4AaABAg","text":"the first JavaScript example is just a tooling problem, common with this language, with better debugging tools you can get the result for every call there","author":"@victor1882","author_id":"UCEgcKKr228O-yYquqoYE6Vw","like_count":7,"published_time":"8 months ago (edited)"},{"id":"Ugw9ucNB509TtsJyL514AaABAg","text":"Wow, youre mixing psychology with CS, two very cool subjects! What a cool perspective really","author":"@anchs2501","author_id":"UCYRqZaEUtrxPXFNZRSzED8g","like_count":7,"published_time":"8 months ago"},{"id":"UgxrpKNjawubJjNf09d4AaABAg","text":"Even for the first one-liner you also just plain shouldn't create the list there when the generator works on its own.\nAlso, would've liked to see Haskell be mentioned in here.","author":"@RandomGamingDev","author_id":"UC_tlQNP3qH5J3_QUk7VSldg","like_count":35,"published_time":"8 months ago"},{"id":"UgztaMerqcAd27OpI4J4AaABAg","text":"This is something I feel Scala got right. You started with for, then have an if, and with yield","author":"@Feliks_WR","author_id":"UCP19T88sy9-kOoCVW7k9crg","like_count":0,"published_time":"8 months ago"},{"id":"UgzFOj1A56bxl-frrI54AaABAg","text":"For me: Always prefer readability and clarity (for better maintainability). Let the compactness and brevity be the compiler's job.","author":"@ice.songpola","author_id":"UCilzSQgr61FQtb0J4rNewwQ","like_count":11,"published_time":"8 months ago (edited)"},{"id":"Ugz94codgID_yc1wNpF4AaABAg","text":"This is the video I wish I watched when I was as a junior dev.","author":"@quinten01","author_id":"UCNB-OFSLyvyNvi5cp83SmgA","like_count":0,"published_time":"8 months ago"},{"id":"Ugz01RsDIAJOlMvq5lt4AaABAg","text":"This Video really gives vibes of Fireship, your way of explaining, and just right info to show. I thought I am watching a popular video, I didn't even look at the views. Very nice!","author":"@Lakshay-hk7sl","author_id":"UC83uG5-vdGa3mnmvdezquFA","like_count":10,"published_time":"8 months ago"},{"id":"Ugz1T2oqPo0gvcdq-8J4AaABAg","text":"Learn for free on Brilliant for a full 30 days: https://brilliant.org/Lattice/. You’ll also get 20% off an annual Premium subscription.","author":"@Latticx","author_id":"UC2d2M7zinQWZU4-oD0nlORg","like_count":10,"published_time":"8 months ago"},{"id":"UgyOEjWOkV-kwP9n20N4AaABAg","text":"\"You can't read the code anymore, you need to mentally execute it.\" I think that is a very good definition for code that is too dense/complex. It is also a very subjective line.","author":"@tommihaapanen846","author_id":"UCvSI2UNMqk71fuc24MxOhcQ","like_count":233,"published_time":"8 months ago"},{"id":"UgypY8mYzv3rLgLefK54AaABAg","text":"Jokes on you my brain works slow so I always write boring code","author":"@longboye9935","author_id":"UCPg_-xj8iVwaVan0wA-x1vA","like_count":177,"published_time":"8 months ago"},{"id":"UgzRiGXik7-B6IdDtDx4AaABAg","text":"Chad move would be to comment out the original line saying “I could have done this but I decided to make it easier for you to comprehend”","author":"@fundamentaltheoremofe","author_id":"UC0C58OTlCpi783HfLnnImzg","like_count":259,"published_time":"8 months ago"},{"id":"UgyYyCL9XxT3cAWNEwN4AaABAg","text":"Don't let this man know about Haskell","author":"@uwuowoayaya","author_id":"UCjS1s2HoNJJnUrJeEn_Yw-w","like_count":521,"published_time":"8 months ago"},{"id":"Ugz6Ttke5bzkfz6grXZ4AaABAg","text":"As total newcomer to coding I'm in awe of the comment section on this video. It really shows how everybody's brain works differently, what everyone values in 'good code', different approaches. It really is like art.","author":"@Affenzunge","author_id":"UC-H_yCmPtKZyjC0Ng6D_keg","like_count":86,"published_time":"8 months ago"},{"id":"UgxgbGHf1_R640r7hTJ4AaABAg","text":"I like list comprehensions because they put the important thing front and center: we're summing the length of the words. With the loop version, you have to dig four lines and two indentations deep to finally see what's being added.","author":"@jamesarthurkimbell","author_id":"UC4LwM1TMMhGaafl1-jXttGg","like_count":162,"published_time":"8 months ago"},{"id":"UgwOmaFpXAkxBMjwI0V4AaABAg","text":"You can fix the functional code by putting the logic into separate functions. I don't understand why anyone would not do that.","author":"@VanStabHolme","author_id":"UCfFtW9qtB4kP_B15Ko9ut9w","like_count":376,"published_time":"8 months ago"},{"id":"UgyNkGeUV3-LDP_4Iy94AaABAg","text":"The inverse of this is modern enterprise Java, where every call is behind 20 layers of indirection and you never know who calls what from where.","author":"@MechMK1","author_id":"UCs15bKxTcA_PWIudVd6XWEQ","like_count":11,"published_time":"8 months ago"},{"id":"UgwD469Mw-W4kNRbeGl4AaABAg","text":"2:32 code formatters like ruff or black will split list comprehensions like this for you automatically.","author":"@funkdefied1","author_id":"UCElwv4m_Kk5d6ko9Je_lp4g","like_count":8,"published_time":"8 months ago"},{"id":"UgwuTsX7zjv0g3KX1vl4AaABAg","text":"the first JavaScript example is just a tooling problem, common with this language, with better debugging tools you can get the result for every call there","author":"@victor1882","author_id":"UCEgcKKr228O-yYquqoYE6Vw","like_count":7,"published_time":"8 months ago (edited)"},{"id":"Ugy_CxIYsP3vKyiNJi14AaABAg","text":"The initial python code already has a minor performance issue that you ended up fixing when making it more readable. The brackets make python create a list first, while without the brackets, sum works directly with the iterator.","author":"@CobaltSpace","author_id":"UCRfs9vydJ1pv5LTLTTpbFYQ","like_count":120,"published_time":"8 months ago"},{"id":"Ugwsmu4AbGvGTcnUA6B4AaABAg","text":"Python devs understand list comprehensions","author":"@robbyoconnor","author_id":"UCCwpS-o55SP1kM-4mVnT4ow","like_count":15,"published_time":"8 months ago"},{"id":"UgxgFv0YSDMtrQAiObR4AaABAg","text":"I agree for the most part, but splitting your function chain into a gazillion different states/variables like 3:39 makes it much less readable to people who know those iterator methods inside out. You're also changing the runtime characteristics a lot, which is probably a problem for large datasets.","author":"@ironnoriboi","author_id":"UCFfIMdkh0YuHccj6x8B_3OQ","like_count":84,"published_time":"8 months ago"},{"id":"Ugzzf05K2y9EtZiCYWN4AaABAg","text":"The main problem origin code is hard to read is because Python's list comprehensions are a poorly implemented method chaining. Nonetheless, the list comprehensions have a big benefit of being immutable, and not introducing any new variables, which is an actual pain in Python with its broken scoping rules.","author":"@KezVision","author_id":"UCFhuF30PglwrFR9lyXwzAyQ","like_count":1,"published_time":"8 months ago"},{"id":"UgztaMerqcAd27OpI4J4AaABAg","text":"This is something I feel Scala got right. You started with for, then have an if, and with yield","author":"@Feliks_WR","author_id":"UCP19T88sy9-kOoCVW7k9crg","like_count":0,"published_time":"8 months ago"},{"id":"Ugx3kdZ1UqMT1Z9coit4AaABAg","text":"3:21 I mostly do this type of stuff in ruby and rust.\n\nThere is the .inspect() method that lets you insert debug statements into the chain.\nTotally fine.\n\n(Edit: if the filter and map are too complex or har to read on their own the code should probably be split up. But I still prefer to have code organized like rather than just having it on consecutive rows in a for loop. I don’t want logically distinct pieces of code to bleed into each other.","author":"@HyperFocusMarshmallow","author_id":"UCaTlk_lHEVCSKWmA0pRGzhw","like_count":11,"published_time":"8 months ago (edited)"},{"id":"Ugy_lGtZ4XC6vmPWfn54AaABAg","text":"I can read this kind of dense code much easier. Intermediate variables and function calls make you have to trace through much more stuff to actually understand what something is.\n\nI do like splitting things into clear steps and commenting a lot. But the actual data transformations being compact and with little indirection makes it easier to understand.\n\nThe bad example at the start of the video is pretty much the clearest way to write this logic to my brain.\n\nI think you can also learn to “abstract” the patterns in the code in your head. You’ll look at a certain pattern and immediately know what is going on. And then if you want to “dive into” the abstraction you just have to look a little closer instead of having to jump to another function.","author":"@spaceowl5957","author_id":"UCNSop_Kwd8zSaOVmVEsS4tA","like_count":7,"published_time":"8 months ago"},{"id":"UgzFOj1A56bxl-frrI54AaABAg","text":"For me: Always prefer readability and clarity (for better maintainability). Let the compactness and brevity be the compiler's job.","author":"@ice.songpola","author_id":"UCilzSQgr61FQtb0J4rNewwQ","like_count":11,"published_time":"8 months ago (edited)"},{"id":"UgxrpKNjawubJjNf09d4AaABAg","text":"Even for the first one-liner you also just plain shouldn't create the list there when the generator works on its own.\nAlso, would've liked to see Haskell be mentioned in here.","author":"@RandomGamingDev","author_id":"UC_tlQNP3qH5J3_QUk7VSldg","like_count":35,"published_time":"8 months ago"},{"id":"Ugz1T2oqPo0gvcdq-8J4AaABAg","text":"Learn for free on Brilliant for a full 30 days: https://brilliant.org/Lattice/. You’ll also get 20% off an annual Premium subscription.","author":"@Latticx","author_id":"UC2d2M7zinQWZU4-oD0nlORg","like_count":10,"published_time":"8 months ago"},{"id":"UgyOEjWOkV-kwP9n20N4AaABAg","text":"\"You can't read the code anymore, you need to mentally execute it.\" I think that is a very good definition for code that is too dense/complex. It is also a very subjective line.","author":"@tommihaapanen846","author_id":"UCvSI2UNMqk71fuc24MxOhcQ","like_count":233,"published_time":"8 months ago"},{"id":"UgypY8mYzv3rLgLefK54AaABAg","text":"Jokes on you my brain works slow so I always write boring code","author":"@longboye9935","author_id":"UCPg_-xj8iVwaVan0wA-x1vA","like_count":177,"published_time":"8 months ago"},{"id":"UgzRiGXik7-B6IdDtDx4AaABAg","text":"Chad move would be to comment out the original line saying “I could have done this but I decided to make it easier for you to comprehend”","author":"@fundamentaltheoremofe","author_id":"UC0C58OTlCpi783HfLnnImzg","like_count":259,"published_time":"8 months ago"},{"id":"UgyYyCL9XxT3cAWNEwN4AaABAg","text":"Don't let this man know about Haskell","author":"@uwuowoayaya","author_id":"UCjS1s2HoNJJnUrJeEn_Yw-w","like_count":521,"published_time":"8 months ago"},{"id":"Ugz6Ttke5bzkfz6grXZ4AaABAg","text":"As total newcomer to coding I'm in awe of the comment section on this video. It really shows how everybody's brain works differently, what everyone values in 'good code', different approaches. It really is like art.","author":"@Affenzunge","author_id":"UC-H_yCmPtKZyjC0Ng6D_keg","like_count":86,"published_time":"8 months ago"},{"id":"UgwOmaFpXAkxBMjwI0V4AaABAg","text":"You can fix the functional code by putting the logic into separate functions. I don't understand why anyone would not do that.","author":"@VanStabHolme","author_id":"UCfFtW9qtB4kP_B15Ko9ut9w","like_count":376,"published_time":"8 months ago"},{"id":"UgwuTsX7zjv0g3KX1vl4AaABAg","text":"the first JavaScript example is just a tooling problem, common with this language, with better debugging tools you can get the result for every call there","author":"@victor1882","author_id":"UCEgcKKr228O-yYquqoYE6Vw","like_count":7,"published_time":"8 months ago (edited)"},{"id":"UgwD469Mw-W4kNRbeGl4AaABAg","text":"2:32 code formatters like ruff or black will split list comprehensions like this for you automatically.","author":"@funkdefied1","author_id":"UCElwv4m_Kk5d6ko9Je_lp4g","like_count":8,"published_time":"8 months ago"},{"id":"UgztaMerqcAd27OpI4J4AaABAg","text":"This is something I feel Scala got right. You started with for, then have an if, and with yield","author":"@Feliks_WR","author_id":"UCP19T88sy9-kOoCVW7k9crg","like_count":0,"published_time":"8 months ago"},{"id":"UgyNkGeUV3-LDP_4Iy94AaABAg","text":"The inverse of this is modern enterprise Java, where every call is behind 20 layers of indirection and you never know who calls what from where.","author":"@MechMK1","author_id":"UCs15bKxTcA_PWIudVd6XWEQ","like_count":11,"published_time":"8 months ago"},{"id":"UgxgbGHf1_R640r7hTJ4AaABAg","text":"I like list comprehensions because they put the important thing front and center: we're summing the length of the words. With the loop version, you have to dig four lines and two indentations deep to finally see what's being added.","author":"@jamesarthurkimbell","author_id":"UC4LwM1TMMhGaafl1-jXttGg","like_count":162,"published_time":"8 months ago"},{"id":"Ugwsmu4AbGvGTcnUA6B4AaABAg","text":"Python devs understand list comprehensions","author":"@robbyoconnor","author_id":"UCCwpS-o55SP1kM-4mVnT4ow","like_count":15,"published_time":"8 months ago"},{"id":"Ugy_CxIYsP3vKyiNJi14AaABAg","text":"The initial python code already has a minor performance issue that you ended up fixing when making it more readable. The brackets make python create a list first, while without the brackets, sum works directly with the iterator.","author":"@CobaltSpace","author_id":"UCRfs9vydJ1pv5LTLTTpbFYQ","like_count":120,"published_time":"8 months ago"},{"id":"Ugw5G0fuDlW7dba3xER4AaABAg","text":"i get the same stress with compactness when reading code that uses the walrus operator :=","author":"@nourKnowss","author_id":"UCl6KiJE7eCPERIBuv3i_uIg","like_count":1,"published_time":"8 months ago"},{"id":"Ugw9ucNB509TtsJyL514AaABAg","text":"Wow, youre mixing psychology with CS, two very cool subjects! What a cool perspective really","author":"@anchs2501","author_id":"UCYRqZaEUtrxPXFNZRSzED8g","like_count":7,"published_time":"8 months ago"},{"id":"Ugy_lGtZ4XC6vmPWfn54AaABAg","text":"I can read this kind of dense code much easier. Intermediate variables and function calls make you have to trace through much more stuff to actually understand what something is.\n\nI do like splitting things into clear steps and commenting a lot. But the actual data transformations being compact and with little indirection makes it easier to understand.\n\nThe bad example at the start of the video is pretty much the clearest way to write this logic to my brain.\n\nI think you can also learn to “abstract” the patterns in the code in your head. You’ll look at a certain pattern and immediately know what is going on. And then if you want to “dive into” the abstraction you just have to look a little closer instead of having to jump to another function.","author":"@spaceowl5957","author_id":"UCNSop_Kwd8zSaOVmVEsS4tA","like_count":7,"published_time":"8 months ago"},{"id":"UgzFOj1A56bxl-frrI54AaABAg","text":"For me: Always prefer readability and clarity (for better maintainability). Let the compactness and brevity be the compiler's job.","author":"@ice.songpola","author_id":"UCilzSQgr61FQtb0J4rNewwQ","like_count":11,"published_time":"8 months ago (edited)"},{"id":"Ugz01RsDIAJOlMvq5lt4AaABAg","text":"This Video really gives vibes of Fireship, your way of explaining, and just right info to show. I thought I am watching a popular video, I didn't even look at the views. Very nice!","author":"@Lakshay-hk7sl","author_id":"UC83uG5-vdGa3mnmvdezquFA","like_count":10,"published_time":"8 months ago"},{"id":"Ugwl11Lv3UfJABkqu4J4AaABAg","text":"There is an advantage to list comprehensions though, they do less than a loop, and are more specific in their purpace..\nOnce you're used to them, they're not that hard to read.","author":"@somnvm37","author_id":"UCzy-53IqyfG0JRUI7cHVsJw","like_count":1,"published_time":"8 months ago"},{"id":"Ugz1T2oqPo0gvcdq-8J4AaABAg","text":"Learn for free on Brilliant for a full 30 days: https://brilliant.org/Lattice/. You’ll also get 20% off an annual Premium subscription.","author":"@Latticx","author_id":"UC2d2M7zinQWZU4-oD0nlORg","like_count":10,"published_time":"8 months ago"},{"id":"UgyOEjWOkV-kwP9n20N4AaABAg","text":"\"You can't read the code anymore, you need to mentally execute it.\" I think that is a very good definition for code that is too dense/complex. It is also a very subjective line.","author":"@tommihaapanen846","author_id":"UCvSI2UNMqk71fuc24MxOhcQ","like_count":233,"published_time":"8 months ago"},{"id":"UgypY8mYzv3rLgLefK54AaABAg","text":"Jokes on you my brain works slow so I always write boring code","author":"@longboye9935","author_id":"UCPg_-xj8iVwaVan0wA-x1vA","like_count":177,"published_time":"8 months ago"},{"id":"UgzRiGXik7-B6IdDtDx4AaABAg","text":"Chad move would be to comment out the original line saying “I could have done this but I decided to make it easier for you to comprehend”","author":"@fundamentaltheoremofe","author_id":"UC0C58OTlCpi783HfLnnImzg","like_count":259,"published_time":"8 months ago"},{"id":"UgyYyCL9XxT3cAWNEwN4AaABAg","text":"Don't let this man know about Haskell","author":"@uwuowoayaya","author_id":"UCjS1s2HoNJJnUrJeEn_Yw-w","like_count":521,"published_time":"8 months ago"},{"id":"Ugz6Ttke5bzkfz6grXZ4AaABAg","text":"As total newcomer to coding I'm in awe of the comment section on this video. It really shows how everybody's brain works differently, what everyone values in 'good code', different approaches. It really is like art.","author":"@Affenzunge","author_id":"UC-H_yCmPtKZyjC0Ng6D_keg","like_count":86,"published_time":"8 months ago"},{"id":"UgxgbGHf1_R640r7hTJ4AaABAg","text":"I like list comprehensions because they put the important thing front and center: we're summing the length of the words. With the loop version, you have to dig four lines and two indentations deep to finally see what's being added.","author":"@jamesarthurkimbell","author_id":"UC4LwM1TMMhGaafl1-jXttGg","like_count":162,"published_time":"8 months ago"},{"id":"UgwOmaFpXAkxBMjwI0V4AaABAg","text":"You can fix the functional code by putting the logic into separate functions. I don't understand why anyone would not do that.","author":"@VanStabHolme","author_id":"UCfFtW9qtB4kP_B15Ko9ut9w","like_count":376,"published_time":"8 months ago"},{"id":"UgyNkGeUV3-LDP_4Iy94AaABAg","text":"The inverse of this is modern enterprise Java, where every call is behind 20 layers of indirection and you never know who calls what from where.","author":"@MechMK1","author_id":"UCs15bKxTcA_PWIudVd6XWEQ","like_count":11,"published_time":"8 months ago"},{"id":"UgwD469Mw-W4kNRbeGl4AaABAg","text":"2:32 code formatters like ruff or black will split list comprehensions like this for you automatically.","author":"@funkdefied1","author_id":"UCElwv4m_Kk5d6ko9Je_lp4g","like_count":8,"published_time":"8 months ago"},{"id":"UgwuTsX7zjv0g3KX1vl4AaABAg","text":"the first JavaScript example is just a tooling problem, common with this language, with better debugging tools you can get the result for every call there","author":"@victor1882","author_id":"UCEgcKKr228O-yYquqoYE6Vw","like_count":7,"published_time":"8 months ago (edited)"},{"id":"Ugy_CxIYsP3vKyiNJi14AaABAg","text":"The initial python code already has a minor performance issue that you ended up fixing when making it more readable. The brackets make python create a list first, while without the brackets, sum works directly with the iterator.","author":"@CobaltSpace","author_id":"UCRfs9vydJ1pv5LTLTTpbFYQ","like_count":120,"published_time":"8 months ago"},{"id":"Ugwsmu4AbGvGTcnUA6B4AaABAg","text":"Python devs understand list comprehensions","author":"@robbyoconnor","author_id":"UCCwpS-o55SP1kM-4mVnT4ow","like_count":15,"published_time":"8 months ago"},{"id":"UgxgFv0YSDMtrQAiObR4AaABAg","text":"I agree for the most part, but splitting your function chain into a gazillion different states/variables like 3:39 makes it much less readable to people who know those iterator methods inside out. You're also changing the runtime characteristics a lot, which is probably a problem for large datasets.","author":"@ironnoriboi","author_id":"UCFfIMdkh0YuHccj6x8B_3OQ","like_count":84,"published_time":"8 months ago"},{"id":"Ugzzf05K2y9EtZiCYWN4AaABAg","text":"The main problem origin code is hard to read is because Python's list comprehensions are a poorly implemented method chaining. Nonetheless, the list comprehensions have a big benefit of being immutable, and not introducing any new variables, which is an actual pain in Python with its broken scoping rules.","author":"@KezVision","author_id":"UCFhuF30PglwrFR9lyXwzAyQ","like_count":1,"published_time":"8 months ago"},{"id":"UgztaMerqcAd27OpI4J4AaABAg","text":"This is something I feel Scala got right. You started with for, then have an if, and with yield","author":"@Feliks_WR","author_id":"UCP19T88sy9-kOoCVW7k9crg","like_count":0,"published_time":"8 months ago"},{"id":"Ugx3kdZ1UqMT1Z9coit4AaABAg","text":"3:21 I mostly do this type of stuff in ruby and rust.\n\nThere is the .inspect() method that lets you insert debug statements into the chain.\nTotally fine.\n\n(Edit: if the filter and map are too complex or har to read on their own the code should probably be split up. But I still prefer to have code organized like rather than just having it on consecutive rows in a for loop. I don’t want logically distinct pieces of code to bleed into each other.","author":"@HyperFocusMarshmallow","author_id":"UCaTlk_lHEVCSKWmA0pRGzhw","like_count":11,"published_time":"8 months ago (edited)"},{"id":"Ugy_lGtZ4XC6vmPWfn54AaABAg","text":"I can read this kind of dense code much easier. Intermediate variables and function calls make you have to trace through much more stuff to actually understand what something is.\n\nI do like splitting things into clear steps and commenting a lot. But the actual data transformations being compact and with little indirection makes it easier to understand.\n\nThe bad example at the start of the video is pretty much the clearest way to write this logic to my brain.\n\nI think you can also learn to “abstract” the patterns in the code in your head. You’ll look at a certain pattern and immediately know what is going on. And then if you want to “dive into” the abstraction you just have to look a little closer instead of having to jump to another function.","author":"@spaceowl5957","author_id":"UCNSop_Kwd8zSaOVmVEsS4tA","like_count":7,"published_time":"8 months ago"},{"id":"UgzFOj1A56bxl-frrI54AaABAg","text":"For me: Always prefer readability and clarity (for better maintainability). Let the compactness and brevity be the compiler's job.","author":"@ice.songpola","author_id":"UCilzSQgr61FQtb0J4rNewwQ","like_count":11,"published_time":"8 months ago (edited)"},{"id":"UgxrpKNjawubJjNf09d4AaABAg","text":"Even for the first one-liner you also just plain shouldn't create the list there when the generator works on its own.\nAlso, would've liked to see Haskell be mentioned in here.","author":"@RandomGamingDev","author_id":"UC_tlQNP3qH5J3_QUk7VSldg","like_count":35,"published_time":"8 months ago"},{"id":"Ugz1T2oqPo0gvcdq-8J4AaABAg","text":"Learn for free on Brilliant for a full 30 days: https://brilliant.org/Lattice/. You’ll also get 20% off an annual Premium subscription.","author":"@Latticx","author_id":"UC2d2M7zinQWZU4-oD0nlORg","like_count":10,"published_time":"8 months ago"},{"id":"UgyOEjWOkV-kwP9n20N4AaABAg","text":"\"You can't read the code anymore, you need to mentally execute it.\" I think that is a very good definition for code that is too dense/complex. It is also a very subjective line.","author":"@tommihaapanen846","author_id":"UCvSI2UNMqk71fuc24MxOhcQ","like_count":233,"published_time":"8 months ago"},{"id":"UgypY8mYzv3rLgLefK54AaABAg","text":"Jokes on you my brain works slow so I always write boring code","author":"@longboye9935","author_id":"UCPg_-xj8iVwaVan0wA-x1vA","like_count":177,"published_time":"8 months ago"},{"id":"UgzRiGXik7-B6IdDtDx4AaABAg","text":"Chad move would be to comment out the original line saying “I could have done this but I decided to make it easier for you to comprehend”","author":"@fundamentaltheoremofe","author_id":"UC0C58OTlCpi783HfLnnImzg","like_count":259,"published_time":"8 months ago"},{"id":"UgyYyCL9XxT3cAWNEwN4AaABAg","text":"Don't let this man know about Haskell","author":"@uwuowoayaya","author_id":"UCjS1s2HoNJJnUrJeEn_Yw-w","like_count":521,"published_time":"8 months ago"},{"id":"Ugz6Ttke5bzkfz6grXZ4AaABAg","text":"As total newcomer to coding I'm in awe of the comment section on this video. It really shows how everybody's brain works differently, what everyone values in 'good code', different approaches. It really is like art.","author":"@Affenzunge","author_id":"UC-H_yCmPtKZyjC0Ng6D_keg","like_count":86,"published_time":"8 months ago"},{"id":"UgxgbGHf1_R640r7hTJ4AaABAg","text":"I like list comprehensions because they put the important thing front and center: we're summing the length of the words. With the loop version, you have to dig four lines and two indentations deep to finally see what's being added.","author":"@jamesarthurkimbell","author_id":"UC4LwM1TMMhGaafl1-jXttGg","like_count":162,"published_time":"8 months ago"},{"id":"UgwD469Mw-W4kNRbeGl4AaABAg","text":"2:32 code formatters like ruff or black will split list comprehensions like this for you automatically.","author":"@funkdefied1","author_id":"UCElwv4m_Kk5d6ko9Je_lp4g","like_count":8,"published_time":"8 months ago"},{"id":"UgwOmaFpXAkxBMjwI0V4AaABAg","text":"You can fix the functional code by putting the logic into separate functions. I don't understand why anyone would not do that.","author":"@VanStabHolme","author_id":"UCfFtW9qtB4kP_B15Ko9ut9w","like_count":376,"published_time":"8 months ago"},{"id":"UgwuTsX7zjv0g3KX1vl4AaABAg","text":"the first JavaScript example is just a tooling problem, common with this language, with better debugging tools you can get the result for every call there","author":"@victor1882","author_id":"UCEgcKKr228O-yYquqoYE6Vw","like_count":7,"published_time":"8 months ago (edited)"},{"id":"UgyNkGeUV3-LDP_4Iy94AaABAg","text":"The inverse of this is modern enterprise Java, where every call is behind 20 layers of indirection and you never know who calls what from where.","author":"@MechMK1","author_id":"UCs15bKxTcA_PWIudVd6XWEQ","like_count":11,"published_time":"8 months ago"},{"id":"Ugy_CxIYsP3vKyiNJi14AaABAg","text":"The initial python code already has a minor performance issue that you ended up fixing when making it more readable. The brackets make python create a list first, while without the brackets, sum works directly with the iterator.","author":"@CobaltSpace","author_id":"UCRfs9vydJ1pv5LTLTTpbFYQ","like_count":120,"published_time":"8 months ago"},{"id":"Ugwsmu4AbGvGTcnUA6B4AaABAg","text":"Python devs understand list comprehensions","author":"@robbyoconnor","author_id":"UCCwpS-o55SP1kM-4mVnT4ow","like_count":15,"published_time":"8 months ago"},{"id":"UgztaMerqcAd27OpI4J4AaABAg","text":"This is something I feel Scala got right. You started with for, then have an if, and with yield","author":"@Feliks_WR","author_id":"UCP19T88sy9-kOoCVW7k9crg","like_count":0,"published_time":"8 months ago"},{"id":"Ugx3kdZ1UqMT1Z9coit4AaABAg","text":"3:21 I mostly do this type of stuff in ruby and rust.\n\nThere is the .inspect() method that lets you insert debug statements into the chain.\nTotally fine.\n\n(Edit: if the filter and map are too complex or har to read on their own the code should probably be split up. But I still prefer to have code organized like rather than just having it on consecutive rows in a for loop. I don’t want logically distinct pieces of code to bleed into each other.","author":"@HyperFocusMarshmallow","author_id":"UCaTlk_lHEVCSKWmA0pRGzhw","like_count":11,"published_time":"8 months ago (edited)"},{"id":"Ugzzf05K2y9EtZiCYWN4AaABAg","text":"The main problem origin code is hard to read is because Python's list comprehensions are a poorly implemented method chaining. Nonetheless, the list comprehensions have a big benefit of being immutable, and not introducing any new variables, which is an actual pain in Python with its broken scoping rules.","author":"@KezVision","author_id":"UCFhuF30PglwrFR9lyXwzAyQ","like_count":1,"published_time":"8 months ago"},{"id":"UgzFOj1A56bxl-frrI54AaABAg","text":"For me: Always prefer readability and clarity (for better maintainability). Let the compactness and brevity be the compiler's job.","author":"@ice.songpola","author_id":"UCilzSQgr61FQtb0J4rNewwQ","like_count":11,"published_time":"8 months ago (edited)"},{"id":"Ugy_lGtZ4XC6vmPWfn54AaABAg","text":"I can read this kind of dense code much easier. Intermediate variables and function calls make you have to trace through much more stuff to actually understand what something is.\n\nI do like splitting things into clear steps and commenting a lot. But the actual data transformations being compact and with little indirection makes it easier to understand.\n\nThe bad example at the start of the video is pretty much the clearest way to write this logic to my brain.\n\nI think you can also learn to “abstract” the patterns in the code in your head. You’ll look at a certain pattern and immediately know what is going on. And then if you want to “dive into” the abstraction you just have to look a little closer instead of having to jump to another function.","author":"@spaceowl5957","author_id":"UCNSop_Kwd8zSaOVmVEsS4tA","like_count":7,"published_time":"8 months ago"},{"id":"UgxgFv0YSDMtrQAiObR4AaABAg","text":"I agree for the most part, but splitting your function chain into a gazillion different states/variables like 3:39 makes it much less readable to people who know those iterator methods inside out. You're also changing the runtime characteristics a lot, which is probably a problem for large datasets.","author":"@ironnoriboi","author_id":"UCFfIMdkh0YuHccj6x8B_3OQ","like_count":84,"published_time":"8 months ago"},{"id":"UgxrpKNjawubJjNf09d4AaABAg","text":"Even for the first one-liner you also just plain shouldn't create the list there when the generator works on its own.\nAlso, would've liked to see Haskell be mentioned in here.","author":"@RandomGamingDev","author_id":"UC_tlQNP3qH5J3_QUk7VSldg","like_count":35,"published_time":"8 months ago"},{"id":"Ugz1T2oqPo0gvcdq-8J4AaABAg","text":"Learn for free on Brilliant for a full 30 days: https://brilliant.org/Lattice/. You’ll also get 20% off an annual Premium subscription.","author":"@Latticx","author_id":"UC2d2M7zinQWZU4-oD0nlORg","like_count":10,"published_time":"8 months ago"},{"id":"UgyOEjWOkV-kwP9n20N4AaABAg","text":"\"You can't read the code anymore, you need to mentally execute it.\" I think that is a very good definition for code that is too dense/complex. It is also a very subjective line.","author":"@tommihaapanen846","author_id":"UCvSI2UNMqk71fuc24MxOhcQ","like_count":233,"published_time":"8 months ago"},{"id":"UgypY8mYzv3rLgLefK54AaABAg","text":"Jokes on you my brain works slow so I always write boring code","author":"@longboye9935","author_id":"UCPg_-xj8iVwaVan0wA-x1vA","like_count":177,"published_time":"8 months ago"},{"id":"UgzRiGXik7-B6IdDtDx4AaABAg","text":"Chad move would be to comment out the original line saying “I could have done this but I decided to make it easier for you to comprehend”","author":"@fundamentaltheoremofe","author_id":"UC0C58OTlCpi783HfLnnImzg","like_count":259,"published_time":"8 months ago"},{"id":"UgyYyCL9XxT3cAWNEwN4AaABAg","text":"Don't let this man know about Haskell","author":"@uwuowoayaya","author_id":"UCjS1s2HoNJJnUrJeEn_Yw-w","like_count":521,"published_time":"8 months ago"},{"id":"Ugz6Ttke5bzkfz6grXZ4AaABAg","text":"As total newcomer to coding I'm in awe of the comment section on this video. It really shows how everybody's brain works differently, what everyone values in 'good code', different approaches. It really is like art.","author":"@Affenzunge","author_id":"UC-H_yCmPtKZyjC0Ng6D_keg","like_count":86,"published_time":"8 months ago"},{"id":"UgxgbGHf1_R640r7hTJ4AaABAg","text":"I like list comprehensions because they put the important thing front and center: we're summing the length of the words. With the loop version, you have to dig four lines and two indentations deep to finally see what's being added.","author":"@jamesarthurkimbell","author_id":"UC4LwM1TMMhGaafl1-jXttGg","like_count":162,"published_time":"8 months ago"},{"id":"UgwOmaFpXAkxBMjwI0V4AaABAg","text":"You can fix the functional code by putting the logic into separate functions. I don't understand why anyone would not do that.","author":"@VanStabHolme","author_id":"UCfFtW9qtB4kP_B15Ko9ut9w","like_count":376,"published_time":"8 months ago"},{"id":"UgyNkGeUV3-LDP_4Iy94AaABAg","text":"The inverse of this is modern enterprise Java, where every call is behind 20 layers of indirection and you never know who calls what from where.","author":"@MechMK1","author_id":"UCs15bKxTcA_PWIudVd6XWEQ","like_count":11,"published_time":"8 months ago"},{"id":"UgwD469Mw-W4kNRbeGl4AaABAg","text":"2:32 code formatters like ruff or black will split list comprehensions like this for you automatically.","author":"@funkdefied1","author_id":"UCElwv4m_Kk5d6ko9Je_lp4g","like_count":8,"published_time":"8 months ago"},{"id":"UgwuTsX7zjv0g3KX1vl4AaABAg","text":"the first JavaScript example is just a tooling problem, common with this language, with better debugging tools you can get the result for every call there","author":"@victor1882","author_id":"UCEgcKKr228O-yYquqoYE6Vw","like_count":7,"published_time":"8 months ago (edited)"},{"id":"Ugy_CxIYsP3vKyiNJi14AaABAg","text":"The initial python code already has a minor performance issue that you ended up fixing when making it more readable. The brackets make python create a list first, while without the brackets, sum works directly with the iterator.","author":"@CobaltSpace","author_id":"UCRfs9vydJ1pv5LTLTTpbFYQ","like_count":120,"published_time":"8 months ago"},{"id":"Ugwsmu4AbGvGTcnUA6B4AaABAg","text":"Python devs understand list comprehensions","author":"@robbyoconnor","author_id":"UCCwpS-o55SP1kM-4mVnT4ow","like_count":15,"published_time":"8 months ago"},{"id":"UgxgFv0YSDMtrQAiObR4AaABAg","text":"I agree for the most part, but splitting your function chain into a gazillion different states/variables like 3:39 makes it much less readable to people who know those iterator methods inside out. You're also changing the runtime characteristics a lot, which is probably a problem for large datasets.","author":"@ironnoriboi","author_id":"UCFfIMdkh0YuHccj6x8B_3OQ","like_count":84,"published_time":"8 months ago"},{"id":"Ugzzf05K2y9EtZiCYWN4AaABAg","text":"The main problem origin code is hard to read is because Python's list comprehensions are a poorly implemented method chaining. Nonetheless, the list comprehensions have a big benefit of being immutable, and not introducing any new variables, which is an actual pain in Python with its broken scoping rules.","author":"@KezVision","author_id":"UCFhuF30PglwrFR9lyXwzAyQ","like_count":1,"published_time":"8 months ago"},{"id":"UgztaMerqcAd27OpI4J4AaABAg","text":"This is something I feel Scala got right. You started with for, then have an if, and with yield","author":"@Feliks_WR","author_id":"UCP19T88sy9-kOoCVW7k9crg","like_count":0,"published_time":"8 months ago"},{"id":"Ugx3kdZ1UqMT1Z9coit4AaABAg","text":"3:21 I mostly do this type of stuff in ruby and rust.\n\nThere is the .inspect() method that lets you insert debug statements into the chain.\nTotally fine.\n\n(Edit: if the filter and map are too complex or har to read on their own the code should probably be split up. But I still prefer to have code organized like rather than just having it on consecutive rows in a for loop. I don’t want logically distinct pieces of code to bleed into each other.","author":"@HyperFocusMarshmallow","author_id":"UCaTlk_lHEVCSKWmA0pRGzhw","like_count":11,"published_time":"8 months ago (edited)"},{"id":"Ugy_lGtZ4XC6vmPWfn54AaABAg","text":"I can read this kind of dense code much easier. Intermediate variables and function calls make you have to trace through much more stuff to actually understand what something is.\n\nI do like splitting things into clear steps and commenting a lot. But the actual data transformations being compact and with little indirection makes it easier to understand.\n\nThe bad example at the start of the video is pretty much the clearest way to write this logic to my brain.\n\nI think you can also learn to “abstract” the patterns in the code in your head. You’ll look at a certain pattern and immediately know what is going on. And then if you want to “dive into” the abstraction you just have to look a little closer instead of having to jump to another function.","author":"@spaceowl5957","author_id":"UCNSop_Kwd8zSaOVmVEsS4tA","like_count":7,"published_time":"8 months ago"},{"id":"UgzFOj1A56bxl-frrI54AaABAg","text":"For me: Always prefer readability and clarity (for better maintainability). Let the compactness and brevity be the compiler's job.","author":"@ice.songpola","author_id":"UCilzSQgr61FQtb0J4rNewwQ","like_count":11,"published_time":"8 months ago (edited)"},{"id":"UgxrpKNjawubJjNf09d4AaABAg","text":"Even for the first one-liner you also just plain shouldn't create the list there when the generator works on its own.\nAlso, would've liked to see Haskell be mentioned in here.","author":"@RandomGamingDev","author_id":"UC_tlQNP3qH5J3_QUk7VSldg","like_count":35,"published_time":"8 months ago"},{"id":"Ugz1T2oqPo0gvcdq-8J4AaABAg","text":"Learn for free on Brilliant for a full 30 days: https://brilliant.org/Lattice/. You’ll also get 20% off an annual Premium subscription.","author":"@Latticx","author_id":"UC2d2M7zinQWZU4-oD0nlORg","like_count":10,"published_time":"8 months ago"},{"id":"UgyOEjWOkV-kwP9n20N4AaABAg","text":"\"You can't read the code anymore, you need to mentally execute it.\" I think that is a very good definition for code that is too dense/complex. It is also a very subjective line.","author":"@tommihaapanen846","author_id":"UCvSI2UNMqk71fuc24MxOhcQ","like_count":233,"published_time":"8 months ago"},{"id":"UgypY8mYzv3rLgLefK54AaABAg","text":"Jokes on you my brain works slow so I always write boring code","author":"@longboye9935","author_id":"UCPg_-xj8iVwaVan0wA-x1vA","like_count":177,"published_time":"8 months ago"},{"id":"UgzRiGXik7-B6IdDtDx4AaABAg","text":"Chad move would be to comment out the original line saying “I could have done this but I decided to make it easier for you to comprehend”","author":"@fundamentaltheoremofe","author_id":"UC0C58OTlCpi783HfLnnImzg","like_count":259,"published_time":"8 months ago"},{"id":"UgyYyCL9XxT3cAWNEwN4AaABAg","text":"Don't let this man know about Haskell","author":"@uwuowoayaya","author_id":"UCjS1s2HoNJJnUrJeEn_Yw-w","like_count":521,"published_time":"8 months ago"},{"id":"Ugz6Ttke5bzkfz6grXZ4AaABAg","text":"As total newcomer to coding I'm in awe of the comment section on this video. It really shows how everybody's brain works differently, what everyone values in 'good code', different approaches. It really is like art.","author":"@Affenzunge","author_id":"UC-H_yCmPtKZyjC0Ng6D_keg","like_count":86,"published_time":"8 months ago"},{"id":"UgxgbGHf1_R640r7hTJ4AaABAg","text":"I like list comprehensions because they put the important thing front and center: we're summing the length of the words. With the loop version, you have to dig four lines and two indentations deep to finally see what's being added.","author":"@jamesarthurkimbell","author_id":"UC4LwM1TMMhGaafl1-jXttGg","like_count":162,"published_time":"8 months ago"},{"id":"UgwOmaFpXAkxBMjwI0V4AaABAg","text":"You can fix the functional code by putting the logic into separate functions. I don't understand why anyone would not do that.","author":"@VanStabHolme","author_id":"UCfFtW9qtB4kP_B15Ko9ut9w","like_count":376,"published_time":"8 months ago"},{"id":"UgyNkGeUV3-LDP_4Iy94AaABAg","text":"The inverse of this is modern enterprise Java, where every call is behind 20 layers of indirection and you never know who calls what from where.","author":"@MechMK1","author_id":"UCs15bKxTcA_PWIudVd6XWEQ","like_count":11,"published_time":"8 months ago"},{"id":"UgwD469Mw-W4kNRbeGl4AaABAg","text":"2:32 code formatters like ruff or black will split list comprehensions like this for you automatically.","author":"@funkdefied1","author_id":"UCElwv4m_Kk5d6ko9Je_lp4g","like_count":8,"published_time":"8 months ago"},{"id":"UgwuTsX7zjv0g3KX1vl4AaABAg","text":"the first JavaScript example is just a tooling problem, common with this language, with better debugging tools you can get the result for every call there","author":"@victor1882","author_id":"UCEgcKKr228O-yYquqoYE6Vw","like_count":7,"published_time":"8 months ago (edited)"},{"id":"Ugy_CxIYsP3vKyiNJi14AaABAg","text":"The initial python code already has a minor performance issue that you ended up fixing when making it more readable. The brackets make python create a list first, while without the brackets, sum works directly with the iterator.","author":"@CobaltSpace","author_id":"UCRfs9vydJ1pv5LTLTTpbFYQ","like_count":120,"published_time":"8 months ago"},{"id":"Ugwsmu4AbGvGTcnUA6B4AaABAg","text":"Python devs understand list comprehensions","author":"@robbyoconnor","author_id":"UCCwpS-o55SP1kM-4mVnT4ow","like_count":15,"published_time":"8 months ago"},{"id":"UgxgFv0YSDMtrQAiObR4AaABAg","text":"I agree for the most part, but splitting your function chain into a gazillion different states/variables like 3:39 makes it much less readable to people who know those iterator methods inside out. You're also changing the runtime characteristics a lot, which is probably a problem for large datasets.","author":"@ironnoriboi","author_id":"UCFfIMdkh0YuHccj6x8B_3OQ","like_count":84,"published_time":"8 months ago"},{"id":"Ugzzf05K2y9EtZiCYWN4AaABAg","text":"The main problem origin code is hard to read is because Python's list comprehensions are a poorly implemented method chaining. Nonetheless, the list comprehensions have a big benefit of being immutable, and not introducing any new variables, which is an actual pain in Python with its broken scoping rules.","author":"@KezVision","author_id":"UCFhuF30PglwrFR9lyXwzAyQ","like_count":1,"published_time":"8 months ago"},{"id":"UgztaMerqcAd27OpI4J4AaABAg","text":"This is something I feel Scala got right. You started with for, then have an if, and with yield","author":"@Feliks_WR","author_id":"UCP19T88sy9-kOoCVW7k9crg","like_count":0,"published_time":"8 months ago"},{"id":"Ugx3kdZ1UqMT1Z9coit4AaABAg","text":"3:21 I mostly do this type of stuff in ruby and rust.\n\nThere is the .inspect() method that lets you insert debug statements into the chain.\nTotally fine.\n\n(Edit: if the filter and map are too complex or har to read on their own the code should probably be split up. But I still prefer to have code organized like rather than just having it on consecutive rows in a for loop. I don’t want logically distinct pieces of code to bleed into each other.","author":"@HyperFocusMarshmallow","author_id":"UCaTlk_lHEVCSKWmA0pRGzhw","like_count":11,"published_time":"8 months ago (edited)"},{"id":"Ugy_lGtZ4XC6vmPWfn54AaABAg","text":"I can read this kind of dense code much easier. Intermediate variables and function calls make you have to trace through much more stuff to actually understand what something is.\n\nI do like splitting things into clear steps and commenting a lot. But the actual data transformations being compact and with little indirection makes it easier to understand.\n\nThe bad example at the start of the video is pretty much the clearest way to write this logic to my brain.\n\nI think you can also learn to “abstract” the patterns in the code in your head. You’ll look at a certain pattern and immediately know what is going on. And then if you want to “dive into” the abstraction you just have to look a little closer instead of having to jump to another function.","author":"@spaceowl5957","author_id":"UCNSop_Kwd8zSaOVmVEsS4tA","like_count":7,"published_time":"8 months ago"},{"id":"UgzFOj1A56bxl-frrI54AaABAg","text":"For me: Always prefer readability and clarity (for better maintainability). Let the compactness and brevity be the compiler's job.","author":"@ice.songpola","author_id":"UCilzSQgr61FQtb0J4rNewwQ","like_count":11,"published_time":"8 months ago (edited)"},{"id":"UgxrpKNjawubJjNf09d4AaABAg","text":"Even for the first one-liner you also just plain shouldn't create the list there when the generator works on its own.\nAlso, would've liked to see Haskell be mentioned in here.","author":"@RandomGamingDev","author_id":"UC_tlQNP3qH5J3_QUk7VSldg","like_count":35,"published_time":"8 months ago"},{"id":"Ugz1T2oqPo0gvcdq-8J4AaABAg","text":"Learn for free on Brilliant for a full 30 days: https://brilliant.org/Lattice/. You’ll also get 20% off an annual Premium subscription.","author":"@Latticx","author_id":"UC2d2M7zinQWZU4-oD0nlORg","like_count":10,"published_time":"8 months ago"},{"id":"UgyOEjWOkV-kwP9n20N4AaABAg","text":"\"You can't read the code anymore, you need to mentally execute it.\" I think that is a very good definition for code that is too dense/complex. It is also a very subjective line.","author":"@tommihaapanen846","author_id":"UCvSI2UNMqk71fuc24MxOhcQ","like_count":233,"published_time":"8 months ago"},{"id":"UgypY8mYzv3rLgLefK54AaABAg","text":"Jokes on you my brain works slow so I always write boring code","author":"@longboye9935","author_id":"UCPg_-xj8iVwaVan0wA-x1vA","like_count":177,"published_time":"8 months ago"},{"id":"UgzRiGXik7-B6IdDtDx4AaABAg","text":"Chad move would be to comment out the original line saying “I could have done this but I decided to make it easier for you to comprehend”","author":"@fundamentaltheoremofe","author_id":"UC0C58OTlCpi783HfLnnImzg","like_count":259,"published_time":"8 months ago"},{"id":"UgyYyCL9XxT3cAWNEwN4AaABAg","text":"Don't let this man know about Haskell","author":"@uwuowoayaya","author_id":"UCjS1s2HoNJJnUrJeEn_Yw-w","like_count":521,"published_time":"8 months ago"},{"id":"Ugz6Ttke5bzkfz6grXZ4AaABAg","text":"As total newcomer to coding I'm in awe of the comment section on this video. It really shows how everybody's brain works differently, what everyone values in 'good code', different approaches. It really is like art.","author":"@Affenzunge","author_id":"UC-H_yCmPtKZyjC0Ng6D_keg","like_count":86,"published_time":"8 months ago"},{"id":"UgxgbGHf1_R640r7hTJ4AaABAg","text":"I like list comprehensions because they put the important thing front and center: we're summing the length of the words. With the loop version, you have to dig four lines and two indentations deep to finally see what's being added.","author":"@jamesarthurkimbell","author_id":"UC4LwM1TMMhGaafl1-jXttGg","like_count":162,"published_time":"8 months ago"},{"id":"UgwOmaFpXAkxBMjwI0V4AaABAg","text":"You can fix the functional code by putting the logic into separate functions. I don't understand why anyone would not do that.","author":"@VanStabHolme","author_id":"UCfFtW9qtB4kP_B15Ko9ut9w","like_count":376,"published_time":"8 months ago"},{"id":"UgyNkGeUV3-LDP_4Iy94AaABAg","text":"The inverse of this is modern enterprise Java, where every call is behind 20 layers of indirection and you never know who calls what from where.","author":"@MechMK1","author_id":"UCs15bKxTcA_PWIudVd6XWEQ","like_count":11,"published_time":"8 months ago"},{"id":"UgwD469Mw-W4kNRbeGl4AaABAg","text":"2:32 code formatters like ruff or black will split list comprehensions like this for you automatically.","author":"@funkdefied1","author_id":"UCElwv4m_Kk5d6ko9Je_lp4g","like_count":8,"published_time":"8 months ago"},{"id":"UgwuTsX7zjv0g3KX1vl4AaABAg","text":"the first JavaScript example is just a tooling problem, common with this language, with better debugging tools you can get the result for every call there","author":"@victor1882","author_id":"UCEgcKKr228O-yYquqoYE6Vw","like_count":7,"published_time":"8 months ago (edited)"},{"id":"Ugy_CxIYsP3vKyiNJi14AaABAg","text":"The initial python code already has a minor performance issue that you ended up fixing when making it more readable. The brackets make python create a list first, while without the brackets, sum works directly with the iterator.","author":"@CobaltSpace","author_id":"UCRfs9vydJ1pv5LTLTTpbFYQ","like_count":120,"published_time":"8 months ago"},{"id":"Ugwsmu4AbGvGTcnUA6B4AaABAg","text":"Python devs understand list comprehensions","author":"@robbyoconnor","author_id":"UCCwpS-o55SP1kM-4mVnT4ow","like_count":15,"published_time":"8 months ago"},{"id":"UgxgFv0YSDMtrQAiObR4AaABAg","text":"I agree for the most part, but splitting your function chain into a gazillion different states/variables like 3:39 makes it much less readable to people who know those iterator methods inside out. You're also changing the runtime characteristics a lot, which is probably a problem for large datasets.","author":"@ironnoriboi","author_id":"UCFfIMdkh0YuHccj6x8B_3OQ","like_count":84,"published_time":"8 months ago"},{"id":"Ugzzf05K2y9EtZiCYWN4AaABAg","text":"The main problem origin code is hard to read is because Python's list comprehensions are a poorly implemented method chaining. Nonetheless, the list comprehensions have a big benefit of being immutable, and not introducing any new variables, which is an actual pain in Python with its broken scoping rules.","author":"@KezVision","author_id":"UCFhuF30PglwrFR9lyXwzAyQ","like_count":1,"published_time":"8 months ago"},{"id":"UgztaMerqcAd27OpI4J4AaABAg","text":"This is something I feel Scala got right. You started with for, then have an if, and with yield","author":"@Feliks_WR","author_id":"UCP19T88sy9-kOoCVW7k9crg","like_count":0,"published_time":"8 months ago"},{"id":"Ugx3kdZ1UqMT1Z9coit4AaABAg","text":"3:21 I mostly do this type of stuff in ruby and rust.\n\nThere is the .inspect() method that lets you insert debug statements into the chain.\nTotally fine.\n\n(Edit: if the filter and map are too complex or har to read on their own the code should probably be split up. But I still prefer to have code organized like rather than just having it on consecutive rows in a for loop. I don’t want logically distinct pieces of code to bleed into each other.","author":"@HyperFocusMarshmallow","author_id":"UCaTlk_lHEVCSKWmA0pRGzhw","like_count":11,"published_time":"8 months ago (edited)"},{"id":"Ugy_lGtZ4XC6vmPWfn54AaABAg","text":"I can read this kind of dense code much easier. Intermediate variables and function calls make you have to trace through much more stuff to actually understand what something is.\n\nI do like splitting things into clear steps and commenting a lot. But the actual data transformations being compact and with little indirection makes it easier to understand.\n\nThe bad example at the start of the video is pretty much the clearest way to write this logic to my brain.\n\nI think you can also learn to “abstract” the patterns in the code in your head. You’ll look at a certain pattern and immediately know what is going on. And then if you want to “dive into” the abstraction you just have to look a little closer instead of having to jump to another function.","author":"@spaceowl5957","author_id":"UCNSop_Kwd8zSaOVmVEsS4tA","like_count":7,"published_time":"8 months ago"},{"id":"UgzFOj1A56bxl-frrI54AaABAg","text":"For me: Always prefer readability and clarity (for better maintainability). Let the compactness and brevity be the compiler's job.","author":"@ice.songpola","author_id":"UCilzSQgr61FQtb0J4rNewwQ","like_count":11,"published_time":"8 months ago (edited)"},{"id":"UgxrpKNjawubJjNf09d4AaABAg","text":"Even for the first one-liner you also just plain shouldn't create the list there when the generator works on its own.\nAlso, would've liked to see Haskell be mentioned in here.","author":"@RandomGamingDev","author_id":"UC_tlQNP3qH5J3_QUk7VSldg","like_count":35,"published_time":"8 months ago"}]}