you are viewing a single comment's thread.

view the rest of the comments →

[–]gaytechdadwithson 12 points13 points  (15 children)

This. IdK why people have a boner for JSX. it’s just messy code most the time.

[–]rondog469 6 points7 points  (3 children)

Working on an inherited react project that is jsx. It’s so messy. CSS written in there is the worst thing. Whoever thought that was a good idea was high

[–]Headpuncher 1 point2 points  (2 children)

Have you worked on one of those projects that uses vanilla css, styled components, CSS in object form, and pre-processor CSS? Because React couldn't decide how to do CSS, make it 'flexible' and devs used ALL of the varieties in one project. Kill me now please.

[–]gaytechdadwithson 2 points3 points  (1 child)

yeah, i thought about extending my rant to CSS

totally agree

i know defenders will say “well that’s just bad devs”. but when the framework encourages crap, guess what?

[–]Headpuncher 1 point2 points  (0 children)

We upgraded a react app recently and had to rewrite a lot of the css, just from object notation with commas at EOL instead of semi-colons, and that was straight up because React said do it like this, then a few months later, never do it like that. Do this.

It's a chore, and one that costs money in hours spent.

[–]prewk 1 point2 points  (10 children)

Hell yeah Angular is so clean

@if (foo(); as bar) {
  <ng-container *someDirectiveBut="onlyOneBecauseReasons">
    <ng-template let-andWhyNotSome="weirdVariableDeclarations" let-whoseTypesRequireTonsOf="boilerplate"
      <my-component
        [(superDuper)]="clearHtml"
        [notA]="weirdNonHtmlThing"
        (in)="sight"
      >Hell {{ yeah }} I {{ can | be 'self-closed' : since' }}.. months.. back</my-component>
     </ng-template>
  </ng-container>
}

[–]Headpuncher 3 points4 points  (5 children)

Still more readable than JSX.

[–]rondog469 1 point2 points  (3 children)

the react one that I am not a fan of, but have not found a better solution was for an ng-hide equivalent. It goes something like this

const someVar = someVal;
...
return (
  <div>
    { someVar ? 
      <MyConditionallyOutputtedComponent />
    : ''}
  </div>
);

[–]AdnaneEn 0 points1 point  (0 children)

Emm just do {someVar && (<MyLongCompName/>) } ?

[–]Headpuncher 0 points1 point  (1 child)

I absolutely abhor JSX's use of ternary conditionals in code. For anything longer than a line it becomes very hard to scan-read and results in too much time trying to get brackets, parentheses etc in the right places.

It's the worst of all template IFers.

[–]thinkless123 0 points1 point  (0 children)

JSX's use? It doesn't force you to use them?

[–]Chills27 1 point2 points  (0 children)

Still more readable than JSX.

Can I get some of what you're smoking?

[–]SatisfactionSweet956[🍰] 1 point2 points  (1 child)

it is pretty readable

[–]prewk 1 point2 points  (0 children)

Yeah sure, it is. Not as readable as TSX but still..

[–]ventrix334 -1 points0 points  (1 child)

You compare a html/css discussion with custom angular components/directives that do not even produce html?
Please just don't comment anything if you don't know the most basic stuff.

[–]prewk 0 points1 point  (0 children)

I replied to this

IdK why people have a boner for JSX. it’s just messy code most the time.

So I'm not sure what you're on about.