Hacker News new | ask | show | jobs
by riskneutral 1634 days ago
You would think that they would have at least have made it into a configuration file, instead of literally hard coding rules for specific website domains directly in the browser rendering engine C++ code?
1 comments

But why would they make it a config file, when they can just add it to the code?

Config files are like code, but even more shit. You never get the full set of functionality that you get with code, the compiler doesn't check your work, code navigation can't help you, and there's no debugger.

Whew, you need to try some Dhall then. Types, functions, imports all in a non-Turing-complete configuration language.
It sounds kind of funny to say “this should be in a config, not in code, but here’s a config language that lets you code your config”.

Regardless, I don’t think Dhali was around at the time Quirks.cpp was created.

Funny story, my first exposure to ruby was using it to write ant (or was it maven) config files (EJB nightmares) because the XML config sucked pretty bad (around Rails 1.0 era). It was far more concise and easy to work with, being an actual language and English readable, but I was never sure it was a good idea in a large team environment. If Java hadn’t been so cumbersome I would have used it for config as well instead of the hot garbage XML config was (is still?). I’ve seen a bajillion attempts at config languages since then. Most not great.

A lot of times 2 variables and a `map` function is all I wanted and the config would have been pleasant. Getting type errors in my editor and being able to extend record defaults was the cherry on top.