supporting module system in c++ after two decades - module

.net languages are the perfect example of module system and c++ after two decades decided to implement this feature
can someone tell me why now ?
why so late ?
why did it take two decades to do it ?
I just want to why did they resist to add this feature?
thanks

Related

Is it possible to develop with MassTransit in VB.NET?

I'm a casual developer and typically use VB.Net when writing solutions, as its what I'm most familiar with. Though I aim to learn other languages in the future, such as C#, its very much on the back-burner and so here we are.
One of my current projects would benefit greatly from a service-bus architecture, so I have been researching potential options. Some of the more obvious choices, such as Azure Service Bus, are out of the question, as my application will not have access to the public internet once operational. Looking in to options that could be run within a local site I've stumbled across both nServiceBus & MassTransit as front runners.
My current stumbling block is that all the documentation and sample code seems to be written for C#. My question would be if the frameworks require programming to take place in C# exclusively, or whether I can utilise another .NET language (such as VB) instead. If this is indeed possible, I wonder if anyone could point me in the direction of some sample code? Of course I can gradually reverse engineer the C# if necessary, once I know if VB development is even possible (or practical).
Thanks,
Chris.

PyObjC / Ruby bridge. Is it worthwhile ?

Years ago wanting to write Mac software and having loads of experience with Java WebObjects I tried the java bridge but decided to bite the bullet and learn Objective-C (fortunately since I would have hated having my software deprecated with the bridge). Later I fooled around with RubyCocoa. I learnt Ruby (found it interesting indeed), but found out the hard way that the bridge was far from mature or stable and at the end I ended porting the code back to Objective-C.
Since years have passed, I'm wondering if it is worthwhile investing some time with MacRuby, or even learning Python to use PyObjC. As much as I like Objective-C, I recall being way more productive with the Ruby bridge when it didn't crash. I just would hate investing time to end up with crashy software again.
I would say MacRuby is the way to go if you want to try one of the bridges. It's being developed by Laurent Sansonetti, who's a Senior Software Engineer at Apple working on Ruby.
It's quite functional now, and integrates nicely with the native frameworks. Worth a look, particularly if you already have Ruby experience.
If you want to learn Cocoa programming, ignore the bridges. They will only make writing Cocoa applications more difficult and you will waste a bunch of time getting up to speed.
Specifically, you will need to learn Objective-C to be able to understand both the APIs and design patterns of the system frameworks. Furthermore, all of the documentation and tools are written specifically to support Objective-C.
The bulk of your time in learning Cocoa programming will be spent on said APIs and design patterns; the actual language part is relatively small, by comparison.
Note also that the bridges necessarily incur an impedance mismatch in an attempt to map not-quite-the-same functionality from one language to another.
Frankly, if you know Ruby, then Objective-C should be trivially easy; the object models are very similar.
My personal opinion is use ObjC for Mac native apps.
Use Ruby/Python where they supposed to work good natively without unreliable interfaces with questionable support.
Here is why it is NOT a waste of time. In some cases, Ruby and Python have awesome and well developed libraries that are not available in Objective-C and would not likely be.
That is one of the best use cases.
Example: you wouldn't want to reimplement Rails in Objective-C, (some people might) but you could easily use it, parts of it to power a Cocoa app with MacRuby.
Well MacRuby is dead. There is the commercial RubyMotion.
There is still PyObjc, RubyCocoa and mruby.
One of the other intriguing use-cases is to provide script ability that doesn't stink like AppleScript and OSA.
There are valid reasons.

What are the most valuable parts of Computer Science studies for Cocoa developers?

