Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×

Comment Re:awkward! (Score 2, Insightful) 184

Even more so for the kernel developers that blacklisted the Samsung drives.
These developers should probably be banned from kernel development or atleast banned from making decisions regarding functionality.
Creating code with a bug is human, not doubting your own code and blaming somebody else is stupid.

Comment Re: Swift (Score 1) 365

I think I'm going to have to disagree with you here.

The ternary operator is just syntactic sugar for an if..else statement, I don't see how this is any different except for prettier (subjective!) syntax. Also ternary is best used with caution. Complex ternary expressions are the embodyment of "Well, that escalated quickly". Also, you seem to be describing MVVM, which still uses all the conditionals, it's just hiding it from you at the expense of flexibility.

I don't like replacing states with arbitrary ranges of a number. In your example you assume some way of knowing in advance the length or duration of something. This is simply not true in many cases and would give a false indication of knowledge. In your example set [not started, arrived] you imply only being able to know the initial and final state, yet the 0.75 seems to indicate a high level of accuracy. These are not comparable situations. If you had only had knowledge of initial and final state, the number would essentially be treated exactly the same, using conditionals. If you had the accurate information to indicate progress, you wouldn't use states in your model anyway because you'd lose information.

All I'm seeing is some rules of thumb and low-level optimalization strategies --examples where a good solution doesn't need to use conditionals-- but no solid argument against the use of conditional expressions in general. I'm not disagreeing with most of the examples you give, but they are very specific and do not seem to support eskewing conditionals in general.

Comment Re:Here's a thought... (Score 1) 318

Don't [...] put yourself in a position where others can post embarrassing photos or videos of you online

Seriously... were you ever a kid or a teen yourself, or were you born a boring old grampa?
Doing embarrassing things is what kids do; it's how they learn what not to do.
The problem is hypocritical people who like to pretend they never did anything embarrassing when they were kids.

Comment Re: Swift (Score 1) 365

Do you have an example of code without "if" (or similar) statements that is more easily readable than the equivalent with "if" statements would be?

It seems to me the only way would be to either use numerical tricks, which you say you like even less. And to which I would agree (though I've used them on DSP's because true branching would be dramatically slower). Or to abuse loops (which are essentialy "if" statements with "goto"s) or things like the Strategy design pattern.

Slashdot Top Deals

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...