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

The most "surprising" thing about both clean and unclean code ... is that they DON'T USE CLASSES.

> Use the platform, use JavaScript !!




I found that the best use case for classes is dependency injection. Have a constructor, inject your dependencies, then use them in one or more functions. However, you can do the same with functions:

    function new_foo(dependency) {
        return function(bar) {
            // Do something here
        }
    }




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: