<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d10192368\x26blogName\x3dChrno\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://mckev.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://mckev.blogspot.com/\x26vt\x3d7389753422818032331', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Wednesday, April 25, 2012

Objective C and C++

C is the basic of all programming language. It's very close to assembly language. That's why you see a lot of pointers manipulation inside >:).

C++ (created by Bjarne Stroustrup) and Objective C (created by NextStep) are the result when peoples trying to manage C complexity on large projects. One thing we can do to manage complexity of a large project is to breakdown it into several independent objects. Just like when you are constructing a bridge, you want to breakdown the bridge into several independent pieces like deck, bearings, drainage, joints, etc. Each object should be as independent as possible with each other, just like you wouldn't want to have joints system intermixed with drainage system, would you? That's the idea of "Object" in computer programming.

From this: The main difference between the two is in typing: static vs. dynamic. It gets rather philosophical and I find it fascinating in that sense. Static typing (C++) assumes that the world can be categorized (abstracted) perfectly. In other words, categorization is assumed to be inherent in nature. If it fails, it means you made a mistake in understanding the underlying structure of the universe. (This is analogous to Structuralism in the modern philosophy, like Noam Chomsky.). Dynamic typing assumes that categorization is never perfect because it is an order that we humans impose on nature. As such, the flaws are unavoidable. By leaving the typing dynamic (by leaving the definitions of objects as dynamic as possible until run time), Objective-C is able to accommodate situations that do not fit neatly into predefined categories. These situations do come up often in real life situations.

Here's the links on how to program Objective C and C++ if you already familiar with C:

Read this articles too to keep things into perspective:

0 Comments:

Post a Comment

<< Home