Hacker News new | past | comments | ask | show | jobs | submit login

I just ran into this quote somewhere (I am rewording cause I can't find it)

"It's like eye glasses, you'll know when you need them" - Some smart guy

I needed something jQuery could not provide, easing my work load.

Let's look at this from 2 different perspectives:

1. You're building an app, and work with multiple tables to render and work with. And you have integrated form elements with the table cells that affect other cells. You need to add/remove items using AJAX data calls to the server and sync the display with the server data. And you fully expect to be making more changes in the future.

2. You have a table on a website(s) as content you want sorted.

I've used jQuery to do both, but with Vue.js I cut my code base down by 1/10th at least, and it works smoother and easier and way easier to extend and add new features.

I have used jQuery exclusively for all my front end work, but I have an app that just kept needing more and more features. And every time I had to add a feature I went through so many hoops and patching stuff and dealing with edge case uses, and _hoping_ the jQuery plugins I was using had my back when I upgraded jQuery, or when I needed just a slight tweak on how a table was to be manipulated.

With Vue.js, adding sorting to a table was literally 5-10 lines of code, that I have total control over. This is possible because I don't have to deal with the html directly.

I was a die-hard jQuery man just last month, if you have the time, read my other comments, I defended it to death. And yes, it still likely has it's uses, but in my experience (full stack dev for almost 20 years) I can do everything jQuery can, and often times better, on my own now. jQuery can "simplify" some code, but that doesn't make the code easier to work with or extend, it just makes it "shorter", which isn't much value anymore to me.

Regarding this example: https://www.raymondcamden.com/2018/02/08/building-table-sort...

That's not extra work because I replaced my server side render of the table (which had a library for rendering tables) to doing it entirely on the front end. I just get to pass it data. (yay!)

Also the jQuery plugin I use is hugely bloated, and I only need a fraction of the features.

I have thousands of lines of code using jQuery still active in my code base. I just started with Vue.js last week, and I only tried it because I was so daunted by my tasks ahead to build a version 3 of an app. Within a couple of hours of development everything got easier.

If you don't experience this when using Vue.js (or other reactive library), then jQuery is obviously perfect for you.

--

Edit: This is the jQuery table sorting plugin I used, because I needed heavy duty features.

https://github.com/Mottie/tablesorter

In total, 240k MINIMIZED code plus css, images, etc... The file size alone is incredible. When I am done making a proper component with Vue.js to do the work I use this for, I bet it will be 10k or less easily, and that will include the html scaffolding and rendering to boot.

For a blog post jQuery is just fine. For a fully supported long term app that produces income? Vue.js all the way, even for something as simple as sorting a table.

--

Edit: Consider if you want to change from a table to divs with grid? Or list? You can't with jQuery because you only have a table sorting plugin. All it's classes and rendering are for tables.

https://jsfiddle.net/rg50h7hx/788/

Look how little code it takes to sort the data in that example. This was just crazy to me when I first ran into this.

Here's the actual example I ran into that opened my eyes to the simplicity of using data to render the html through Vue.js

http://www.developerdrive.com/2017/07/creating-a-data-table-...

57 lines of js code for sorting, pagination AND data for the table!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: