Oh come on. Even the docs itself are a parody on the framework

  • 1
    I mean, look at this simple if statement for conditional rendering:

    {someLogic &&
    <p> some text </p>

    And some people even use (nested) ternary operators for that stuff. Luckely my job is about refactoring
  • 1

    What is the problem with it?
  • 0
    It gets so nasty, so quickly
    I mean, look at the VueJS syntax :(

    Maybe it's better in a nice templating language like Slim
  • 1
    @wildebeest ok I agree, that is not very easy to read and yes, other frameworks can have nicer syntax but react together with jsx or tsx template format is in my opinion easier and cleaner than vue’s v-... attributes.

    This example can be written in lots of better ways, You would wrap it into a conditional element or use a simple if statement around it which reads easier than even vue’s v-if=“...” .

    But that might be just personal preferences.
  • 0
    @Voxera it's time for me to continue reading the react docs and find some noce thing online, because I understand the readability depends on my skill? :-)
  • 0
    @wildebeest well. The example you listed was not very well done. Yes it was compact and for someone with lots of experience with boolean expressions in js it was probably readable but personally I know it is used in googles js compiler and minifier ;) and that was not designed to write readable code.

    I prefer a bit more verbose but readable code.

    Thats also why I dislike the attribute way of vue, you have to escape any complex expression to prevent breaking the attribute.

    React with jsx or tsx does not have that problem and reads more like normal javascript and html but without most escaping ;)
Add Comment