• 0 Posts
  • 68 Comments
Joined 3 years ago
cake
Cake day: December 23rd, 2023

help-circle


  • I feel the Team Fabric point so strongly. My team has gone from 2 reviewers per PR, to now 1, and open conversations about going to 0 with only AI review.

    Feels less like a team every day, and more like a room of individuals, with less and less understanding and insight into what others are doing. Everyone is carving out their own kingdoms in the repo, that only they and their agent understand and can operate on, with internal patterns and designs.

    Do we not see how big a risk this is if anyone leaves? Code review was for finding issues for sure, but for me that is at most half the purpose. The other purpose is driving consistency across the codebase, and disseminating knowledge amongst the team.

    I feel that despite the stereotype of software engineers as loners, a lot of people I’ve worked with are deeply collaborative, and this is fuel on the burnout fire.




  • Like, you might have someone working on something in a new codebase but misunderstanding the architecture or just going in the wrong direction in general and a review is the best way to correct course before getting too far in

    I think the article is suggesting this person should be pair programmed with until they understand the architecture and can be trusted to contribute correctly, and I actually kind of agree - it always feels terrible to tell someone a PR they’ve worked on possibly for days is completely the wrong direction, and arguably this is already ‘too far in’ if they’re going to need to essentially start again.

    Intervening earlier in the process should lead to less wasted effort overall, but people often seem to treat pair programming like its two people at 50% efficiency, when it actually saves a lot of cycle time on reviewing code.


  • I didn’t say programming is unecessary, and I’m a proffesional software engineer with a degree in computer science. When I say ‘learn to code’ is over I mean the pressure for anyone and everyone to learn to code because there are so many well paying software engineer jobs.

    This era is over undoubtedly, because all the people who never really cared about software engineering and are just there to collect a paycheck are going to be replaced - but the profession of software engineering will still be necessary, and the abstract maths of computer science isn’t going anywhere as a field of research.






  • I feel like there are two concepts be at confused here. ‘Mocking’ is just replacing an actual implementation with one that reports its usage, so calls or lack thereof can be asserted to occur, and tests can fail if that condition is not met. They usually allow setting side effects and return values on a per call basis also, to inject different behaviours for covering different code paths easily.

    The question is then how do I get a class like DatabaseWrapper to call into an underlying mockDB instead of the normal realDB? The answer, in static languages is dependency injection: the db object must be constructed externally to the wrapper, and passed in in such a way that any object with the same interface is acceptable.

    This allows the tests to pass in a mock with the same interface, and have the class being tested accept it. The class will then run as usual when its methods are called, but we can make assertions about how it uses its dependency. In some languages, such as python (and it seems JavaScript as well) this can be bypassed by monkey-patching the private member dynamically after the object has been constructed to be the mock instead of the real.

    Personally, I don’t think this leads to good design. Dependency injection also allows for a nice port and adapter pattern, were in the future we might replace our SQL database with a MongoDB one, and we have to rip up the application, instead of just implementing a new db class that meets the interface, and injecting that into the wrapper instead.


  • While my experience is mostly C++, I assume these mocking libraries are similar in allowing you to create a class that can report it’s own usage, and allow for arbitrary returns values and side effects, which is incredibly useful, especially in conjunction with dependency injection.

    What patch lets you do is directly overwrite the functionality of private member functions on the fly, which if Java/JavaScript can do I’d love to know, I thought this was a uniquely Pythonic magic.