4 ms·
This is a good example of the trade off between pretty/terse/clever and safe/correct/maintainable. Nginx is well-respected mature software but it's hard to see
by mjw_byrne 6y ago
This is a good example of the trade off between pretty/terse/clever and safe/correct/maintainable. Nginx is well-respected mature software but it's hard to see these issues as anything other than a design blunder. The trailing-slash path traversal thing looks to me like a file system analogue of SQL injection.
I think d3.js is another example of this. It's obviously written with incredible skill but I could never get on with the ultra declarative and implicit style, it always felt like a fight.
These days there seems to be a trend towards a verbose, explicit style, e.g. Zig (no hidden control flow - compare to C++'s operator overload-fest) and Go.
- secondcoming 6y agoWell there is a benefit in being able to read code and know exactly what's going on. For me, reading words requires less mental effort that mentally parsing glyphs.
- im3w1l 6y agoEarly mathematicians used words instead of symbols > To determine two quantities from their difference and product, multiply the product by four, then add the square of the difference and take the square root. Write this result down in two slots. Increase the first slot by the difference and decrease the second by the difference. Cut each slot in half to obtain the values of the two quantities.
- colejohnson66 6y agoIf I’m reading this right, this is saying, given: diff := abs(a - b) prod := a * b` Fine `a` and `b` by doing: temp := sqrt(prod * 4 + diff^2) a := (temp + diff) / 2 b := (temp - diff) / 2 That was a lot of words for something that (I feel) is easily expressed with symbols. It took me a minutes or two to figure out what you meant by “slot”
- jmt_ 6y agoWhen it comes to math at least, I think the key is finding the balance between symbolic and lexical representation. Some ideas are far to "wordy" to not use symbols. Some ideas have far to much depth to just explain with symbols. But using words to explain symbols? Very good in my experience during my math degree.
- 0xbadcafebee 6y agoI think it's more intentional than a blunder. I've seen products willfully resist security features if they don't "fit cleanly" into the "original design". Same for OSS tools where there's thousand of people asking for some useful feature, but is rejected because it goes against some "design principles". (Or because there's no ROI for the company developing the feature)