What Makes Good Code? – Should Every Class Have An Interface? Pt 2

Should Every Class Have an Interface? This is part two in the sub-series of "Should Every Class Have an Interface?", and part of the bigger "What Makes Good Code?" series. Other Peoples' Code So in the last post, we made sure we could get an interface for every class we made. Okay, well that's all fine and dandy (I say half sarcastically). But you and I are smart programmers, so we like to re-use other peoples' code in our own projects. But wait just a second! It looks like Joe Shmoe didn't use interfaces in his API that he created! We refuse to pollute our beautiful interface-rich code with his! What can we do about it? Wrap it. That's right! If we add a little bit of code we can get all the benefits as the example we walked through originally. It's…

1 Comment

API: Top-Down? Bottom-Up? Somewhere in the Middle?

A Quick Brain-Dump on API Desgin I'll keep this one pretty brief as I haven't totally nailed down my thoughts on this. I still thought it was worth a quick little post: When you're creating a brand new API to expose some functionality of a system, should you design it with a strong focus on how the internals work? Should you ignore how internals work and make it as easy to consume as possible? Or is there an obvious balance? I find myself trying to answer this question without ever explicitly asking it. Any time I'm looking to extend or connect systems, this is likely to come up. Most Recently... Most recently I started trying to look at creating an API over AMQP to connect my game back-end to a Unity 3D front-end. I had been developing the back-end for…

0 Comments

End of content

No more pages to load