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

I never understand why people criticize using interfaces for most functionality. How else do you write effective unit tests? Interfaces with dependency injection make unit tests far easier to write. Smartly designed interfaces also make code easier to read and understand. Lastly, adding new interfaces is trivially easy, so why not?



Yeah.

Similarly, walls of text are bad.

I use line breaks after every sentence to fix that.

I see no reason why not.

This way you can clearly tell apart sentences.

Adding new lines doesn't require any more time than just writing a space.

So why not just do it always?

By following this rule I never wrote a wall of text again!


What is an Interface? What is a dependency injection? How can you explain them to someone who never needed to use them?

Do I need unit tests when my code is dead simple, or written in Rust? Etc...




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

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

Search: