← Back to context

Comment by usere9364382

1 month ago

For the record, JQuery is NOT to blame for the so called spaghetti code. Most people seem to blame JQuery for their own short coming. Most people also do not seem to understand the genius that was contained in JQuery. See "http://eyeandtea.com/crxcmp" for an example of what could already be done with JQuery in the IE8 era. A lot of the things later invented in the browser were to mask these shortcomings instead of admitting to them. The shadow DOM is one example. JQuery already had a feature that rendered the shadow DOM unnecessary, but it would require discipline that most developers did not have nor understand.

Having said that, after JQuery 1.x, and in particular, the changing, the deprecating, and the dropping of things here and there, JQuery no longer made sense. Somewhat similar to the SDL situation in the C/C++ word. An important role of JQuery, similar to SDL, was a strong code contract before anything else, and if the developer now has to account for JQuery's version differences like having to account for browser differences, what is the point.

Dont get me wrong - I really like and appreciate your comment.

However, and adding to other replies, by SDL I assume you mean the Simple Directmedia Layer?

SDL looks rather strong from my perspective and still my typical goto when having fun making a game. You could argue SDL lost some customers in favour of other libraries like RayLib - or moving away from making things from scratch to Unreal, Unity, etc.

SDL still seems popular - as SDL version 3 was officially released less than a year ago (or it feels like it) However, I guess it depends what you need to do.

  • I do mean SDL, and the discussion is not about its popularity, but about something formal, but perhaps I was not clear. First, yes, SDL is a very good library, and I have referred to them in the past for references about issues related to software architecture.

    However, the way I saw SDL 1.x, I am expecting a strong contract. Every now and then SDL drops support for one thing or another. Where you had to worry about different APIs, now if you want to retain your strong contracts, you have to worry about different SDL versions. I am aware of something like the "sdl12-compat" layer for example, somewhat similar to JQuery Migrate, but it does not change the fact that the underlying contract is not strong, is not trustworthy, because of both changing APIs and changing compatibility, similar to the JQuery situation.

> JQuery already had a feature that rendered the shadow DOM unnecessary, but it would require discipline that most developers did not have nor understand.

Could you explain this please?

  • It is the ability that JQuery gave us to scope the css selector to a particular node. If you know POSIX, similar to the "at" functions for filesystems. By CSS child selector, classes, IDs, and what JQuery gave us, you could already develop self contained components, HTML custom elements if you like, without the need for shadow DOM. If you teach people to write well defined CSS, they argue that the CSS is over qualified and similar nonsense. Then the industry turns around and invents the shadow DOM. Any fool can come up with a complicated solution, but the best mind comes up with the simplest. And simplicity is not easy.

    Take a careful look at "http://eyeandtea.com/crxcmp", and see how the need for shadow DOM is completely absent.

    And this simple thing is just one of the geniuses exposed by JQuery.

I don't understand your comparison at all, SDL is a C library not a C++ library

Are you talking about STL? But even there it makes no sense

Wait, SDL is no longer relevant? What is the alternative?

  • SDL is very relevant. Not just on PC, also on consoles as ports for all modern consoles are available to platform disclosed developers. (See READMEs in SDL repository.) Calling SDL outdated / irrelevant is definitely an overstatement despite most developers using UE or Unity nowadays.