What are the most valuable parts of Computer Science studies for Cocoa developers?
Another way I might word this question is:
If I’m not going to go to school for Computer Science but want to be a developer working primarily with Cocoa, what are the things I should make sure I learn that I otherwise might miss by being self-taught, and be worse off for it.
Update: Replaced the term "professional Cocoa developer" with "developer primarily working with Cocoa", in hopes that the intent of my question is somehow clearer.
To be clear, I've been working with Cocoa for two years and am comfortable with Objective-C and the Cocoa frameworks, as well as Cocoa design patterns and the developer toolset, and thus am for the most part fluent with the Mac and iPhone platforms. But I have wondered whether I'm missing important CS or SE elements due to being self taught/no formal training, and not coming from other languages or platforms.
This question is for Cocoa developers.
There are many, but things that come to mind imediatly
-Design Patterns (the Cocoa framework relies on many Design Patterns, if you follow them it will make your life very easy, most obvious example is MVC)
-Algorithms and Data structures(this applies to any framework really)
-Memory Management (No garbage collection on the iphone!)
I would question whether there's really such a thing as a "professional Cocoa developer" (from a philosophical standpoint), or if you would want to be one. There's "professional developer", who may work with Cocoa primarily. A professional developer is language-agnostic and as such has a solid career ahead of him/her. A language- or platform-specific hacker has very limited usefulness.
The question to ask is do you want to be a developer or not? If there aren't any good Cocoa jobs available at the moment, or Cocoa is replaced by something newer and better and very different, a professional developer changes gears and follows. Are you OK with that?
If so, a computer science degree definitely cannot hurt. If not, you should probably not put all your eggs in the Cocoa basket and pursue a non-CS degree.
In addition to what's been pointed out already, I highly recommend reading "The Pragmatic Programmer". It contains a wealth of information on how to write software, how to manage projects, and how to develop your career, advice that goes well beyond the documentation you look at every day in Xcode. Some of the topics they cover are ones that you might have been exposed to during a standard computer science degree.
"Professional" is a relative term.. but anyways, this is what i had to go through so that i could easily learn a new language anytime i want and also master it:
started by learning a simple console language (pascal or c++, but i consider pascal being simpler than c/c++), then learned another language just to see if i can do it (c++)
i learned a lot of algorithms and data structures, until i was able to recreate them and even create my own
i moved to a visual approach on programming with Visual Basic 6 (another simple one to start with), and tried to copy lots of apps just to see if i can do it
i learned about Object-Oriented Programming and finished by mastering it
from this step on, learning a new language was like a hobby, like playing!
then i wanted to learn some different topics, like design patterns, multithreading, and so on..
moved from windows to mac, and started learning objective-c: because i already knew lots of languages, it took me 5 days to learn objective-c, and yes, i took breaks like any human being :P
after i learned obj-c, i now had to learn cocoa... this one took me a lot of time to learn, and i still don't know it all.. but i do know most of it :D
What are the most valuable parts of Computer Science studies for Cocoa developers?
Learn that it's important to understand the differences between languages, not learning a particular language.
Are you writing numerical method solvers with a Cocoa frontend? You'll want to take numerical methods. Writing a 3-D plugin with a Cocoa UI? Better learn about Catmull-Rom splines.
A good understanding of computer graphics is required if you want to make some good looking animations :)

What are the advantages of objective c over c++? [duplicate]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have heard mention of Objective-C but I have never used it myself. I was curious what everyones opinion of it was in general and also in relation to C++. Are there any types of projects where it would be more useful or less useful?
Like many others I've just started looking at Obj-C due to iPhone. I've done a lot of C++ and C# and from what I can see Obj-C has a basically different approach to OO in that it adds Smalltalk-like messaging to C. Like C++ it's basically still C-compatible but the OO extensions let you send any message to any object. In that sense it's not statically typed like C++ and C# where the things an object can do are tied to the class it is. In Obj-C you can send a message to an object even if it doesn't support it. The object can then forward it if it doesn't know what to do with it.
The really cool thing is that you can add interfaces (protocols) at runtime and you can add your own handlers that intercept and hide message handlers for existing classes.
All in all there's a lot more flexibility when it comes to message handling, more like what you would do in Ruby or Smalltalk. Whether it's a good idea to have this type of OO grafted onto C or not I can't tell yet, in some ways the C++ approach meshes better with the original idea of C but on the other hand the Obj-C OO approach is more what OO purists like.
From "Some nice features of the Objective-C language":
Classes are objects
Dynamic typing and optional static typing
Categories
Message sending
Expressive message syntax
Introspection
Dynamic run-time
Automatic garbage collection
C inside
C++ fluent
Simplicity
Access to Apple technologies
I find objective-c's syntax a little cleaner than c++'s although I know I'm in the minority here
Objective C's OO features use dynamic typing instead of static (compile-time) typing. That's the major difference in the approaches of the two languages - whether it's an advantage or not depends on your opinion about static vs. dynamic typing.
My opinion is that the syntax of Objective-C is a little "weird" at first, particularly if you are coming from a C/C++ background (as I did). If you plan to write apps for the Mac or iPhone, Cocoa development is the way to go. I had an opportunity to do some development on the Mac for about a month this Spring and opted to write it in C++ using the Qt libraries since I was quite familiar with those and time was of the essence.
If you have a Mac, give it a shot! There is a LOT of info out there on it and there are some good tools for development.
Part of what makes Objective-C so great isn't the language (although that is a big part ot it), it's the Cocoa (or CocoaTouch) framework that goes along with it (at least for 99% of objc users ;-)
In practical terms, I used to be a C++ programmer back in the old "classic" Mac days. Switching to Objective-C, Cocoa and Mac OS X i found I became much more productive. Hard to say exactly how much more productive, but 50% to 100% feels right.
If you're running Linux you can install GNUStep which provides pretty good compatibility with Cocoa. This can get you started on Objective-C/Cocoa development without owning a Mac. The best resources for learning Objective-C [in my opinion] are with Apple.
http://developer.apple.com/referencelibrary/Cocoa/index.html
Well, If you are coding for the some platforms like the IPhone, Objective-C is required. Objective-C also uses dynamic(run-time) typing, which many people prefer over static(compile-time).
WebKit was originally a C++ project (khtml from KDE) that was later adapted by Apple to be more compatible with the Cocoa-environment and thereby got its Objective-C layer.
It is more dynamic than C++ and heavily influenced from Smalltalk. I don't find it "better" than C++ - on the contrary, but some people do.
For Mac and iPhone development, it is definitely better. The latest version has a GC, so if you like that, you'll probably like it better than C++.

