Forgot your password?
typodupeerror

Comment: Re:Just don't try to write an OS in Java (Score 1) 511

by DamonHD (#47744815) Attached to: If Java Wasn't Cool 10 Years Ago, What About Now?

Hi,

That is a different and also interesting case, and just by bringing it up you'd pass my test.

No, I meant something like:

public static final String CRITICAL_ID = "whatever"

in a secure API. If I use char[] instead what happens if a miscreant overwrites the content of the array; what BadThings might happen?

Rgds

Damon

Comment: Re:Performance improvements have helped it survive (Score 2) 511

by DamonHD (#47744793) Attached to: If Java Wasn't Cool 10 Years Ago, What About Now?

Except that once JIT/Hotspot is involved all or most of the executions *are* of compiled machine code, optimised to the particular CPU on hand and the particular data set for this particular job. So things like dynamic inlining *for this particular job* can allow the JVM to produce *better* machine code which will execute more quickly than statically-compiled code.

The translation takes time, but for long-running tasks that may well be easily amortised away.

So single-threaded Java can beat single-threaded C++.

But I can also bring more CPUs to bear on the code safely with Java for a given level of code complexity (well, now C++ finally has some sensible volatile semantics, that's a little less true).

And there are other factors such as the generally forced synchronous nature of C++ heap handling which can work against it.

Rgds

Damon

Comment: Re:Performance improvements have helped it survive (Score 1) 511

by DamonHD (#47744753) Attached to: If Java Wasn't Cool 10 Years Ago, What About Now?

I promise you that it was worth saving many MB in the .WAR and associated thumb-twiddling time, plus showing me in the logs which library and other routines were actually being used. I never felt the need to time stuff (since performance was at least not visibly worse). Shame on me!

If I get a chance I'll do as you suggest, though it'll be tricky with all the many things going on concurrently.

Rgds

Damon

Comment: Re:Just don't try to write an OS in Java (Score 1) 511

by DamonHD (#47743393) Attached to: If Java Wasn't Cool 10 Years Ago, What About Now?

My favourite related Java question to ask in the context of security is: "What's the difference between char[] and String, eg if I have one in a critical API as a public static?"

I'm quite happy to hear slightly 'wrong' answers as long as someone understands a little about wrapping/immutability and so on...

Rgds

Damon

Comment: Re:Performance improvements have helped it survive (Score 1) 511

by DamonHD (#47743375) Attached to: If Java Wasn't Cool 10 Years Ago, What About Now?

+1 for ProGuard; I use it for my main Java Web app and apart from anything else PG vastly reduces the size of the .war I'd otherwise have to ship.

Also, not all of my target hosts have a full server-class JVM/optimiser, so getting stuff done up front is a good thing.

Rgds

Damon

Comment: Re:Performance improvements have helped it survive (Score 2) 511

by DamonHD (#47743203) Attached to: If Java Wasn't Cool 10 Years Ago, What About Now?

"WILL NEVER": gosh, not true and never has been unless you know the exact CPU and execution paths and data sets that you are compiling for, for all executions of the statically-compiled code. Please don't regurgitate this stuff.

When maintaining a C++ build system used internationally by a large bank I had to guess what the optimal target instruction set variant, cache line size, etc, would be over the lifetime of the output code, which was always a compromise over London/NYC/TOK/etc and a huge range of dev and production hosts of various ages. And with most/much of the library stack unsafe for C/C++ threading even though almost none of our machines (eg desktop or server-farm) where single CPU you could not then and could not now say whether C++ or Java would be necessarily faster on a given machine, given all the CPU- and run- specific optimisations the JVM has available to it that C++ does not.

I currently work on a Java low-latency high-frequency trading platform in the day job and an ASM/C/C++ based microcontroller platform for my start-up. And I think that I've been using C++ and Java for most of their existences, amongst other languages (I've been writing ASM for >30y); I have a fair idea of what is fast and what is productive.

Rgds

Damon

Comment: Re:And when you include end-of-life costs? (Score 1) 409

Well, not entirely. Still has its own nuke, gas and (erk!) coal, at least for now. And still not enough interconnection to depend very heavily on anything outside its borders I suspect (I must look up those figures vs winter peak demand).

Don't get me wrong, I'm not against nuke at all, it's just not the panacea that is frequently claimed IMHO.

Rgds

Damon

Comment: Re:No, school should not be year-round. (Score 1) 421

by DamonHD (#47642467) Attached to: Slashdot Asks: Should Schooling Be Year-Round?

Much (not all) of what they're learning at school is like scaffolding; they need to retain it to get to better things but not necessarily for its own sake after that. I've managed without various apparently-essential rote-learnt elements too. (I loved physics because you had to remember about 4 things to pass the exams, including inverse square law and Ohm's law; I hated biology at times since it seemed to require lots of meaningless memorisation of things best looked up when actually needed.)

But if they drop that scaffold too quickly then all sorts of more interesting and lucrative and enjoyable opportunities will elude them, I think.

Rgds

Damon

Comment: Re:No, school should not be year-round. (Score 1) 421

by DamonHD (#47641241) Attached to: Slashdot Asks: Should Schooling Be Year-Round?

Hi,

Apparently many of your <slightsnark>freedom-loving</slightsnark> countrymen *do* want it that way.

I mainly freelance, but I believe 2 weeks + about 2 weeks of public holidays is pretty much the EU minimum for permanent staff.

(I did fairly badly at school for a long time and then was ill; I don't think I'd have have been able to have had in the US the relatively good and 'entrepreneurial' life that I've had here in the UK. I'm just in the process of getting a new start-up into gear for example.)

Rgds

Damon

Comment: Re:No, school should not be year-round. (Score 1) 421

by DamonHD (#47641085) Attached to: Slashdot Asks: Should Schooling Be Year-Round?

I'm a primary school governor and I believe that the teachers at my school would much prefer a shorter summer break as the amount that gets forgotten each time, especially by pupils with marginal progress and attainment, is eye-watering. And that hurts them LOTS in later life. That does NOT necessarily mean more school days in the year, just differently distributed.

Also, more breaks spread out and less contention for the same block of a few weeks over summer would possibly make for cheaper and less stressful / crowded holidays.

(I also happen to believe that letting teenagers start the school day much later would be more humane and conducive to good results also.)

Rgds

Damon

If you think the system is working, ask someone who's waiting for a prompt.

Working...