My considerations about React’s beauty started when working on a side-project. As most coders with coding as their profe

Author : gebin.josemuri
Publish Date : 2021-01-06 19:51:27


My considerations about React’s beauty started when working on a side-project. As most coders with coding as their profe

I find semicolons in JS code an unnecessary noise, and I’m happy taking the risks that come from not using them. After I incorporated StandardJS into my reference example, I was left with the following:

Following the language speakers’ analogy, a few souls use the language for aesthetic purposes and a means of self-expression. It is generally the case for poets and literary writers. How do they look at foreign language words? Well, they’ll undoubtedly see them differently. Their perspective is analogous to my view here, as it looks at language from its power to express ideas while also considering it aesthetically. From this perspective, the use of JSX is unnecessary: it adds noise and does not contribute to the expression of the ideas it expresses.

My answers to this question are more often than not something else that not React. But every once in a while, you compare every trade-off; you look at your project from different perspectives; you try to rethink the features you envisioned and the requirements you had; and still, at the end of the day, React will be your answer. With those cases in mind, I reframed the original question to: “how far can I go to make my React code more pleasing to view while still keeping it React code?”

The consequence is that sometimes, although I might find one programming language, or framework, or tool, unpleasant to see or use, it is the one I need to see my code taking the shape of something real in a reasonable time. Maybe this is due to some tooling, the big community creating things around it, or some other technical trait. Regardless of the reason, my coding-as-a-hobby time is scarce, and although I want it to be enjoyable, I also want to make the best of it, which means using things that do not always comply with my aesthetic standards. This is the case with React.

Moving on with exploring ways of prettifying your React code in the framework’s realm, I found a dead-end. While there are design patterns and simple conventions I could explore, those require assessing their technical implications on a case-by-case basis, and I was looking for something more general. So the next step would need to be in the JavaScript layer.

JavaScript is an extremely flexible language, a quality well known as its double-edged sword. It is also something that can be explored from an aesthetic perspective. There are many different ways you can write valid code, with significant stylistic differences and a few technical implications. Many tools will help you customize and enforce the stylistic choices you make, and between those, there’s one much of my liking: StandardJS. StandardJS is a tool for automating applying a collection of sensible coding style choices to your code. Of notable aesthetic implication between those choices is the exclusion of semicolons.

To start answering the question, I created a Create React App project with a simple React code as a reference. I wanted it to have at least a bit of real-lifeless but still be simple enough, so it wouldn’t get in the way of testing different things. I chose the official React tutorial code, which you can find here: Tic Tac Toe.

https://assifonte.org/media/ept/videos-fuenlabrada-v-mallorca-v-es-es-1xbj-24.php

http://stream88.colomboserboli.com/urf/video-lille-v-angers-v-fr-fr-1qxt-27.php

http://news24.acaps.cat/vac/Video-Deportes-La-Serena-Everton-de-Vina-del-Mar-v-en-gb-tru-.php

https://assifonte.org/media/ept/videos-CF-Fuenlabrada-RCD-Mallorca-v-en-gb-1ach-.php

http://news24.acaps.cat/vac/video-Deportes-La-Serena-Everton-de-Vina-del-Mar-v-en-gb-gmv-.php

http://live247.gruposio.es/mun/Video-lille-v-angers-v-fr-fr-1iov-4.php

http://news24.acaps.cat/vac/v-ideos-Deportes-La-Serena-Everton-de-Vina-del-Mar-v-en-gb-wiu-.php

http://news24.acaps.cat/vac/videos-Sliema-Wanderers-Mosta-v-en-gb-xjk-.php

http://live247.gruposio.es/mun/video-lille-v-angers-v-fr-fr-1huf-6.php

http://news24.acaps.cat/vac/video-Sliema-Wanderers-Mosta-v-en-gb-nkz-.php

http://news24.acaps.cat/vac/Video-Sliema-Wanderers-Mosta-v-en-gb-get-.php

http://svt.munich.es/zzr/videos-fuenlabrada-v-mallorca-v-es-es-1zsp-21.php

http://live247.gruposio.es/mun/Video-lille-v-angers-v-fr-fr-1vtw-10.php

http://svt.munich.es/zzr/v-ideos-fuenlabrada-v-mallorca-v-es-es-1lqr-24.php

http://live247.gruposio.es/mun/v-ideos-fuenlabrada-v-mallorca-v-es-es-1vic-13.php

http://svt.munich.es/zzr/video-fuenlabrada-v-mallorca-v-es-es-1mmv-17.php

http://live247.gruposio.es/mun/Video-fuenlabrada-v-mallorca-v-es-es-1sqp-16.php

http://news24.acaps.cat/vac/v-ideos-lille-v-angers-v-fr-fr-1khw-8.php

http://live247.gruposio.es/mun/v-ideos-fuenlabrada-v-mallorca-v-es-es-1hyu-7.php

http://news24.acaps.cat/vac/Video-lille-v-angers-v-fr-fr-1iye-12.php

