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

As someone who works in science, it’s because it mostly feels like a solution looking for a problem. The “unit” U gives the same vibes to scientists as some classes/abstractions thought up by creative programmers feel to software engineers. Imagine your colleague saying you should use a function called

    def doc(val, docstring):
        if __debug__:
            print("using value described as %s" % docstring)
        return val
like in

    x = doc(5, "number of fingers on one hand")
because “this leads to incredibly readable code, and the compiler won’t compile it if you don’t include the string.” Could it be valuable in principle? Sure. In practice? Just a nuisance. A comment will do.

I don’t think I, or my colleagues, have ever run into an issue with ambiguity arising from unitless quantities.




I hate to ask, but is the example you suggested A Thing? I agree that it’s terrible for a handful of reasons, but it also seems kinda nice that you could annotate any variable with a description that’s passed around through its lifecycle.


I don’t think it’s a Thing (TM), but it’s the kind of “abstraction” that someone might feel justified in proposing. Similar things get proposed all the time on programming projects, especially around configuration management, documentation, code generation, resource management, etc.




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

Search: