When slinging code, by all means assert instead of assuming.
When dealing with customers / bosses as in the example provided, try to agree to build the simplest thing that can possible work.
i.e.: scrape google and don't build a distributed architecture just yet.
Maybe that's all your boss needs, just ask for some feedback and mention that results would probably be better if the app had a distributed architecture and that you're not sure if this is in line with Google's TOS.
Let him take responsibility for wether or not to invest extra time / money in these issues.
disclaimer: obviously there are certain aspects that you would be unwise to ignore, such as securing your app etc. But feature wise, building something small first is awesome.
At first, I started with little things, like leaving semicolons out of my JavaScript. I understand the subtle bugs that may manifest from automatic semicolon insertion, but I've yet to have a problem, and I really love the aesthetics.
I work a lot in a language that supports gradual typing, but I and many other devs fall victim to "type guilt" and annotate everything. I started omitting types where they wouldn't offer a performance benefit, or work as documentation.
You know how you're always supposed to store an Array's length in a `var` when looping with a `for` statement? That way you don't waste cycles every iteration re-evaluating the Array's `length`? If my Array has only a few elements, I'll save myself from the clutter of declaring a new variable and just use `array.length` in my condition. Wild, I know.
Does every function need to be littered with `assert`s? Does every program need 100% coverage? Isn't there room for free-thought where there's a best-practice?
In this case, why not use the 'foreach' or iterator paradigm?
IMO, It's brain dead that programmers have to worry about such details in the first place. It is the task of the programming language to automate best practices that can easily be automated, and to not have to state them every single time. That increases overall productivity and also reduces bugs/mistypes.
I totally agree, and I do use when it's available in a given lang I'm working in/it's not overly cumbersome (some implementations miss the point).