Show notes
https://twitter.com/DavidKPiano/status/1361353521648590853?s=19
What up folks Happy President's Day for those in the US I wanted to talk
about this tweet that I saw from David K. Piano that's his Twitter handlehis last name is Korshid and the tweet is can we stop with the myth thatmore code means more complexity? Sometimes less code means more edgecasings ignored which means willfully and dangerously ignoring complexitynot reducing it.And he gives some a sample of some simple code that just awaits fetch from
API and then returns the data and it's saying here are some of theignored.Complexity error handling data validation timeout handlingcancellation interruption, etc. I super duper agree with David here and Ivery often will have people ask me about the complexity of some codebecause there's a lot of it.And the code that they're talking about is maybe some class name for
tailwind, you know, a tailwind has tons of class names or maybe they'retalking about inline styles with the CSS prop or sorry CSS and JS or likemaybe they're talking about.JSX and this component just has like 200 linesof JSX or something.Whatever the case may be the number of lines of code is maybe correlated
but not necessarily correlated even with the amount of complexity. Youcould have a list of all the countries in the United States. And now thatwould be that would be represented by a lot of lines of code.Sorry, did I say all the countries? I meant, like all the cities in the
United States. That would be a lot of code but it would not be complex.Atall. So the there's a very subtle if any relationship between the amount ofcode and the complexity thereof and I think that it's an important thing toto keep in mind.So just because there's a lot of code doesn't mean that this is going to be
a maintainability nightmare or it's going to be complex. I actually findthat prematurely abstracting some of that stuff because you think it'scomplex can make things even more complex, for example, if you have a Idon't know some like tons of.TSS or something like that CSS like class names or something you try to
abstract that away with some fancy higher order component or something thenthat would be even worse. Or if you like have a bunch of JSX and then youwind up trying to like extract these into little components then now youhave to worry about passing props and everything and that just increasesthe complexity.Now, I'm not saying that's always the case but just keep that in mind.
There's not necessarily relationship between the amount of code and howcomplex that code is. I hope that's helpful. I have an awesome day. Goodbye.