Do I have to learn Objective-C for professional Mac Development? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
Do I really have to learn Objective-C to develop solid Mac Apps?
As Mac users tend to use only applications that have a nice (native) GUI, i don't think that Mono and GTK+ or any Java GUI (Swing) will fit their needs.
There are projects like Cocoa#, PyObjC and RubyCocoa, but are they ready for primetime?
So do I really have to learn Objective-C ?
I would prefer a dynamic language.
Objective-C is a dynamic language, as far as the Objective-C parts go. Here's a little summary article: http://www.macdevcenter.com/pub/a/mac/2003/04/28/objective-c.html
The syntax is scary at first, but it grows on you. I suggest biting the bullet and slogging through it.
If you want to work at a "real job" doing Mac programming with other people, you're going to need to know Objective-C (in my opinion, anyway).
I think the short answer is yes, you need to learn Objective-C.
The Python and Ruby "bridges" work, but it's not what Apple is pushing or using itself. A few years ago there was a Java bridge to Cocoa but that's now deprecated. Who knows what will happen to the non-ObjC languages?
In any case, Objective C is pretty dynamic. Not in the way that Ruby/Python are perhaps, but it's certainly not like C++.
Short answer: YES :)
Our first app was built in Python, using the PyObjC bridge. From experience I can tell you that to build an application with a bridge you need to learn:
The idiosyncrasies of the bridge
To read and write code in the bridge language (Python in my case)
To read code in Objective-C (All useful sample code is in Obj-C)
To write pseudo-code in Objective-C (if you ever want to ask questions on a mailing list or likewise)
Cocoa
Of all those things to learn, Cocoa is the biggy. It's where the really interesting stuff comes in and the thing you really need to wrap your brain around. After working on this PyObjC project, it's become pretty easy for me to code in Obj-C, even though I had no prior experience coding in C.
So my advice is: Focus on learning Cocoa, and use the language that's most suited as a tool to do that (Obj-C). If you ever find a particular reason to use a bridge, such as having a need for an ORM that can deal with networked SQL, etc. you can apply around 90% of what you learned writing your first Obj-C/Cocoa app(s) in the bridged project.
Finally: I don't really understand the resistance many people who're new to the platform have to learning Objective-C. Isn't it exciting and gratifying to learn new stuff and build the best possible things armed with this new knowledge?
You definitely need to learn Objective-C even if you choose to use one of the bridges. Apple has already shown by their treatment of Java that they're not really interested in providing huge amounts of support or backwards compatibility to the use of Cocoa through anything but Objective-C.
So use one of the bridges, if you like, but have a firm grasp of the Objective-C runtime and the bridges so that you can manage them yourself, if need be.
Do I really have to learn Objective-C to develop solid Mac Apps?
Currently, yes.
As Mac users tend to use only applications that have a nice (native) GUI, i don't think that Mono and GTK+ or any Java GUI (Swing) will fit their needs.
Correct.
There are projects like Cocoa#, PyObjC and RubyCocoa, but are they ready for primetime?
Cocoa#: I don't know, as I don't use C#.
PyObjC: Sort of, but Cocoa in Python is a bit of a hack, since Python isn't Smalltalky enough.
RubyCocoa: Maybe. I'm waiting for MacRuby to mature, though. See also:
Jens Alfke on MacRuby
Jesper on MacRuby
There are a small number of successful Cocoa apps written in bridged languages, so you don't necessarily need to use it that much, but you do need to learn it. People who try to learn to write Mac OS programs in bridged languages do themselves a huge disservice. The bridged languages are great tools, but they are the sort of things that allow someone with a knowledge of the bridged language and Objective C to become extra productive, not skip learning Objective C.
In order to use something like PyObjC or MacRuby effectively you need to really have a good understanding of how the native runtime works to deal with all the impedance mismatches that can occur between the bridged language and the Objective C runtime.
Short answer is yes, longer answer is "you can use Objective-C++." Either way you're going to have to learn at least some of Objective-C. Once you start digging into Cocoa (the framework for building Mac OS X apps), the Xcode tools, and the Apple Human Interface Design guidelines, you'll realize that Objective-C is the way to go.
Not only you have to know Objective-C (the easy part), you must be very comfortable with plain old C. That's in my opinion the biggest challenge for most people.
If you already know C, Objective-C is pretty easy to learn.
Ruby and Python are both viable for "real" Mac apps. ADC has a few articles on the topic. MacRuby looks like it will be replacing RubyCocoa.
I would still recommend learning Objective-C though. Most of the example code you find will be in Objective-C and the books tend to be Objective-C (though the Pragmatic Programmers have a RubyCocoa book in the works. Most Cocoa apps are written in Objective-C.
And Objective-C is dynamic. Take a closer look at it, it isn't nearly as intimidating as people think. It's Cocoa that tends to have the steeper learning (or unlearning) curve.
No you don't have to learn cocoa however it is worth looking at because it is an incredibly powerful api and very well documented, if you already know C then its very easy (honestly it is - i know it looks daunting syntactically).
The problem with the bridged approach on OS X is it seems to be very immature and only really designed for people who are prepared to read the documentation associated with the main cocoa api.
In all honesty if you know c you will pick up the basics of obj-c with a book, the one by Arron Hilligas (spelling?!?!) is superb.
If you try hard enough, you can go about producing software without using Objective-C that has the potential to be great except for the fact that at the end of the day it won't be very good. You will spend more time trying to harangue a language into doing something that it isn't the absolute best at. At WWDC I wore a shirt that said "Learn Objective-C or Retire" which didn't go over too well with some people who still held dearly onto the last threads of Pascal's life, but the point is altogether true - Objective C is where it's at on the Mac and to pretend otherwise is to do yourself a disservice.
Having said that, you should definitely not rule out the bridges on the platform for extending your application - Bill Bumgarner is quick to point out how much power the Twisted networking framework provides to Cocoa applications via the PyObjC bridge.
Not programming in a scripting language turns out to not be so bad when you're using XCode. The GDB integration is very good; I'm primarily a Perl guy, and I find the XCode debugger very nice and very easy to use.
The "fix" feature will really surprise you with how usable it is. Imagine finding a bug in your ObjC code, fixing it, and then telling the debugger to continue on. It actually works in a lot of cases.
Try ObjC. You may find you like it a lot better than you think you will.
"have to", well... technically, no.
Since most Mac app jobs are done thro ObjC (for a very good reason I might add), I wouldn't kid yourself and learn it.
Hell no. You can use a number of languages to make a nice GUI with. It just depends on what's the usual/easiest solution for the platform. In Mac OS X's case, Objective-C and AppKit are pretty easy to use choices. However, I use REALBasic sometimes, and that allows cross platform development (and, of course, a performance hit).
So really it depends on how much work you want to put into it. You should learn Objective-C if you want to really do serious Mac development. But you can get by without it....
No. While Apple is strongly pushing Cocoa, Carbon is still supported. It uses plain C instead. As for good-looking GUIs, just use Interface Builder.
However, I must say that Objective-C is a great language. It is really easy (it was my first language) and very powerful.
In general yes; but even if you (correctly IMHO) ruled out Mono, GTK and SWING because they don't fit well in the GUI, try Qt. it's REALLY respectful of Mac GUI standards (HIG: Human Interface Guidelines), and can be equally programmed on C++, Python and Java. the last version is cocoa-based and 64-bit capable.
the only thing missing from Qt that you'd get from Objective-C is those awful non-HIG-compliant modern Apple applications (yeah, Aperture and Final Cut, I'm looking at you!)