@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 :)

@neothefox
I love this. I even know exactly which Frog and Toad story the original is from (Cookies).

@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

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!