A small month ago, a major React conference would have taken place in Amsterdam: React Summit Amsterdam. This would’ve been my very first conference in my professional life I would’ve attended. But, as you can guess, due to the global pandemic it was cancelled. Luckily to us, the organizers did a great job and hosted a virtual event at that same date the real event would have been hosted. Aside from that, a replacement conference will be held in September (if all goes well).
In the virtual event many different speakers did discuss many different topics, a full list of the speakers can be found here. The event was livestreamed on Youtube, meaning that I could attend the summit from the comfort of my pj’s and sofa. At the moment of writing, some time to reflect has passed and I can now say what really kept hanging in my brain. There are four talks that really stayed: The Mystery talk by Guillermo Rauch, Controlling apps by Vladimir Novick, AHA programming by Kent C. Dodds & React Query by Tanner Linsey.
I was quite impressed by the structure of his talk (starting with something seemingly random and then building up) combined the passion with he was talking.
Vladimir started his talk with the brain and its magnificence. He followed his introduction with talking about brain waves & how you can measure them: using those headsets with nods that measure activity at some points on your skull. He then showed that more consumer friendly and less complicated Bluetooth headsets (for measuring brain activity) are available at a reasonable price. Since the modern browsers do have a Bluetooth API available to the developers, he reasoned, you could control your website or application with your brain. This can be done by using the Bluetooth API to read values from the headset. He then put his money where his mouth was by showing a demo. In that demo, he was interacting (scrolling, …) with a page with his brain. Lastly, he went a step further to integrating the headset with a drone, so he could fly a drone with his brain.
I did have to say that it was a very impressing talk in the perspective of future technologies and what is possible right now. It was just quite annoying that he had a poor internet connection and a lot of lagging occurred.
Just as all developers have learned, abstraction is the way to go, so Kent added some additional parameters in his function. In his function he then uses an if structure to alter the behavior of the function based on that additional parameter. This way, he told, all the code is reused and the if is then used for the small differences. Again, after some time, he deducted, a new developer starts working on the project and the same time the need for again something similar rises. Obviously, the new developer sees the function and adds another parameter to that function for abstraction purposes.
Although it still worked, Kent pleaded, this piece of code now introduces many issues: First one, by adding parameters the developers created additional test cases. But to make those tests good all possible combinations of those parameters need to be tested and only very few combinations are used. The next issue Kent pointed was that this piece of code will never be altered, because every time something must change the dev will only add lines to that function. This is because the high complexity and nobody know what and where it is used. The last issue the talked about was that the clean code had become a weird piece of spaghetti code.
Kent offered a solution to this with a quote:
Code duplication over lousy abstraction
Which summarizes the ideology that it is not bad to have some duplicated code, because making lousy abstractions is worse. Although abstraction is very important, you should first duplicate the code and adjust it accordingly to the place it is needed and then abstract the common pieces. Most of the time you’ll find out that only very few things are common.
I do have to say that really liked this talk, as it was very clear framework agnostic and very well put together.
This talk started with a small application, that had some state and some API’s for fetching some data. Tanner used that simple application to show the idea of managing the data querying using React Query (especially the hook). He did this by adjusting the small application and explaining it accordingly.
After this talk, I really had the feeling that this could help me out a lot although I don’t remember a lot of technical details.
Although a remote, virtual conference is different than a real one, it still is a great solution for the quarantine problem. But it only works if the both the attendees and the speakers have a good internet connection. After the couple weeks that past, only a very few things kept hanging in my brain: JAMstack with Zeit.now, you can use brainwaves in your (web) applications, Ken’s ideology “Code duplication over lousy abstraction” and lastly React Query for managing data querying.