Earlier quoted context omitted.
This is pretty good advice overall. One small change I suggest is to take it easy on Design Patterns and the like. I’ve seen people in OPs position (general smarts but limited production experience) turn into architecture astronauts and start overengineering everything. It can be useful if you’re working on a legacy codebase and need to understand the jargon that can appear in [possibly overengineered] existing codeb…
I've written software over a decade and I loath the design patterns book. I would not give it to a beginner as it would corrupt their mind with useless drivel . It's authors exhibit themselves as morons who celebrate renaming existing computer science concepts while occasionally mixing and matching them. I would not be this uncharitable towards it if it was not such a famous (and hence harmfull) book. It's harmfull b…
Ask HN: How to transition from academic programming to software engineering?
61–70 of 105 posts
Re: Ask HN: How to transition from academic programming to software engineering?
#62I've worked in a variety of companies as employee and consultant and I have some counterintuitive advice that applies to building things on the web: In almost all cases, things like code maintainability, coding "standards", and TDD, go out the window during actual development. I'm not saying this is good, just that it happens (this is more a management problem than a software development one). There are deadlines to…
As someone with experience in both academic and professional programming, I'd say that the difference is that while in the professional world those principles may be sacrificed at times, in the academic world you are lucky to work with someone who even knows what they are, much less how to implement them.
Re: Ask HN: How to transition from academic programming to software engineering?
#63Earlier quoted context omitted.
I've written software over a decade and I loath the design patterns book. I would not give it to a beginner as it would corrupt their mind with useless drivel . It's authors exhibit themselves as morons who celebrate renaming existing computer science concepts while occasionally mixing and matching them. I would not be this uncharitable towards it if it was not such a famous (and hence harmfull) book. It's harmfull b…
Everybody recommends it for no particular reason, and then I read one anonymous post ripping it apart in detail. I’m strongly inclined toward believing the latter and massively discounting most people’s opinion as unfounded, assuming they didn’t read it, and are just trying to convince others that they did. Is this the right way to think about this?
Re: Ask HN: How to transition from academic programming to software engineering?
#64Thanks everyone, the comments are much appreciated. Here's a list of books and other media resources recommended so far in the thread: Robert C. Martin, Clean code: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsma... Vaughn Vernon, various: https://vaughnvernon.co/?page_id=168 Steve McConnell, Code Complete: https://www.amazon.com/Code-Complete-Practical-Handbook-Cons... 2 Clean coder: https://cleancoders…
There are a lot of good recommendations here, and I certainly relate to the instinct to go to books when you're looking to level up a skill set, but I really think what you need is not a bunch of books to read, but a few people to watch do the work. The only real way to do that is to get a job alongside them. You can read the books at the same time; you can ask your new coworkers which recommendations they agree with…
Re: Ask HN: How to transition from academic programming to software engineering?
#65I have hired some PhDs in your situation and worked with others, I personally just went to work after I got my BSEE. My observation is that you're halfway there when you realize that you need to improve, of the folks I saw who did poorly it was because they didn't realize that you could be both the smartest person in the room and the least capable at the same time. Right now, on your first job experience, even a kid…
I would also add that lots of new people waste more time doing TDD wrong than they would save doing TDD right. There are lots of things you only really understand until you've done them wrong.
Re: Ask HN: How to transition from academic programming to software engineering?
#66Earlier quoted context omitted.
I've written software over a decade and I loath the design patterns book. I would not give it to a beginner as it would corrupt their mind with useless drivel . It's authors exhibit themselves as morons who celebrate renaming existing computer science concepts while occasionally mixing and matching them. I would not be this uncharitable towards it if it was not such a famous (and hence harmfull) book. It's harmfull b…
Your comment is very interesting. I recently took a course on Design Patterns. I sat squirming during the lectures because I didn't like what was being said, but couldn't put my finger on what exactly I disliked. What I understand from your comment is that you dislike the Gang of four book because it renames concepts that don't need the cutesy names that they give them. Do you have a problem with the _concept_ of des…
Re: Ask HN: How to transition from academic programming to software engineering?
#67Earlier quoted context omitted.
This is pretty good advice overall. One small change I suggest is to take it easy on Design Patterns and the like. I’ve seen people in OPs position (general smarts but limited production experience) turn into architecture astronauts and start overengineering everything. It can be useful if you’re working on a legacy codebase and need to understand the jargon that can appear in [possibly overengineered] existing codeb…
I've written software over a decade and I loath the design patterns book. I would not give it to a beginner as it would corrupt their mind with useless drivel . It's authors exhibit themselves as morons who celebrate renaming existing computer science concepts while occasionally mixing and matching them. I would not be this uncharitable towards it if it was not such a famous (and hence harmfull) book. It's harmfull b…
Among the few patterns that are more generally useful and have stood the test of time, we'd find Composite, Command and of course Observer.
Re: Ask HN: How to transition from academic programming to software engineering?
#68I have hired some PhDs in your situation and worked with others, I personally just went to work after I got my BSEE. My observation is that you're halfway there when you realize that you need to improve, of the folks I saw who did poorly it was because they didn't realize that you could be both the smartest person in the room and the least capable at the same time. Right now, on your first job experience, even a kid…
Any advice to deal with this kind of people would be much appreciated. I had a hard time trying to convey basic software engineering practices such as not hard-coding file paths, using version control instead of filenames to manage versions, removing dead code, keeping the code at least moderately DRY, more or less sticking to a code convention, etc. They would use all their reasoning power to refute what they would see as meaningless pet-peeves. It was tiring. I tried to provide pointers so they could find out for themselves but they gave it zero interest. At the moment I've given up.
The simple fact the OP is asking this question here means she or he will almost certainly do greatly.
Re: Ask HN: How to transition from academic programming to software engineering?
#69Earlier quoted context omitted.
I would also add that lots of new people waste more time doing TDD wrong than they would save doing TDD right. There are lots of things you only really understand until you've done them wrong.
On this vein "Ian Cooper - TDD where did it all go wrong?" https://www.youtube.com/watch?v=EZ05e7EMOLM
Re: Ask HN: How to transition from academic programming to software engineering?
#70Some general advice I've given multiple junior developers over the years, you probably aren't a junior but most likely applicable to the advice you are seeking. These were passed down to me by other developers. Other HN folk will have links to literature but hopefully my advice will give you a precursor. * testing - write your functions small enough to be readable, but not so small their abstractions are meaningless…
> testing - don't reach into your code's modules and mock. Instead use dependency injection with non-testing defaults Could you please go into more depth with this?
Why external dependencies are a good thing to mock is not just related to testing, it's related to code rot: external dependencies tend to change under your feet, so isolating them from your code base is a good thing, especially if you want to minimise vendor lock in. And for tests, it helps you simplify the test environment.
Internal dependencies aren't like that: they only change if you change them, and they're already part of your environment. Mocking them just complicates your code without simplifying your tests.
---
Now there is this idea that modules should be tested "in isolation". Imagine you have three classes, A, B and C, such that A uses B, and B uses C (and C is self contained). Without mocking, testing A will automatically involve B's and C's code as well. Mocking lets you test A alone, without the distraction of B and C.
This is mostly bullshit. If A depends on B all the time, there's no point into making B a parameter (dependency injection). It's simpler to just hard code the dependency. As for the tests, who cares about isolation? If A is only used when it depends on B, there's no point in testing it under other conditions. More generally, it is okay to pull in the transitive closure of dependencies when you test a component.
Of course, you should have tested each dependency (C, then B) before you test your module (A). That way you can mostly ensure the absence of bugs in the dependencies. For instance, if the tests for C and B succeed, and the test for A fails, the bug is probably in A. The order of the tests also matters for the test suite: if the tests for the dependencies are ran first, the first failed test should point to the failed module (instead of a user of the failed module).
Now if your program is highly stateful, you might have to mock. Testing a highly stateful program without mocking requires setting lots of bits of states, and making sure all the pieces of runtime state interact with each other as they are supposed to. But then the problem isn't the lack of mocking, it's the fact your program is highly stateful in the first place. Make your program less stateful, first, then it will no longer need mocking.
---
There is this mistaken notion that we should mock because if we don't, we're no longer making unit tests, we're making integration tests. The answer to that is simple: unit tests aren't the holy grail they are touted to be. Don't force them. If the dependencies are well tested (which they should be), then you can trust them like you would the standard library.
Besides, the integration tests will catch more bugs for less effort than pure unit tests (with mocking) would have done. Don't waste your time with mocking, just go catch the bugs.