Link Details

Link 1020177 thumbnail
User 225256 avatar

By mswatcher
via blog.greaterthanzero.com
Published: Aug 26 2013 / 09:37

I am a longtime user of C++, and I have been an author and speaker in the C++ community for many years. Yet, the number-crunching backend of GreaterThanZero is written in Java and not in C++. Does that mean I have joined the ranks of those who have turned their backs on C++? No it does not, and I can prove it: search for “C++ auto and decltype”, and you’ll find that the top result is an article that I wrote only a few weeks ago. The decision to implement the math backend of GreaterThanZero in Java was driven by other considerations, primarily the appeal of Google App Engine as a hosting platform.
  • 6
  • 0
  • 893
  • 730

Comments

Add your comment
User 199813 avatar

agnus replied ago:

0 votes Vote down Vote up Reply

I write code mostly in Java, JavaScript, Objective-C and C++. One of the biggest struggles with C++ (as opposed to Objective-C) is the widespread use of value semantics. Most languages ​​support value semantics only for primitive values ​​and reference semantics for complex objects. Having a single way to follow contributes to language simplicity. Whenever I have to design a new class in C++ I reach a dilemma when a field is a complex object. Following the practice of any other language, then the field must be declared as a pointer, but in C++ the common practice dictates fields to be declared as values. However, this seemingly complexity turns to also be one of C++ greatest advantages. The value semantics offer a *guarantee* regarding the life cycle of a variable. Thus, we see generalized use of this guarantee as memory management tool. String and Vector manage arrays of pointers. Now in C++11 we have the generalization of this with shared_ptr as manager of arbitrary pointers. This programing idiom is called RAII and when you write in C++ is the one you really need to master.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (6)



Voters Against This Link (0)



    Java Performance Optimization
    Written by: Pierre-Hugues Charbonneau
    Featured Refcardz: Top Refcardz:
    1. Design Patterns
    2. OO JS
    3. Cont. Delivery
    4. Java EE7
    5. HTML5 Mobile
    1. Node.js
    2. Debugging JavaScript
    3. OO JS
    4. JSON
    5. Ajax