s dining issues will improve when both our percentages of diners and premium eateries are competitive to our race counterparts — a much larger elephant to mount. In the meantime, the Black restaurateur and patron each must take a look in the mirror. The owner must be clear on what setting they are offering their people. There’s absolutely nothing wrong with a customer being made to feel at home. It is the establishment’s responsibility to make clear whether the vibe is the customer’s living room or dining area. It’s the customer’s job to read the room. Also to adhere to the vision of a Black business (even if said vision is still a bit blurry). The last thing it needs is public defacement at the hands of its base. That makes for one less Black business and more Black dollars into other culture’s communities to not be returned. So let’s not shoot ourselves in the foot. In fact, when in any dining area, best to keep both feet off the furniture. And for heaven’s sake, tip like an adult.

And this is the point where things get subjective: I find this code unpleasant. Again I’m not talking about the technical attributes of this code. When I say it is ugly, I’m trying to express a set of feelings it evokes in me, which are heavily based on my own experience of the world in general and programming specifically. It is from this perspective that I’ll move on to say that the first problem that screams to me is JSX.

A lot has been discussed about JSX since its introduction, but I’ll allow myself a quick consideration of it for the sake of elucidating my point. JSX is messy, but it is also a reality. It comes from a natural evolution of front-end technologies, which have since their beginning some form of XML language to define markup. What makes it different is that JSX usually lives inside your JavaScript code.

Naturally, if, for some reason, React is unpleasant to me, and I want to spend time coding for pleasure, the obvious thing to do is not to use React. And I don’t, most of the time. But code, as we know, has a multifaceted perspective: you have code, the artifact, lines full of symbols you input to the computer, but you also have the result of your code, its output, the real-life implication of the ideas you expressed using a programming language. And I care, and I can derive equal or even greater pleasure from seeing my code interact with the real world.

Replacing JSX is the Pareto principle applied to the beautification of React code. Little effort, excellent result. A move everyone should definitely make if they want prettier React code.

While reflecting on this topic one day, a question arose: Can I write React code that is aesthetically delightful while still keeping my productivity high? I know there are tremendously valuable answers to this question out there in the way of other programming languages and frameworks. All of those will have varying degrees of the same trade-offs, like how hard it is to learn, how much can I still benefit from the React ecosystem, how is the tooling around it, and so on. And all those trade-offs need to be measured differently depending on the project’s objective.

The uniformity and conciseness of the code make for a substantial aesthetic improvement. And we can go further in the no-JSX road. I’m far from being the first person discussing JSX adoption. And hating it is probably as old as JSX itself. I bet the original team behind it had someone saying at least that it was unnecessary. You’ll find plenty of reading on reasons why JSX is terrible and the benefits of not using it. Gladly, you’ll also find technically sound alternatives to it. A prominent one is Hyperscript, which is recommended by the React team in their docs. It is a simple tool that helps you build hypertext using JavaScript. Its React version brings a more attractive API then `createElement` gives us. I decided to try it out together with a tiny library of helpers called `hyperscript-helpers`, and I found that those tools contribute to the code aesthetic quite nicely:

Making a rough comparison with spoken languages, JSX is as if the speakers of a particular language started using a whole set of words and expressions from other languages to express themselves. This frequently happens when a specific subject is innate to a given culture, for example. When people outside that culture, speakers of a different language, face that challenge of expressing ideas about that subject, they’ll often lack the vocabulary to deal with it, recurring to the language spoken by those who “gave birth” to the topic as a way to solve it. Language purists soon get angry and point out how you could say those things without the need for imported words. But people would still use those words, and some of those words will eventually be incorporated into the official language. JSX was born from the need for JavaScript speakers to express UI markup.



Category : general

Why Do Candidates Fail In Real Huawei HC-611 Certification Exam?

Why Do Candidates Fail In Real Huawei HC-611 Certification Exam?

- The mantra "think absent from the box" is commonly listened to by pupils at school. But, while universities inspire creative


You deserve to feel loved, happy and respected in all of your relationships. You deserve to feel comfortable, safe and n

You deserve to feel loved, happy and respected in all of your relationships. You deserve to feel comfortable, safe and n

- Something I realized when I was starting out, and something I often notice in junior designers, is that iteration doesn’t come naturally. Or rather, it seems to be done on a single artboard. I k


Oracle 1Z0-1085-20 Certification Exams That You Need to Checks Out In 2021

Oracle 1Z0-1085-20 Certification Exams That You Need to Checks Out In 2021

- The innovation business is apparently the quickest developing vocation decision in most creating countries.Home your own home.


ARE YOU EMBARRASSED BY YOUR DONALD TRUMP SKILLS? HERES WHAT TO DO

ARE YOU EMBARRASSED BY YOUR DONALD TRUMP SKILLS? HERES WHAT TO DO

- ARE YOU EMBARRASSED BY YOUR DONALD TRUMP SKILLS? HERES WHAT TO DO@ARE YOU EMBARRASSED BY YOUR DONALD TRUMP SKILLS? HERES WHAT TO DO