Over a million developers have joined DZone.

Is making Boost more like Java a good idea?

· Java Zone

Easily build powerful user management, authentication, and authorization into your web and mobile applications. Download this Forrester report on the new landscape of Customer Identity and Access Management, brought to you in partnership with Stormpath.

I was reading a question StackOverflow about What is Boost missing? and I was wondering how many of these features are available in Java already and whether making boost more like Java is good idea.


Top suggestions

SuggestionWhat is in Java
SQL supportJDBC
JSonRequires an additional library like XStream, Possibly should be in core Java
AudioJava has basic support. Don't know if it much good.
callstack, a standard APIThrowable.getStackTrace() and Thread.getStackTrace()
Support for archivesSupport ZIP and JAR
Redeveloped collectionsThe same could be said for Java Collections
Standard XML parsing for UTF-8 textSAX (event driven) and DOM (Document object model) parsers for XML
Platform independent GUISwing
Concurrency with lock free collections and atomic operationsConcurrency library
Arbitrary precision floating point and decimalBigDecimal and BigInteger
Python, Ruby and Lua supportNot built in, but there is Jython, JRuby and LuaJava
High performance (sub micro-second) timersSystem.nanoTime()
Better concept supportThis looks like staticly defined duck typing and Java is a long way from having anything like this. ;)
AtomicAtomicBoolean, AtomicInteger, AtomicLong, AtomicReference, AtomicIntegerArray and AtomicLongArray
Thread poolsExecutorService and ScheduledExecutorService
Character encodingCharSet
GPU supportI would love Java to have this as well. There is JoCL but its not exactly transparent or close to the Write One, Run Anywhere model.
Hashing/ChecksumsMessageDigest and CRC32
OS performance measuresThis is poor in Java. You can get the load average but its always 0 on windows.
Co-routinesThe closest is fork/join with anonymous classes. In Java 8 methods will become first class objects which is a little closer.
Fixed size stringsYou can have this in Java. However I assume the point of this is efficiency, which Java is unlikely to match, ever.
Message QueuesJMS
cryptographyJava SE Security
Extend GC to trigger a GC and handle when an object is cleaned up.System.gc(), finaliser() and PhantomReferences
A overflow/underflow safe integerThis would be useful if language support was included, but I doubt that will happen, (like unsigned int)
unification and backtrackingThis could be added in the far future. I imagine after Java 8
SingletonsAn enum with one instance (enum are Objects in Java not int values)
A Persistent Collections Library.Java doesn't have much support for functional programming. This is something which it could have, but I don't imagine it being any time soon.

IMHO, The best suggestions which are missing or could be better in Java are


  • persisted collections
  • JSon serializaton/deserialization
  • GPU support
  • Good OS performance measures

Even more useful would be a common interface and basic support for collections which are distributed and persisted. e.g. standardised/simplified Hazelcast, Terracotta and Hibernate. @Vyadh points out this is not what is meant by a persisted collection in functional programming


Last thoughts

While I really like Java, but I have never looked at C++ & Boost and thought; if only it were more like Java. (Some of the limitations of the C syntax are a bit backward IMHO) I have thought this about the refactoring tools in IDEs e.g extracting a method from a body of code (and have it replace any duplicates)

Is making C++ & Boost more like the relatively heavy weight Java a good thing? Or is it better to use a language for it strengths?


From http://vanillajava.blogspot.com/2011/09/is-making-boost-more-like-java-good.html

Building Identity Management, including authentication and authorization? Try Stormpath! Our REST API and robust Java SDK support can eliminate your security risk and can be implemented in minutes. Sign up, and never build auth again!


The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}