Hacker News new | past | comments | ask | show | jobs | submit | fc373745's comments login

I completely disagree.

To fix the css + jsx in one file, just write your styled components at the bottom of your component.

If you ever seen a react component completely riddled with Tailwind, you'll realize how messy and uncoordinated it looks.

Even I would consider switching between two files just to avoid that style of css.

Furthermore the necessity to utilize horizontal scroll because adding 10+ more rules will inevitably break your prettier printWidth rule is, by far, the most annoying aspect of Tailwind.

    absolute inset-0 bg-gradient-to-r from-cyan-400 to-sky-500 shadow-lg transform -skew-y-6 sm:skew-y-0 sm:-rotate-6 sm:rounded-3xl

    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    linear-gradient(45deg, #fff, #000);
    box-shadow: 1px 1px 1px 0 rgb(0 0 0 / 0.05);
    transform: skewY(60deg);
    border-radius: 4px;
    transform: rotate(60deg);
Consider these two snippets, after time of not looking at your css code, do you think 10+ rules on one line is maintainable?

Not even close, ask yourself to change a css property - you would have to iteratively go from left to right until you find it, whereas looking from top down you can immediately catch the css rule you want to find.

Succinct doesn't mean maintainable, and sometimes verbosity does.

Tailwindcss isn't even close to being the future.


You seem to miss the bigger point - Tailwind constraint your css use so that you don't imagine stuff in ad-hoc manner.

And you can split, and sort classes with editor plugins which makes it almost equally good as your example.


i think you missed his point to be honest.

Regardless of where place your tailwindcss or where you split / sort classes, reading iteratively from left to right, especially if the css rules are numerous, is not legible.

just looking at the two examples above, and already I can tell how much it would be easier to maintain verbose css.


So u cant manage the little bigger list of words? And you can manage way complex software behavior at the same time? Particularly if it lets you manage small subset of CSS ?


I wrote a “function” for this exact reason. It’ll display the classes in a much easier to read way. It also can type check to ensure that all classes are valid. I say function in quotes because it’s actually a babel macro that’s get compiled down so there’s no runtime cost! https://github.com/fleck/class-types.macro#better-prettier-f...


That's the biggest problem with TW IMO.

It's much more difficult to scan a list of classes in a single line. With CSS I can quickly scan the declarations from top to bottom until I find the thing I want.

Complex nested declarations are also super easy to scan when using SCSS. When you start adding pseudoclasses with TW it becomes a shit show.

And it really makes the markup an absolute mess for anything other than trivial examples.

People complain about not knowing where the styles are, which was a valid concern when doing old school CSS (everything in a couple of files) but I haven't had that issue since I started using SCSS in almost a decade.

When doing front end with components I store the SCSS for the component in the same directory of the component file. Eg: MyComponent.svelte and MyComponent.scss. Super easy and clear. I've also written a small VSCode extension that allows me switch between the component and its SCSS file with a shortcut. I don't even have to open the SCSS file or look for it. I configure Webpack or whatever I'm using to automatically include the .scss files in the component folders. I have all the convenience and control I want without relying on something as convoluted as TW.


explain to me how this compiles

  .class1 {
    .class2 {
      &:hover {
        font-family: value;
      }

     body.some-thing & {
       color: woooooo;
     }
    }
  }


I don't think the example compares. In languages like JS, double, triple or even further nested ternaries are possible. But terser isn't always better because human readability is important. I can easily understood your SASS example because I know SASS, but I'd never write it like that. If I really wanted to add a decedent selector from a body class to .class1, I'd start a new nest on the body tag.

The problem with Tailwind is there's nothing you can do to avoid the much more difficult to scan and understand syntax described above. I personally don't understand why people are drinking this koolaide. I really think this is a fad a lot of people are going to come to regret when they go back to maintain older projects based on it.


> If I really wanted to add a decedent selector from a body class to .class1, I'd start a new nest on the body tag.

a) maybe you don't really know how far up the chain that tag gets called from.

