Welcome, Guest. Please login or register.

Author Topic: OT fork(): bloodline and Karlos erm... discuss Objective-C & C++ :)  (Read 3714 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: DiscreetFX Platform Shift
« Reply #14 from previous page: November 05, 2010, 02:47:48 PM »
Quote from: bloodline;589583
Yeah, I still have to explain that one to people... My degree was CHEMISTRY not pharmacy... :)

For God's sake, Jim, I'm a chemist, not a forklift!

Quote
@karlos your diatribe shakes my confidence in Obj-C, but I honestly couldn't really imagine doing another large high level project in anything but Obj-C... Then again I couldn't even begin to imagine how bloated and inefficient doing Microcontroller work would be in anything but C++... As my (disgustingly successful developer friend once said), you just pick the right tool for the right job!

Hmmm, as once last shout for Obj-C... I think in numbing I see is as BOOPSI done right... :)

Don't let me put you off. Programming language preferences are personal things. There's plenty to dislike in any language if you prefer a different one. I like C++ because it basically gives me the tools to write code from very simple procedural C-style stuff right up to full blown OO/generics with meta-programming and all that jazz. Consequently, it pretty much always feels like the right tool for the job for me. Even the simplest stuff you'd normally do in vanilla C I still tend compile in strict C++ mode.

Quote
The problem I have is Karlos's objections are well founded, but I feel he is coming at Obj-C from the wrong angle

If it helps, I disliked it long before apple got their mits on it :D
« Last Edit: November 05, 2010, 02:51:08 PM by Karlos »
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: DiscreetFX Platform Shift
« Reply #15 on: November 05, 2010, 02:56:39 PM »
Man, we've gotten so far off-topic. I'm actually considering moving half of this to a developer discussion thread :D
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: DiscreetFX Platform Shift
« Reply #16 on: November 05, 2010, 03:04:13 PM »
Done. Have to say, vbulletin has some nice features for this sort of thing :)
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: DiscreetFX Platform Shift
« Reply #17 on: November 05, 2010, 03:17:39 PM »
Quote
Hmmm, as once last shout for Obj-C... I think in numbing I see is as BOOPSI done right...


Actually, BOOPSI is a bug bear of mine too. Love the concept, dislike the implementation.

I don't think the potential for this has been explored but when OS4 introduced it's "Interface" concept for libraries, it occurred to me that the mechanism could be used to produce a GUI engine somewhat more efficient than BOOPSI.

To quickly recap, an Interface is simply a C structure with instance data and a set of function pointers that, through a custom __attribute__ get a pointer to the instance passed as the first parameter (Self, in a small nod to smalltalk perhaps?) and thus behaves as a method that can act on that instance.

So far, AFAIK, it has been used solely for making shared libraries, but fundamentally, the interface is a first class object which can be cloned and modified. I've often wondered whether or not a suitably designed Interface could be used as a runtime extensible GUI element.

If so, an Interface call is rather more efficient than a BOOPSI method dispach and has a syntax (InterfaceInstance->Method())  that's a bit nicer for OO developers too.
int p; // A
 

Offline Franko

  • Hero Member
  • *****
  • Join Date: Jun 2010
  • Posts: 5707
    • Show only replies by Franko
Re: OT fork(): bloodline and Karlos erm... discuss Objective-C & C++ :)
« Reply #18 on: November 05, 2010, 05:56:49 PM »
@ Karlos

Ahh... the perks of being a mod... you get to fork something... :lol:
 

Offline nicholasTopic starter

Re: OT fork(): bloodline and Karlos erm... discuss Objective-C & C++ :)
« Reply #19 on: November 05, 2010, 06:48:44 PM »
Let's heat it up a little!

@Karlos

Please tell us your thoughts on Objective-C++ ;)
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: OT fork(): bloodline and Karlos erm... discuss Objective-C & C++ :)
« Reply #20 on: November 05, 2010, 07:32:51 PM »
Quote from: nicholas;589675
Let's heat it up a little!

@Karlos

Please tell us your thoughts on Objective-C++ ;)


Not even Objective-C fans like Objective-C++. I suppose it has advantages of both but there's no actual overlap in the OO services from Objective-C and those provided by C++.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: OT fork(): bloodline and Karlos erm... discuss Objective-C & C++ :)
« Reply #21 on: November 05, 2010, 07:36:54 PM »
Quote from: Franko;589657
@ Karlos

Ahh... the perks of being a mod... you get to fork something... :lol:


I wouldn't normally bother, but it was an announcement thread and very off-topic ;)
int p; // A
 

Offline KThunder

  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 1509
    • Show only replies by KThunder
