Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×

Comment Re:Why bother? (Score 1) 421

Compiler optimizations don't really help if your code is I/O or input-bound, which accounts for most of the code written today - so users rarely see the benefits. Occasionally you get a situation where one particular code path is CPU-bound and is hit often enough that optimizing it matters, but in that case it's usually still easier to use C++ for that particular bit, and some other high-level language for the rest.

Granted, with all the changes already in C++14, and more good stuff coming in C++17, C++ itself gets more high-level every year. Right now I'd say the problem is really more with the tooling than with the language... debugging C# or Java is still a much more comfortable experience than debugging C++. But it doesn't have to be that way.

Comment Re:Why bother? (Score 1) 421

Promises and async is indeed a good point. I've been writing async (UI) code in C# for the past two years, and have almost forgotten what a mess it was before tasks and await.

BTW, async/await is also proposed for C++, though it is a much more generalized construct there:

http://www.open-std.org/jtc1/s...

VC++ has a preview of the implementation in the current betas:

http://blogs.msdn.com/b/vcblog...

Comment Re:Revolution (Score 1) 628

But the rich will not recognize that until the mobs with pitchforks are breaking into their gated communities.

It only needs to happen in one place for others to recognize the urgency. Just like the communist revolution in the USSR prompted the rise of the welfare state in the West (and, with the collapse of the USSR, welfare state is also slowly evaporating).

Comment Re:Why bother? (Score 1) 421

This is subjective. But it certainly goes beyond "remembering whether to capitalize the first character of your methods and variables", at least if we're talking about idiomatic C# vs Java.

Granted, Java is catching up with lambdas and the associated library stuff in Java 8. But it is still hampered by type erasure, and libraries haven't picked up on their use yet, while in C# the patterns that only really make sense with lambdas have been idiomatic in libraries for a few years now.

Comment Re:Why bother? (Score 4, Interesting) 421

Perf of JVM vs CLR is a complicated topic. Generally speaking, JVM (HotSpot, specifically) has an edge when it comes to optimizing code, but CLR has an edge in that some of the language semantics generate more efficient code to begin with. User-defined value types (structs) and non-type-erased generics thereof make a big difference there.

HotSpot is better at optimization because it can afford to be slower - it can interpret the bytecode for rare code paths, and only kick in the full-fledged optimizer after it figures out that something is worth optimizing. CLR doesn't have a bytecode interpreter at all, it always JIT-compiles on first call - which means that the compiler has to be fast enough, and that in turn means shedding slow but effective optimizations.

Of late, .NET Native is an interesting piece of tech that precompiles .NET apps using VC++ compiler backend. So you get all optimizations in your .NET code that C++ normally gets. Of course, it's still slower due to the more deterministic but less memory-friendly sequencing and memory model, and all the extra runtime checks, but it's still faster than JIT (and, I strongly suspect, HotSpot, though I don't think anyone has profiled them yet).

Comment Re:Make it easier to hire people? (Score 3, Interesting) 628

In particular, humans have done the best in countries that have automated the most.

Which countries?
What is their tax rate?
How much socialism (aka social support) is mixed into their social structure?

The "cost of automation" has been declining for centuries, and humans have been doing better and better.

This is a bit of a red herring, in that for centuries, the declining cost of automation mostly served to free up huge amounts agricultural laborers to do other work.

The issue at hand is that now automation is taking over much of the "other work."

Comment Re:What are the implications for the textbook mark (Score 1) 170

Since I don't know your specific situation, I could be completely misinterpreting what you mean. But it seems you have 0% "figure out the problem".

Yeah, you're off. Really, my solve rate was darn near 100%, but I hit the occasional spot where I was asking 'what the hell are they looking for me to produce?' - and the answer wasn't in the book.

I wasn't counting the problems where I already knew what to do, or could figure it out without outside assistance. That's practice, not learning. Of my learning, IE learning the symbols, the properties of various constants and such, the execution of various rules*, that was done as I said - mostly NOT using the book.

*Not enough time in the tests to re-derive them, had to memorize

Like I said, I could be completely misreading your situation, but from what you wrote, it sounds like if there isn't a template for how to solve every single problem type that you give up.

I'd hardly call what I did 'giving up'. I would work a problem until I not only had it solved, but I understood the solving method. It must of worked, seeing as how I pulled an A in a class where 90% of my grade was from closed book tests.

Slashdot Top Deals

All the simple programs have been written.

Working...