b) it creates new selectors for class1 and class1.class2, as well as class1.class2's hover

c) creates a hyper specificity

now, I'm not advocating this usage of SASS - but it can be a handy hatchet when you need to support multiple themes with minimal changes/effort, much to the chagrin of specificity and maintainability


The point I was trying to make was just because Tailwind doesn't happen to be expressive enough to get you into that particular kind of mess isn't a reason to use it. True, its fair to say you can write bad CSS or SASS, but that's the same for all programming languages. If your main goal is something foot gun free and safe for the inexperienced, might as well go all the way and recommend low/no code or even Squarespace.

I think the reason a lot of ppl think they need tailwind, is because a) they aren't familiar enough with more current CSS techniques like CSS modules and linting which can limit stuff like nested descendant selectors and/or b) they're tricked into thinking they won't have to learn as much about CSS (a dangerous fallacy unless you're sticking to the most basic of prototypes!).


> I really think this is a fad a lot of people are going to come to regret when they go back to maintain older projects based on it.

Yeah 100%

But if you look at the State of CSS survey, TW is still relatively not as popular as Twitter or HN would make you believe.

https://2021.stateofcss.com/en-US/technologies


I guess the point you're making is that TW prevents you from making certain errors.

Which is technically true but irrelevant. TW doesn't prevent you from understanding fundamental CSS concepts such as the box model, cascading, etc. Anyone with even basic CSS knowledge would not write this nonsensical and malicious example you just used.


You can do both of those things with Tailwind. Put the css only components at the bottom and use them in your main component if you want. Break the classes over multiple lines if you want.

The difference between your 2 examples is that TW allowed you to handle media queries seamlessly but you couldn't do that in your styles example.


Each styled-component also increases your css payload size linearly


i'm not sure what you mean by 'seamlessly'

but a media query in styled components would just be

    @media (max-width: 700px) {
        css here
    }
it's not that much harder.

Also, the lack of address of real problems of tailwindcss of OPs comment in terms of mantainability is something you consider.

reading iteratively from left to right especially if it has 10+ css rules, in terms of legibility, is not really all too great.

I would absolutely hate to adjust something in tailwindcss, after not seeing the codebase in a month's time.

Whereas regular css properties, i can easily find by eye.


Your eye gets trained eventually. Also most of our components look something like this once class names start to get long.

  const inputWrapperClass = classNames(
    'flex flex-col gap-y-1',
    'group-focus:border-blue-500',
    isDisabled ? 'opacity-50' : null
  );

  return (
    <label className={inputWrapperClass}>
    {...}
    </label>
  )
In practice our "full-stack" developers are writing less and less CSS because they're just using the components that encapsulate all of this, our frontend developers get code completion for our design system tokens, and we haven't had to ship any new CSS classes in the last few months.

Our new hires are able to just use the design system tokens rather than going in and saying `padding: 5px` and `padding: 4px` because the designer didn't think it was a big deal. They just write `p-1` and that covers it.

All the components get tree-shaken and only ship the styles they need so bundle size gets reduced as well.

If I had my dream team of 10x frontend developers and a perfect design team who always follows the rules they create then yes I would use regular css with css variables, but I don't.

I am more than happy to sacrifice "separation of technologies" for a happier team, more consistent styling, and faster delivery times.


"Also, the lack of address of real problems of tailwindcss of OPs comment in terms of mantainability is something you consider."

Not sure what you mean by that. I've been doing this since we did layouts with tables and shims in the 90s. I've found TW pretty nice to maintain myself.

"It's not that much harder", but a) it's a simple example and b) now you're going to litter your code with a load of hard coded media widths?

Let's talk about something concrete. Let's take a really simple layout that changes border and margin responsively (this, for me, is seamless).

    <div className="m-8 lg:m-0">
      <div className="border-2 md:border-4">
        Content
      </div>
    </div>
