Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: BGB Newsgroups: comp.lang.java.programmer Subject: Re: Android?Why Dalvik? Date: Fri, 03 Jun 2011 22:12:43 -0700 Organization: albasani.net Lines: 39 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net qjhmJWX7fBNarGCuiQUx3RsYpZbguG0I/8CsX8Wg6N0/qPhN65tYsZ6G8A8Dk8LEErid9tBFrVyxcabM+bTXQg== NNTP-Posting-Date: Sat, 4 Jun 2011 05:15:53 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="pYdAVyHyQcrnOynAEUva3xoh9XBmo6VK5fUoDV5XjvNTc8dYZSq0gbQqqatFPAPkmrxJsRM7oKAzync+vp0/KZKeaQDktHBo4D/0J72pBwuAxd1bqyOO7fvOVgrqFPTV"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: Cancel-Lock: sha1:vAU/jg3MCyGZvnA1XzpCLTVsma4= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4973 On 6/3/2011 7:38 PM, David Lamb wrote: > On 30/05/2011 6:55 PM, BGB wrote: >> well, IMO, trying to homogenize the environment is itself a problem... >> >> this is actually part of what I think is a weak-point of the JVM >> strategy: >> they try to gloss over the real OS/... by basically creating a new layer >> of abstractions, and wrapping everything in the new API. > > Writing portable code usually means giving up on some specific features > of individual OS's ("homogenize" seems to me an uncecessarily pejorative > word for it). I'v written #ifdef code like you've suggested and got > tired of it; even with just keeping them inside header files, eventually > the whole thing became unwieldy. I'm sure that *some* programs need to > be OS-specific, but fewer than some programmers think (not a dig at you > personally; just remembering some other conversations I've heard on > similar subjects). most of my stuff has been compilers, VMs, and 3D engines... in each case, most of the platform specific code tends to be centralized in various places (with lots of "#ifdef's"), with most things being re-exposed via "generic" APIs. however, without being able to use advanced/OS-specific functionality when needed, what is actually possible is greatly limited... sometimes in the innards of a program, it is necessary to do some very nasty and non-portable things in order to make the program work, and if one can't do these things, then the answer is simple: the program wont work... but, this doesn't necessarily mean it can't work on multiple targets, just the "deep magic" has to be addressed for whatever targets are in question (as a failure to address it may result in a non-functional program).