35 karma · joined Jul 28, 2019 (7y ago) · 19 submissions
comment 7y ago · link · parent
Dependency injection can be as simple as:
class Printer:
def run(self):
print("hello world")
class Caller:
def __init__(self, printer_class=Printer):
self.printer = printer_class()
def doit(self):
self.printer.run()
In your tests all you have to do is pass a different object to your Caller class. No need to mess with factories, interfaces or Impl suffixes.If the point is just having simpler testability and making dependencies more explicit, this gets the job done.
And since Python is a dynamic language, you can use this with stdlib classes too, so it solves your first complaint.
I've seen it a lot in Ruby and C# lately.
comment 7y ago · link · parent
But it's true, most people really go to Tinder expecting only dating and one night stands.
However, when you're upfront and tell guys you want to settle down you're filtering them, so I guess it's working as intended?
Maybe putting that info in your profile would make it harder to get matches, but at least you'll won't have bad surprises.
EDIT: Another choice is to just keep quiet during dates and probe the guys subtly. Works for some people.
comment 7y ago · link · parent
Tinder is a super lazy product, terrible even. I wouldn't be surprised if they're optimizing for a high number of matches and happy with that outcome.
comment 7y ago · link · parent
Of course, it relieves stress and stuff, but if you're THAT stressed because of the project and need constant reassurance from the engineers, you're clearly in the wrong job.
I had to lead a few engineering teams (wasn't a PM, though) and the only approach that ever worked for me was to check things out in much larger intervals, a week, sometimes even more. Actually treat engineers like adults and be an adult yourself. Let them come to you if they have a problem. Sample the progress in much larger intervals in order to reduce noise.
Micromanagement doesn't do any good for anyone.
comment 7y ago · link · parent
4. Instead of integration tests (or static typing), all systems made by a couple programmers only had unit tests. The call boundary was NEVER tested, and everything relied on RSpec's "allow(obj).to receive" mocking.
So, not only it was very difficult to refactor (because I had to change two or more different sets of tests + mocks), the tests for dependencies didn't fail when I changed function signatures, or even if I removed chunks of code randomly. I had to find which test to change by myself.
In the end we had tests and we had coverage, but they didn't test anything properly and made maintenance a major pain in the ass.
comment 7y ago · link · parent
That's funny, in my LinkedIn circle people have been doing this for more than a year, even marketing people recommend putting the link in a reply... apparently Facebook caught up with that.
comment 7y ago · link · parent
A previous codebase I worked in was terrible to refactor because of the insane amount of tautological unit tests and abuse of mocking.
For new features we stopped writing tests that were too specific and started writing more integration tests. We achieved a leap in quality and ease of development.
comment 7y ago · link · parent
Brazil already have a rich and sustainable wood industry for decades. Extraction mostly in the southeast, in states like Espirito Santo, south of Bahia, Parana. Mostly eucalyptus and pinus. It is a 70-billion industry that is still growing, and is sustainable.
The extraction from Amazon happens on old trees in a non-sustainable way. Mostly trees affected by CITES, and probably exported illegally from Brazil.
This is not something that will change or economy in a scalable way. This will not generate jobs, and will be a compromise, because those trees take decades to grow.
There are laws in place and all we have to do is follow them, and the industry will keep up.
We just have a president that desperately wants to lax all regulations to appeal to his base, and that includes even stuff like traffic regulation.
So, yes, you are in a position to judge Brazil and Brazilians over this. We are not some small country full of poor people, but apparently we're in a fast track to become one. :(