How would you do that?


I think it is already the present for people who don’t want to learn CSS.

I can go as far as using some of its standardized constants in my BEM codebases.

Snark aside, I believe the future of CSS is closer to ITCSS - working with the cascade to minimize the need to modify styles.


your vanilla CSS doesn't actually work the same since the second transform overrides the first one


I've tried IBM plex, Fira, and even bought Operator Mono.

Always switched back to Ubuntu Mono.

It may not be the coolest looking font, but the most legible to me.


Agnostic.

There could be a creator out there that never made itself known to us.

Also, my experiences with Sleep Paralysis makes me feel like something is out there.

I went from a devout Christian (7th day adventist) for 20 years of my life -> to atheist -> to agnostic.


Democracy doesn't work.

Even the United States isn't genuinely democratic as most representative hold stock in various companies.

The best way to influence congress in the United States is to lobby, not vote.

And even in the ways that democracy works in the United States, most issues are in a deadlock position.

How long has the United States argued over abortion? the past, what, half century?

And we still go back and forth.

The United States is crumbling right now due to this deadlock with each party looking to overturn the changes that the previous leadership has overturned and so on and so forth.

Democracy is dying.

My ignorance is not as valuable as your knowledge, but this is precisely what democracy implies.

This isn't to say I advocate for Authoritarian governments either, but they do get rid of the levels of bureaucracy and levels of administration to administer changes, whereas in an authoritarian government is way more efficient to deal with changes.

I'd advocate for a benevolent authoritarian, but it doesn't mean that the successor, or the next, won't be a complete asshole, which is why authoritarian is dangerous.

However, the form of government that I would truly advocate for is a meritocratic oligarchy where the few would have absolute rule, but deserve to have that absolute rule in the sense they are benevolent, just, but wise and efficient at the same time.

Democracy is dying. I have absolutely no hope for this deadlock and polarization between the the factions of the United States, especially when most representatives are sellouts to corporations.


There was a period of time where bitcoin was almost exclusively used for illegal substances / activity - predominately for drugs (the only time I ever used bitcoin was to buy adderall on silkroad), but also for things like hiring hitmen, weapons, and child pornography.

To see cryptocurrency grow to what it is today, especially given the context of what it originally was used for is a bit demoralizing.


> what it originally was used for

This "guilt by association" type thinking makes no sense at all. Why would it matter who the earlier adopters of bitcoin were and what they were using it for? This is like saying TOR is bad because most people associate it with those same things (drugs, hitmen, etc.)


It matters because it is basically funding the worldwide crime system, if some bought slaves for 1000s of bitcoin, that is now worth many millions of dollars and guess what? That money is going to be reinvested into a bigger, better and more sophisticated criminal organization.

Crime is a business like anything else, profits get reinvested


if you read the article you would know that the majority of the homeless population in nyc are sheltered as a 1979 class action lawsuit found that it was a constitutional right for the homeless to be sheltered.


Please don't comment on whether someone read an article. "Did you even read the article? It mentions that" can be shortened to "The article mentions that." —- hn guidelines


You're right. that came off as condescending. I'm sorry.



I don’t really know what was meant by this link, but I can say someone I work with does this and it is infuriating. I never know if he is pretending or not when he asks for help. I can’t trust him.


Performance isn't just latency - it's also about the requests and responses per second a service can handle.

GQL notoriously performs weaker to REST in this regard.

>When a user navigates to a page on a web app or deep links into a Single Page Application (SPA) or a particular view in a mobile app, the frontend application needs to call the backend service to fetch the data needed to render the view. With RESTful APIs, it is unlikely that a single call will be able to get all the data. Typically, one call is made, then the frontend code iterates through the results of that call and makes more API calls per result item to get all the data needed.

>For example, I don’t want to navigate through multiple screens to review my travel itinerary; I want to see the summary (including flights, car rental, and hotel reservation) all on one screen before I commit to making the purchase.

