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

How anyone finds this code maintainable is beyond me: https://github.com/ant-design/ant-design/blob/master/compone...



What's particularly wrong with it? Looks like pretty standard React, with some custom hooks imported, and clearly defined props.

If you start at the bottom, with the actual component (https://github.com/ant-design/ant-design/blob/master/compone...), the logic is much clearer. Most of the other consts are just definitions that you pass to the component (see documentation at https://ant.design/components/table#table).

And for the long list of imports and such, any modern IDE can parse those for you and easily jump to the source or the type defs.

If you're complaining about how this looks vs traditional OOP code, etc., that's just a stylistic choice Meta made for React codebases a few years back. It actually does make components pretty easy to maintain over the long term because all the core logic is just in one long, flat file. Lots of vertical scrolling, but predictable outcomes and easily refactored chunks. But third parties typically just have to mimic that style. That's not on Ant, that's just how JS code is currently in fashion...


table components are typically the most complex. this is cleaner: https://github.com/ant-design/ant-design/blob/master/compone...


Compared to what? It's a complex component that doesn't get any simpler if you change UI platforms.

And while complex, it's not hard to follow.

Here's the source of DataTables: https://github.com/DataTables/DataTablesSrc (https://datatables.net/)


Compared to any major UI library out there. Take QT for example:

https://github.com/qt/qtbase/blob/5d1ded3359ee8bffa33a4b83d5...

That ANT Table is not complex. QT has tons of legacy and supports way more features, yet, code is easier to grasp and maintain. Also, C# and WinForms, if you don't like C++:

https://referencesource.microsoft.com/#System.Windows.Forms/...


This just seems like a comparison of how familiar you are with any of the UI libraries. None of these are simple. You're linking me thousands of lines of code, 6000+ in the WinForms example.

Yet the Ant link is just 600 lines.


I'm not sure anyone does.


It's long but it's not bad imo.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: