Hacker News new | ask | show | jobs
by hu3 1822 days ago
This. Throughout my years it was very common to see juniors trying to model static website dropdown menus as recursive database tables.

In practice if a menu has more than 3 levels the user experience will suffer. I keep them at 2 submenus max, possibly 1 if I can get away with it.

Not to mention most menus are not dynamic, meaning they can be just a JSON file or simple HTML.

1 comments

This is wise, but in the healthcare field, there are some pretty huge trees of things that you need to deal with sometimes. I've been involved with building out a structure a lot like MeSH[0] and some disease trees similar to ICD. Some of my implementations I would definitely do differently now because both the tools and my experience have improved. MeSH's "addresses" even match the ltree syntax, so it would probably make a lot of sense to use that.

[0] https://www.nlm.nih.gov/mesh/intro_trees.html

I feel your pain. I consulted in a hospital management software and they had trees spanning 6+ levels deep and it had to be dynamic too.