I disagree.

Sure, sometimes more than one restful call is made for just one page, but the example given, when architectured properly is just a user foreign key relationship to all its children (reservations flights, rentals, etc), which is just a single sql query.

I don't think the author really understand the flexibility of REST and how much it can emulate what GQL has to offer.

If you want specificity in your query fetching, just add query params or put them in the request body

And if it is the case that you really do need resources from different endpoints, what is preventing you to build that single endpoint in REST?


Isn't a big feature of GQL that it allows you to filter in the query, thus allowing the backend to fetch and render less data?

Also, which properties of GQL make it inherently slower than REST ... ? Both are abstract concepts. (Also I'd argue that GQL is REST.)


> Isn't a big feature of GQL that it allows you to filter in the query, thus allowing the backend to fetch and render less data?

That feature is not exclusive to GQL.


Agree but I believe the distinction is that in GraphQL this is part of specification to address overfetching/underfetching issues.


That is more related to the frontend, the frontend doesn't have to overfetch data.

But the graphql still will fetch that data and just filter what does out, it still has to get that data.

Example is a query like

``` { currentUser { id name todoLists { title items { name } } } } ```

The resolver will likely get the whole user object from the database, then just send name and id. Then when it finished getting the user, it will then query for the todo lists, and then only send the title (even though it got the whole row for each todo list), then after it fetches those lists, it will query for the items. And retrieve the whole rows of each item from the database.

The data the server needed to fetch didn't change, just what the frontend receives. It is still loading and fetching all the data on that query and then graphql filters the results leaving the server.

Also in the above steps, you notice it queries AGAIN after a data set has been retrieve, this causes an N+1 problem.

It is not inherent in the specs or implementation that fixes these. If you want to avoid fetching the whole object you will need custom code, and to avoid N+1 problem, you need batching of data within requests that "caches" or consolidate nested requests like data-loader, and some form of response caching to help with these issues.

Not siding against the tech, just clarifying those cons.


Yes the client queries for only data it needs and server returns only data which client requested.

With this query, { currentUser { id name todoLists { title items { name } } } }

It is up to the server how it is implemented.

- The server can fetch all the data for the user, todolist and items from the database in one go and resolve the client query mentioned above. In this case there will be overfetching from the database if the client only requested user information.

The server can also fetch the data in 3 queries

1> First to fetch the user, lets say with id 1. 2> Then get all the todos for the for user id 1. 3> Then get all the items for all the todos in step 2. Batching/Dataloaders.

All these queries can be executed in parallel on the server side. Does this make the server complex? Yes but there is also benefit to this when the user only request currentUser it does not fetch any todolists or items from the database.


I may be wrong about this, but here's how I see things: I think the two main "variables that depend on" performance are latency and how much computer power you need. And the "variable that depend on" how much computer power you need are server costs, and the architecture of your application.

If we assume that REST serves more requests than GraphQL, but GraphQL is more flexible, that may be a trade off of dev time of the application vs a dev time of the infrastructure. Which would fit with more and more people using orchestration and things like that. That might be a very wrong assumption though.


personally I found gql to have a steeper learning curve in that it adds an abstract layer to the stack. I call it an abstract layer, the author calls it a BFF (backend for the frontend).

As far as dev time excluding onboarding time, lets not forget why gql was created - facebook wanted to separate the data responses to their mobile and web platform

first of all, not all organizations are facebook

secondly, especially for smaller to medium sized startups, not all responses need to be separated, and "shaving" off data for an extra endpoint is not difficult in REST.

and I remember graphql's early website where they made the claim saying that you'll need to have some really huge number of endpoints in order to emulate what graphql has to offer, and since then they have taken that down because of how ridiculous that sounded.

In reality and practice, the number of endpoints that you need to "shave", again, especially for small to medium startups, is slim to none.


> Performance isn't just latency - it's also about the requests and responses per second a service can handle.

Performance is 99% about latency. And, when having this conversation, we are typically talking about I/O-bound latency.

Assume you have a trivial computer system that can only process 1 thing at a time. The number of things you can process per unit time is inversely proportional to the amount of time it takes to process each thing. Adding more threads/cores to the mix does not change this fundamental equation. Many practical business systems have a large component of processing that must occur in a serial fashion.

Think:

Multiple computers: Milliseconds, One computer: Nanoseconds

How much more work can you do if you can finish each unit in 100ns vs 5ms? How would this impact the user experience? Is the reason you cant finish in 100ns because you are doing global illumination on the CPU or because you are waiting for [hipster noSQL solution] to return some packets to your application server?


sure, I can accept that definition of latency. However, the author, when describing latency, only specified the distance traveled to justify a graphql server without implicating anything else.


In this comment you've made a claim that GQL is not only weaker than REST here, but notoriously weaker. The only argument that you seem to have made here is that a REST call "can" do the same type of things that are built into GraphQL.

You haven't supported your position that GraphQL is weaker at all. Everything that I have read, seen and heard is exactly the opposite. GraphQL seems to be the "I will never go back to REST" experience for virtually everybody I know in the field who has used it.

The other issue is that you're fighting the nature of REST itself to make it do more. Sure, you can make any API call take in specific input and send out exactly the output that you need...but REST API guidelines tend to preach exactly the opposite approach. The call should return one thing and if you want more, you need to get it yourself.

I'm open to hearing your perspective on this, but if you're going to make a claim like that you really need to support it.


>the leak was intended to “foster more disruption and competition in the online video streaming space” because “their community is a disgusting toxic cesspool”.

the irony in that it was leaked to 4chan


The irony is that this post itself is ironically toxic. Kekw.


Not really, I would go as far as to argue that it is less toxic than reddit, twitter, and even HN.


Mmm... well, if you're received what you consider to be toxic interactions on twitter, reddit and even here, but not on 4chan, have you considered that the common factor is perhaps not that all of these platforms are toxic...

...but that your views are considered problematic by quite a lot of people?

Perhaps that could be some cause for self reflection before you universally declare the entire platform here hostile and toxic.


> your views are considered problematic by quite a lot of people

What I consider problematic is the fact these people will organize massive efforts on Twitter to ruin other people's lives because they posted wrongthink. They make the 4chan raids I've seen look amateurish.


Indeed. There is some downright grotesque "malice" in Twitter cancel-culture efforts. It's really strange they are not self-aware and call 4chan (~last bastion of free speech) toxic.

Yeah, 4chan is toxic and savage, but at least they are honest and humane in a candid kind of way.

The cyber-bullying's of 4chan is trash though...


Yeah. 4chan is supposed to represent people's unfiltered thoughts, what people really think when freed from social consequences. This produces a wider spectrum than what most people are used to seeing, both good and bad.

While 4chan posters occasionally get organized and manage to operate outside their borders, these incredibly malicious activities just aren't something I associate with them. They're the specialty of groups like kiwi farms who are responsible for the suicide of at least one video game console emulator developer. I was shocked when people told me about byuu's suicide here on HN.


People on 4chan will call you slurs and insults but it is never personal, part of it is due to the anonymous nature. People here will be personally vicious and hostile.

> ...but that your views are considered problematic by quite a lot of people?

You do not know what my views are. It's as if you are trying to prove me right honestly. (btw, I am not posting on reddit nor on twitter, nor 4chan for that matter)

Plus the same could be said for the toxic interactions that you had on there.

> Perhaps that could be some cause for self reflection before you universally declare the entire platform here hostile and toxic.

Again, same thing for you. "Perhaps that could be some cause for self reflection before you universally declare the entire platform there hostile and toxic."


> You do not know what my views are

I’m just going to politely remind you that on HN your entire comment history per account is public.


I do not believe that you went through my comment history in the few minutes that it took for you to respond to me.

Also, something that I did not mention before

> ...but that your views are considered problematic by quite a lot of people?

This is not a justification for toxicity.


Parts of it, yes. But the famous parts are horrible; I don't remember the last time HN ran an international cyberbullying campaign.


I thought it was called “YC Demo Day.”


There's a difference between vicious mockery of a company and its founders on a single website, and having randos holding knives knocking on people's windows.


> and having randos holding knives knocking on people's windows

Are you referring to some specific event?


An amalgamation of multiple events. (I was lying when I implied I remembered the last time 4chan did this kind of thing; it happens so often.)

The one I was thinking of, I misremembered: it was actually an (alleged) stabbing. https://www.theregister.com/2021/07/07/tenacity_maintainer_q...


This is patently ridiculous. The biggest boards on 4chan, particularly /pol/ have widespread support for the genocide of Jews, black people, Muslims and women. Well maybe not all women, a more common view is instead that they should be enslaved to men. This kind of correction should give an idea of what kind of ideas are popular there.


4chan is not only /pol/. The culture between boards is vastly different. Although I do not disagree, /pol/ specifically is toxic.

And it's not as if reddit does not have its own share of similar forums.


Of course 4chan is not just /pol/ but it is the biggest board, and together with /b/ contribute to plenty of hateful content as I mentioned. The culture between boards is different but /pol/ refugees in particular have been spreading to other boards for several years now and it's very annoying because even if a small group of them decide to visit a board regularly then they can ruin the culture because of relative sizes between the boards. Reddit and Twitter have their own problems, particularly with echo chambers but the biggest subreddit on reddit isn't spewing anywhere near the same kind of shit as the biggest board on 4chan does.


Go to any board, /lit/, /g/, /fa/ (maybe less so), will all have a thread or two that you will be able to tell are directly influenced by /pol/ posters. Some boards call them out, most don't.


maybe on streamers with less than 50 viewers. every twitch stream i've seen the chat is easily 100x more toxic than any HN thread. ridiculous comparison


Huh? I am not talking about twitch. If anything this just shows that you disagree with https://news.ycombinator.com/item?id=28771025 which is the post that I am replying to.


lol they got leaked lmfao


I have a theory that the more people use words like “toxic” or “cesspool” the more likely they are the ones causing and creating it.


It's almost certainly tongue in cheek.


They’re using it “ironically” which at this point is coming off as genuine



It would be good to have a streaming service where simps could be called out as such.


Real question - why does it matter to you? If that's how people want to spend their time and money, and it makes them feel good, even if they look foolish, what does it matter to you?

I'm really bad at woodworking, but I do it a lot, and I've spent a crap load of money on it. Does that matter at all to anyone else in the world?


Our societies do regulate how people can spend their time and money in certain regards. I don't think that's necessarily wrong. Smoking is banned, some countries have labeling for unhealthy products, and so on. Things can end up affecting other people in the long run, so I don't think it's unreasonable to contemplate addressing stuff like this.

I think the main issues overall are encouraging parasocial relationships, and also the problem of selling sex to kids. I'm no prude but I think it raises some ethical questions when you have gaming content and sexual content in the same spot. If I had kids, that would matter to me.


Woodworking will leave you with skills, experience and a wider physical social circle at best or re-sellable tools and a story to tell at worst.

Simping is more like an alcohol consumption - damaging and the first step is acknowledging a problem exists, often through an intervention.


to be honest, that's pretty tame as far as dark patterns go.

If a user had already typed their email onto the field, then the user had at least some intent to sign up whatever the user wanted to sign up for.

This makes what ad trackers and ISPs do with how we browse seem like war crimes if you were to call this a 'dark pattern'


A dark pattern is tricking the user into doing something they didn't mean to do. I don't expect or intend my email address to be uploaded before I click submit. I expect it to happen after.


this game just made me realize how behind firefox is to chrome


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: