Live data from Hacker News

Ask HN: What has made you a better problem solver in software engineering?

news.ycombinator.com

21–30 of 68 posts

Re: Ask HN: What has made you a better problem solver in software engineering?

#21
Throwing away assumptions and trusting nothing, where it makes sense to do so. I've been burnt too many times by library bugs, framework issues and the other layers between me and what I'm actually doing. When I first started out I used to think that browsers such as Chrome were infallible and any problems had to be with my code.

As a result of being burnt, I'm happy to give up on logging and trawling through code in favour of just taking a PCAP and finding out what's actually going on over the wire. Or stracing my app written in a high-level language which runs in a VM. Sometimes you just want to see the syscalls.

I'm also happy to go digging in the browser's source code. I think my favourite bug to diagnose manifested as a visual issue with menus in a frontend framework. The menus were styled with some CSS, nested inside a media query:

    @media (hover: hover) {
These styles were only supposed to apply on desktop devices with a mouse pointer capable of hovering over HTML elements. The rules seemed to apply on some OnePlus devices though, with just a touch screen as an input device.

Getting to the bottom of this involved creating a test page to reproduce the problem, reproducing it in multiple browsers, digging into Firefox for Android's source code (yay FOSS) to find out how it implemented the media query, writing an Android app to reproduce the underlying data problem and eventually working out that it was a problem in the phone's operating system.

Re: Ask HN: What has made you a better problem solver in software engineering?

#22

Things got a lot better for me when I realized almost nobody gets to the best solution on the first try. Cobble together an ugly and hacky solution that you can confirm solves the problem, then iterate and iterate until you clean it up well enough to ship it.

I think Kent Beck said it best: Make it work. Make it right. Make it fast.

Re: Ask HN: What has made you a better problem solver in software engineering?

#23
Some things that have helped me:

1. Look at prior art. Many problems have been solved before. It can be more fun to dive in and create your own solution, but looking for previous solutions first often saves time, results in a better solution, or may show you that you don't need to write the code in the first place.

2. Write down the problem you are trying to solve before solving it.

3. Solve the problem multiple times before committing to a final solution (if you have time). Unless the problem is familiar, your first solution will not be the best one.

4. Learn when to ask for help. This depends on the scale of the problem, but in general if you aren't making progress within half a day, consider asking someone else for their help and ideas.

5. Do rubber duck debugging. People who talk through problems aloud are better problem solvers and learners. https://www.teachervision.com/problem-solving/think-aloud-st...

6. Make documentation easily accessible. Some recommend spaced repetition like Anki (https://sivers.org/srs) to recall library functions and patterns. I've found that just having locally cached documentation in an app like Dash (https://kapeli.com/dash), Zeal (https://zealdocs.org/) or Velocity (https://velocity.silverlakesoftware.com/) to be a big help, especially if you don't just work with one language every day.

7. Do programming puzzles. I've found it helps a lot with software maintenance and other problem solving at the micro level. (It doesn't generally help with big systems design because puzzles tend to be smaller in scope than that, but a lot of our work is maintaining existing code.) I find https://exercism.io/ the best for this because you usually complete puzzles in the same environment you'll use for daily work (your text editor/IDE of choice), rather than in a web-based environment with limitations.

8. Consider courses like HtDP (https://htdp.org/2018-01-06/Book/ ) and the Clean Code series (Clean Code, The Clean Coder, Clean Architecture) for basic advice on structuring systems. Find others at https://mustread.tech/books

9. Make things. Keep them small in scope to begin with so that you finish some of them.

10. Surround yourself with brilliant people. Feeling like the dumbest person in the room is intimidating but you learn more.

11. Read and learn outside of the field of software. In the words of Feynman, “everything is interesting if you go into it deeply enough.” I like In Our Time (https://www.bbc.co.uk/programmes/b006qykl) and https://www.thegreatcoursesplus.com/ and https://www.masterclass.com/.

12. Look after yourself. Eat well, sleep well and exercise.

Re: Ask HN: What has made you a better problem solver in software engineering?

#24
post #3

There are a ton of stuff to write about this but so little time so I'll try to just give one thing that helped a lot (small effort, large payoff) Be explicit with what phase of your "thinking" you're in. When faced with a problem, focus on giving lateral/divergent ideas and come up with a multitude of different solutions. Don't spend time thinking why/why not a solution is good, just note the solution itself and move…

The "double diamond" is very helpful getting to a good solution. It's my preferred way to structure idea/solution generation.

https://www.hallaminternet.com/how-to-think-creatively-using...

Re: Ask HN: What has made you a better problem solver in software engineering?

#26
1. Be thorough. Be sure you fully understand the issue, instead of jumping to conclusions.

2. Keep asking 'why'. Make sure you understand what the problem (or rather the requested feature) is, instead of being able to parrot what someone else says the problem is. (Even if the conclusion ends up being the same, you need the gained comprehension to determine the right solution.)

3. Separation of concerns. Keep practicing on separating orthogonal concerns that are all seemingly relevant to a problem. Evaluate each concern separately. Drop any of the concerns that are irrelevant in solving the solution. This can save you huge amounts of time, enough to make a deadline you would otherwise never make. (This will also help you to reduce the amount of added complexity.)

Re: Ask HN: What has made you a better problem solver in software engineering?

#27
Big picture: experience is the main way to get better at this. That, plus watching what more experienced folks are doing.

In terms of smaller strategies:

I think stepping back and asking "What is the real problem that needs to get solved here?" is very often the best thing to keep in mind when I'm stuck. Along with "How important is this, really?" These kinds of questions help you to evaluate whether a particular technical roadblock is actually worth solving, or whether perhaps it is not worth the time investment because some other solution (or just walking away) would be a better choice.

Also, I don't know if you need to hear the clichés, but context switching is a huge and important strategy for problem solving — whether rubber duck debugging, talking to colleagues, switching to another medium for thinking (like a white board), or just going for a walk around the block — these are often good ways to get unblocked.

Re: Ask HN: What has made you a better problem solver in software engineering?

#28

Things got a lot better for me when I realized almost nobody gets to the best solution on the first try. Cobble together an ugly and hacky solution that you can confirm solves the problem, then iterate and iterate until you clean it up well enough to ship it.

I think Kent Beck said it best: Make it work. Make it right. Make it fast.

I will add one precursor for those stuck in analysis paralysis....

Make it.

You can't make it work if you haven't made anything.

Re: Ask HN: What has made you a better problem solver in software engineering?

#30
post #21

Throwing away assumptions and trusting nothing, where it makes sense to do so. I've been burnt too many times by library bugs, framework issues and the other layers between me and what I'm actually doing. When I first started out I used to think that browsers such as Chrome were infallible and any problems had to be with my code. As a result of being burnt, I'm happy to give up on logging and trawling through code in…

> ...where it makes sense to do so.

Certainly being able to trace code is one skill, and knowing how deep to go is another.

Post reply on HN