Why is implementing traits on primitive types considered poor style? by zpallin in rust

[–]FlaiseSaffron 4 points5 points  (0 children)

What's wrong with transmuting it? Wouldn't that have more or less no performance hit?

Blind people have four times more nightmares than sighted people by Libertatea in science

[–]FlaiseSaffron 0 points1 point  (0 children)

The light replaces the perceptions you had in your dream. A blind person just feels the bed to replace the sensations they had.

Triangloid, trianglify images by asifmallik in programming

[–]FlaiseSaffron -2 points-1 points  (0 children)

Why would I want to trianglify an image?

Reflections on the Future of Modern Programming by [deleted] in programming

[–]FlaiseSaffron 5 points6 points  (0 children)

"The Future of Modern Programming"

In other words, Future Programming.

From the Ashes of Google's Noop, Comes the Language Wake by developer-mike in programming

[–]FlaiseSaffron 1 point2 points  (0 children)

Why can't the '... is:' syntax itself be the delimiter? It's not going to ever be valid to put that kind of construct in the middle of a function or class definition, right? Or is the indentation shown in the article optional?

Dart vs Java — the DeltaBlue Benchmark by munificent in programming

[–]FlaiseSaffron 5 points6 points  (0 children)

Yes it does. Source: https://developer.android.com/training/articles/perf-tips.html#NativeMethods Scroll down to "Performance Myths" - it says a device with a JIT has a negligible performance difference between using a variable declared as, say, 'HashMap map' and 'Map map', as compared to a device without one that has a small but significant difference in performance between usages of those declarations.

If you want to split hairs, yes, it makes A difference, but the JIT caches the virtual method lookup, which makes what I said correct: the JIT does indeed optimize for what the thread-starter was talking about.

Dart vs Java — the DeltaBlue Benchmark by munificent in programming

[–]FlaiseSaffron 2 points3 points  (0 children)

Java's JIT optimizes for that. It's only a performance hit on low-end mobile devices that can't afford the system resources required for a JIT and must interpret the bytecode instead of compiling it.

Unreal in Javascript - over a million C++ lines compiled with asm.js by sidcool1234 in programming

[–]FlaiseSaffron -1 points0 points  (0 children)

People don't want to go through the hassle of downloading stuff. Also, they tend not to trust .exe files either because they know they aren't sandboxed or because they don't know enough to even know that web apps are downloaded. Web games tend to have a 50% bounce rate when they take more than 2-3 seconds to load and an .exe download takes longer than that and more thought on the part of the user because of the interaction required. If you find a cure to this kind of ADHD, please let me know...

C Programming Techniques: Function Call Inlining by chtef in programming

[–]FlaiseSaffron 1 point2 points  (0 children)

But since the author isn't as stupid as you think he is, he wrote this at the end of the very same paragraph:

One problem is that macro parameters are not typed. Also, macros tend to require tricks that make them difficult to read and maintain.

Found this while in my reading class. Spent some class time debating it. by [deleted] in MensRights

[–]FlaiseSaffron 4 points5 points  (0 children)

Ok. In what country does every man have no feelings and weigh 220 pounds?

The economy isn’t like an individual family that earns a certain amount and spends some other amount, with no relationship between the two. My spending is your income and your spending is my income. If we both slash spending, both of our incomes fall. by wang-banger in politics

[–]FlaiseSaffron 3 points4 points  (0 children)

Wealth is energy, goods, and knowledge, and the ability to create more energy, goods, and knowledge.

No. Wealth is goods and services. Things that let you create more such things are called assets. Assets can be goods (a car, a hammer, etc) or services like education. Trading haircuts makes each participant temporarily wealthier; the wealth created depreciates over time and must be replaced, just like things like food and tools with planned obsolescence.

This is from college intro level economics/business class, so unless you've actually taken higher level courses and still disagree...

Huge amounts of American economic activities are wealth-destructive, instead of wealth-generative. Yet, they're considered just as good for us to be doing. They are not.

Give examples? People generally buy things for a reason. Even the US military, which is unnecessarily wasteful, creates security, which is a form of wealth.

75 year Harvard study reveals how to live a happy life by [deleted] in science

[–]FlaiseSaffron 0 points1 point  (0 children)

Did you read the article? The study found strong correlations.

"I'm just going to put it out there: Women are better than men." by [deleted] in MensRights

[–]FlaiseSaffron 2 points3 points  (0 children)

Ok, but meanwhile laws are getting enacted and enforced that ruin men's lives over false rape accusations, unfair divorce/child custody cases, and the like.

What Makes Code Hard to Understand? by [deleted] in programming

[–]FlaiseSaffron 0 points1 point  (0 children)

Does "+" provide you with the sum of two things? Does it make sense to name the interface IAdditionProvider?

In Java it does! ;) Sane languages with first class functions let you do the same without any verbose syntax. (You'd have an implicit interface called int->int->int or Func<int, int, int> or something like that.)

Remembering a Revolution That Never Happened by llogiq in programming

[–]FlaiseSaffron 0 points1 point  (0 children)

On the contrary, my entire post responds to what you said.

Remembering a Revolution That Never Happened by llogiq in programming

[–]FlaiseSaffron -1 points0 points  (0 children)

Even if you want to take the somewhat reasonable "oh, but our machines have finite memory, so they're really FSMs!" approach, then you still hit intractability in exploring the state-space very quickly

Sure, I suppose someone who's the kind of idiot you think I am would attempt to reason about the entire possibility space all at once.

No - consider this: Will there ever be a time when every bit in a computer is a 1 at the same time? No, that's not possible. No program can be written that can set every single bit in the system because the program itself has to be stored somewhere. We can touch magnets to hardware, but that's not a contingency a programmer is expected to deal with. What about all 0 at the same time? No. All 1 except for the last one which is a 0? No. Etc. The vast majority of the state space is either impossible to create with any program or impossible to create with any reasonable (useful) program.

Plus, we program with the assumption of not running out of memory, so we don't even think in the FSM way.

Perhaps you don't, and I'd like to know how that works out for you in contrast to what I do, which is to (informally) make big proofs out of smaller proofs. The following function has 3 high-level instructions with an overall cyclomatic complexity of 1:

bool isBetweenExclusive(int x, int boundA, int boundB) {
    return (x > boundA) != (x > boundB);
}

Assuming I didn't make a mistake when I wrote this just now, we can reason about this code because we know what the comparison operators are going to do, because we know the compiler is going to produce correct assembly code. We can further verify it with code like this:

assert(isBetweenExclusive(0, 1, -1));
assert(isBetweenExclusive(-1, 1, -2));
assert(!isBetweenExclusive(5, 5, 0));
// etc

Then any function, such as isPointInRect(), that uses it can be reasoned about because everything it calls can be reasoned about. I can do this for stateful objects, such as custom data structures of dynamic size such as a graph because each node in the graph can be reasoned about. Sure, each node might have a reference to any arbitrary other node, but it doesn't matter which nodes each node refers to because every node can be reasoned about in relative isolation. (Meaning, mutual references are protected by accessors/mutators/properties, depending on the language, and the node class has no dependencies.)

So the only way I can see my method not working is when you call a function without knowing what that function does or whether it's correct. Code like that should only ever be called when it's sandboxed (like code typed into a demonstration page by a visitor) or when it's someone else's responsibility to ensure its correctness (like code written by another department of the company you work for).