Re: OT fork(): bloodline and Karlos erm... discuss Objective-C & C++ :)
« Reply #22 on: November 05, 2010, 07:42:12 PM »
I used to program in compiled Basic and assembly and didn't like C or C++, now I have a C++ programming class in college, and I'm learning a lot. C++ is pretty cool.
Oh yeah?!?
Well your stupid bit is set,
and its read only!
(my best geek putdown)
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: OT fork(): bloodline and Karlos erm... discuss Objective-C & C++ :)
« Reply #23 on: November 05, 2010, 07:50:13 PM »
Quote from: KThunder;589687
C++ is pretty cool.


It's one of those languages I find you learn in layers, each one revealed by some new problem you come up against.

First of all, you start of writing what is ostensibly C and perhaps the only features you use are the streams for input and output (though personally I prefer C-style IO and almost always use it in preference). Then you create your first simple classes, and eventually they get more complex as you start introducing inheritance. You start to discover design patterns and how to implement them. You get better at sorting concepts into concrete and abstract classes and so on.

At some point, you invariably come up with generalized ideas for code that works with objects of different types and you suddenly realise what C++ templates can do for you and then what the STL has already done for you. Your code gets bigger and you realise what namespaces are for.

And, just like the STL, after some time, you start looking at 3rd party libraries like boost and realising that some very clever people have done some excellent work so that you don't have to. Although personally, I quite like doing the implementation work, I find it relaxing ;)
int p; // A
 

Offline KThunder

  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 1509
    • Show only replies by KThunder
Re: OT fork(): bloodline and Karlos erm... discuss Objective-C & C++ :)
« Reply #24 on: November 05, 2010, 08:00:36 PM »
I've had to step back to beginnings for everything. Basic I/O, no loops or subroutines, or anything like that.
We are taking it a step at a time with the class, it has been interesting. My Professor is a wild one too, she is a 5'2" lady with a pretty wacky sense of humor.
Oh yeah?!?
Well your stupid bit is set,
and its read only!
(my best geek putdown)
 

Offline nicholasTopic starter

Re: OT fork(): bloodline and Karlos erm... discuss Objective-C & C++ :)
« Reply #25 on: November 05, 2010, 09:25:48 PM »
Quote from: KThunder;589691
I've had to step back to beginnings for everything. Basic I/O, no loops or subroutines, or anything like that.
We are taking it a step at a time with the class, it has been interesting. My Professor is a wild one too, she is a 5'2" lady with a pretty wacky sense of humor.

As a college teacher myself, I can thoroughly recommend getting your hands on a copy of Accelerated C++: Practical Programming by Example

Quote
Why is Accelerated C++ so effective? Because it

Starts with the most useful concepts rather than the most primitive ones:
You can begin writing programs immediately.
Describes real problems and solutions, not just language features:
You see not only what each feature is, but also how to use it.
Covers the language and standard library together:
You can use the library right from the start.

The authors proved this approach in their professional-education course at Stanford University, where students learned how to write substantial programs on their first day in the classroom.

More details here: http://www.acceleratedcpp.com/
« Last Edit: November 05, 2010, 09:28:05 PM by nicholas »
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline nicholasTopic starter

Re: OT fork(): bloodline and Karlos erm... discuss Objective-C & C++ :)
« Reply #26 on: November 05, 2010, 09:29:24 PM »
Quote from: Karlos;589684
Not even Objective-C fans like Objective-C++. I suppose it has advantages of both but there's no actual overlap in the OO services from Objective-C and those provided by C++.


Drat!

Maybe I should have asked for your thoughts on Java. :lol:
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: OT fork(): bloodline and Karlos erm... discuss Objective-C & C++ :)
« Reply #27 on: November 05, 2010, 09:45:22 PM »
Quote from: nicholas;589713
Drat!

Maybe I should have asked for your thoughts on Java. :lol:

Java was and is a nice idea. It's somewhat failed to live up to it's potential however.

I do remember a fun discussion with some Java purists that really hated C++ due to the misuse some of it's features can be put to and that such things had no place in a "clean" language. At one point, they went on and on about why operator overloading was the work of satan and no language should ever have it. My pointing out that Java's StringBuffer overrides operator+() for concatenation didn't seem to go down well. Special case this, exception the other. Enforce a rule or don't.

Amusingly, one of their other objections (at the time) was that C++ template syntax was so evil that generics might as well not be a language feature since nobody would ever use it (despite the fact that STL is built from it). I had to smile when Java finally introduced generics. The syntax is practically identical. As it was in C# too ;)

Other aspects of Java I don't like are the lack of support for efficient concrete types (all non-static class functions behave like C++ virtual functions), though in some respects this is less of an issue for a language that is JIT compiled from bytecode, since the extra indirection can often be eliminated at JIT time. I'm also not a big fan of garbage collection but it certainly has it's place in larger systems. I also miss features like multiple inheritance, operator overloading and friend relationships between classes, but SringBuffer+ caveat aside, the features they chose have been largely well-implemented. Syntactically I can't say I have any major objection to Java.
« Last Edit: November 05, 2010, 09:47:28 PM by Karlos »
int p; // A