@neothefox me, my 4yo son, and 2yo daughter, we all love Frog and Toad!

@neothefox It's disgusting. __ is "internal" and you can still use them.

@neothefox Why put an underscore when you can just lowercase the private method name.

HA! Joke on the frog :)

@ddipaola just sneak a `#define static` in there somewhere and now there are no private members

(hope you weren't doing anything else with that keyword)

@revenant that's pretty clever! unfortunately, I do use `static` for functions that don't need to be visible outside the compilation unit (and I usually only do one function per file if I can help it)

@neothefox As I've gotten deeper and deeper into IOC, DI, and unit testing, I've found that private methods are a code smell. Why? Because to effectively test the private method, you have to write bigger and more complicated tests around whatever code is calling the private method.

Dangerous programmers know how to invoke private methods using tricks, so rather protect others from themselves, I'd rather protect myself by writing good tests on my code.

In my code almost everything is public now.

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!