maynman's comments

maynman | 6 years ago | on: How to Build Minesweeper with JavaScript

That's a fair point. I guess the main argument in favor of single return statements in modern programming languages is ease of debugging and logging. Like most things in programming, you have to consider the trade-offs. A few return statements isn't the end of the world, but after too many you might just want to make some more functions.

maynman | 6 years ago | on: How to Build Minesweeper with JavaScript

Yep, that's why I chose to implement it that way. I generally prefer single return statements. Plus my day job enforces it as part of the coding convention, so force of habit too haha.

maynman | 6 years ago | on: How to Build Minesweeper with JavaScript

Thanks for the kind words, and thanks for sharing! That is a cool pattern. I definitely have a little too much nesting going on in that function, and it could use some refactoring.

I've always felt funny about multiple return statements though, which is probably one reason why a pattern like this doesn't usually come to my mind when considering how to refactor code. I've always liked having one exit point at the end of functions because programmers naturally expect a function to return at the very end. I think minimizing the number of return statements is generally a good thing, but perhaps I have been too strict about applying that rule.

maynman | 6 years ago | on: How to Build Minesweeper with JavaScript

Good call! I agree, I think that would be better. Unfortunately the WordPress theme I'm using wouldn't let me do that by default. I'll have to do some research to see if there is a good plugin for that :)

maynman | 6 years ago | on: Ask HN: Why are successful open source projects usually developed by small teams

I think this observation applies to software development generally, not just open source projects. In "The Mythical Man Month", Fred Brooks talks about the concept of "the surgical team". One thing he stresses is the idea of having a single, overarching vision of what the architecture should look like. This becomes harder to achieve as more people are added to a project. More opinions are tossed around and debated. Lots of people have lots of good ideas, but not all good ideas are compatible with each other.
page 2