Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×

Comment Re:What's that sound? (Score 1) 106

For the record, Google's very first claim (about copying variables doubling memory consumption) is dubious. Although the language itself passes most variable types by value, the PHP interpreter copies variables lazily using copy-on-write. So in general, "aliasing" variables for readability should be OK. However, I'm not sure whether the interpreter copies individual array elements lazily...

Comment Re:Gold selling is a good idea (Score 1) 424

... I don't find playing the auction house fun. In fact, I find it highly unethical. You're taking advantage of people who don't know what things really should cost.

Uhh, just because I choose to undercut my competitors (other sellers) doesn't mean I don't know what my loot is "worth". I hardly feel taken advantage of when the gold's rolling in faster than I can run to the mail box - gold I can put to work immediately, while my higher-priced competitors twiddle their thumbs.

Comment Re:Perfection Has a Price (Score 1) 726

One thing I cannot understand: How programmers continue to fail to encode data in a context-appropriate way before operating on it. When I code, I don't even think about it - I just do it. The brain cycles I save, I spend on higher-level problems.

If I need to output some data in the context of an XML document, I entity encode the data. Bam! - done. I don't stop to think about how likely it is the data will contain control information; whether it'd be worth the extra 1.5 seconds (of typing) to encode it; that the data provider (a user, say) ought to know better than to include "funny" characters...

I agree with you that the price of perfection is too high for most applications, but come on. Failing to sanitize data moving across major boundaries (the client/server boundary, for example) is like failing to check whether the garage door is open before attempting to drive through it. Don't excuse that crap.

Comment Re:Learn C and Python (Score 2, Insightful) 997

... and those extra semi-colons "just in case" are also ugly.

En garde!

To me, omitting syntax that isn't strictly necessary is a form of premature optimization. It takes more work to determine whether a statement needs to be terminated with a semi-colon than it does to subconsciously terminate _every_ statement; it takes more work to translate between the block and inline form of an if-statement as code evolves; it takes more work to rearrange case statements if some include an implied break.

I used to strive for "compactness" in my code. When I realized how much keeping track of all my own formatting rules and exceptions was costing me brain cycles (plus the aforementioned issues), I switched to striving for consistency.

Slashdot Top Deals

"Experience has proved that some people indeed know everything." -- Russell Baker

Working...