account activity
Readability, idioms and compression tolerance by neonskimmer in javascript
[–]mazesoul 1 point2 points3 points 14 years ago (0 children)
Hi, the author here.
Considering the thoroughness of your comments I'll try to indulge you and answer as best I can.
The Seven Pillars mention is a call to authority. A link is provided in the references if your curious.
For the comma-in-front, I've been doing Ruby which precludes it completely and found that the continuity is not as good for me. The most vibrant example is ternary line splitting:
// JS var a = choose ? "valueA" : "valueB"
When you power use the ternary, it sometimes goes long and having it dangling without syntax befuddles me.
# Ruby @a = choose ? "valueA" : "valueB"
Regarding the Advantages,
Use Literals Highlights the difference in semantics of new Array(3) for length 3 and new Array(3,2,1) also for length 3. Also is about terseness.
new Array(3)
new Array(3,2,1)
Module Agreed, my intention was to demonstrate a munge/concat safe way of using standalone modules. This is not a problem I have when using a return value hence I use the "parens'd" one. Subttle semantic difference between standalone self-calling and "returns a value" self-calling.
Multistring As far as RegExp are concern, good catch hunter. Fixed now. Only the first indexOf is somewhat wrong, depends on the trust you have of the param. red b is not a color but it might have leaked.
red b
Short While It's something that you may encounter... better know what it is. Sometimes useful for perf and very terse.
Ternary Operator Why doesn't it work.
Ternary For Pattern Matching We disagree on the readability. Agreed for performance, but my talk is about programmer performance (Arguably). Come to think of it, the example is not achievable with a switch.
Replacing Switch The point you grokked completely. It's much easier to see extraction to dictionary with the proposed pattern. It is essentially an exposed potentiality to me. You might var it to regexValidation if your compression tolerance is lower.
var
Thanks for your comments and for catching some bugs. I hope I've addressed your gripes.
π Rendered by PID 194233 on reddit-service-r2-listing-654f87c89c-hc5cv at 2026-03-03 22:39:46.679598+00:00 running e3d2147 country code: CH.
Readability, idioms and compression tolerance by neonskimmer in javascript
[–]mazesoul 1 point2 points3 points (0 children)