Hacker News new | ask | show | jobs
by vptr 1757 days ago
This. I wish more devs tried to utilize modern css and js directly instead of relying on frameworks.

I try to do this for my own projects but there's gravitational pull toward frameworks in companies.

5 comments

> I wish more devs tried to utilize modern css and js directly instead of relying on frameworks.

Its all well and good saying that, as long as you do not value your time.

Personally, I would rather use a reasonably up-to-date framework such as Bootstrap 5 because Bootstrap has already taken care of the majority of those CSS hacks that are often required to make things look right on various browsers.

And frankly, why re-invent the wheel ? Most "utilize modern css and js directly instead of relying on frameworks" likely ends up looking like "a lot of boilerplate with a few customisations". So why not use Bootstrap for all the boilerplate and spend your time more productively by focusing on the customisations ?

P.S. JS is not a strict requirement for Bootstrap, it can be used CSS-only. But one added benefit of Bootstrap 5 in particular is they've removed the jQuery dependency.

Tbh if you’re not a guy whos not full time doing web dev then you shouldn’t say that. I’ve known html since 1997, and basic js since 1999. It’s exhausting as hell to keep up with all the crap the field keeps making up. I just want a page that looks simple, neat, responsive and shows what I want my users to see. Bootstrap has been the only consistent thing that has allowed me to do that. It allows me to spend a day or half designing the page so I can get back to the data and the backend which is where the magic happens for most people.
> This. I wish more devs tried to utilize modern css and js directly instead of relying on frameworks.

Making any large front end application WITHOUT a framework or a view library is just a bad idea, even today. There is nothing in the DOM or spec-wise that is equivalent to the power of React or Vue, period.

When it comes to CSS, the situation is better. Flexbox, CSS grids, ... have made creating CSS layouts extremely easy. So CSS kind of successfully brought in a lot of things that were directly exploitable by front-end developers.

To this day, HTML and the DOM are JUST NOT RAD for complex UI, period. Web components have a few nice ideas but a lot of flaws (especially support on IOS). Whether you build your own framework or use someone else library, you will absolutely need something that sits on top of the DOM for large front-end applications.

So it's not by choice that most front-end devs have to rely on a framework. It's because the standards are not good enough.

> I try to do this for my own projects but there's gravitational pull toward frameworks in companies.

A simple example. you need a mechanism to manage the life cycle of event handlers on your page, if your app uses the history API. If you do so then you've already started writing your own framework.

Web components failed to address a lot of stuff developers use view libraries for. That's why it is not that popular.

If CSS was not a hack upon a hack I'd be with you but going back to the early 2000s I must have wasted weeks trying to debug obscure CSS corner cases. Yes, we now have flexbox and css grid to replace CSS-P but that has to work with all that came before it. Anything which reduces the time sink of messing with CSS is a blessing.
Yea, I like to use a framework. But I think devs should have the basics down about css. Like margins, padding, div vs. span, etc. I remember reading a css book on vacation in Aruba like 10 years ago, and just having the basics helps considerably, especially when just trying to debug small layout changes.