DEV Community

Discussion on: I front-end and hate CSS. Here's how I deal with it

Collapse
 
weeb profile image
Patrik Kiss • Edited

To he honest, I prefer the second version in this case. It is much more appealing and readable for me.

Collapse
 
fly profile image
joon

Thank you for responding and pitching in on the subject Patrik :)

At first, I was legitimately surprised that anyone thought so.
But after some thought and putting myself in someone's shoes who have never seen the code before, I was able to agree to some extent.

Perhaps the reason why I find using styled-components so appealing is because I can see the structure straight away since I know what's going on in each and every component.

Could you be so kind as to expand on the subject? I'm curious as to why you prefer the second version.

Collapse
 
shashwatblack profile image
Shashwat Mehta • Edited

Because you're the only one who can picture it.
When you have a second developer, you'd both need to learn each other's naming processes.
The second code on the other hand, is pretty standard. Everyone knows what divs and spans and hrs are for. You use them, then style them appropriately.

Another thing is, most of the time when reading the code, you're trying to find functional components, not structural ones. The wrappers and dividers should remain in the backdrop. But the first code completely overwhelms me. I have no clue which of those 500 components actually does some work.

I also prefer to use html5 tags for the big page-level structures. Other than that, every component should be comparatively much simpler to need so much hierarchy.

Thread Thread
 
fly profile image
joon • Edited

Because you're the only one who can picture it.
When you have a second developer, you'd both need to learn each other's naming processes.

I couldn't agree more. This was definitely not something that I took into account when writing that code shippet.

I have no clue which of those 500 components actually does some work.
Completely agree as well.

I also prefer to use html5 tags for the big page-level structures
I googled html5 tags, and I'm not going to lie - did not even know that these were a thing(I only heard of the figure and header tag pretty much)
Will definitely study and attempt to implement to my code.

Thank you very much for the constructive and real-life applicable feedback Shashwat!

Some comments have been hidden by the post's author - find out more