You are not logged in.

#1 2009-04-14 13:51:12

MrAllan
Member
Registered: 2008-12-08
Posts: 132

Objective-C?

Hello all,

I've been learning Java for a while now, but it seems very bloated and not at all lightweight, so I want to learn something else.
People have written good things about Objective-C in this forum, but I wonder about compability with Linux. It seems that without Cocoa, Objective-C is pretty useless?
Or should I just go with pure C (though I'm not sure about leaving all those nice OOP-principles behind)?

Offline

#2 2009-04-14 14:36:04

dalingrin
Member
Registered: 2009-03-18
Posts: 128

Re: Objective-C?

Objective-C is not without its bloat either. Though not nearly as bad as Java.

Objective-C is pretty much useless on linux. I suppose no language is useless as long as you don't mind writing your own libraries.

I'm sure no one else will agree with me but if you want something fast like C and you enjoy OOP principles then give C++ a try. It is a great language beyond what folks say. The library compatibility alone is reason enough to try it. I don't find it to be that overly complex compared to C. I find C++/Qt programs to be particularly easy to follow.

Offline

#3 2009-04-14 14:46:31

MrAllan
Member
Registered: 2008-12-08
Posts: 132

Re: Objective-C?

dalingrin wrote:

I suppose no language is useless as long as you don't mind writing your own libraries.

Well, I don't see myself rewriting Cocoa for Linux lol. And from what I read in the two C vs. C++ threads, C++ seems to be really bloated (and therefore not better than Java).

Offline

#4 2009-04-14 14:49:17

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Objective-C?

MrAllan wrote:
dalingrin wrote:

I suppose no language is useless as long as you don't mind writing your own libraries.

Well, I don't see myself rewriting Cocoa for Linux lol. And from what I read in the two C vs. C++ threads, C++ seems to be really bloated (and therefore not better than Java).

lol are you comparing c++ to java in bloatness ?


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#5 2009-04-14 14:54:31

dalingrin
Member
Registered: 2009-03-18
Posts: 128

Re: Objective-C?

MrAllan wrote:
dalingrin wrote:

I suppose no language is useless as long as you don't mind writing your own libraries.

Well, I don't see myself rewriting Cocoa for Linux lol. And from what I read in the two C vs. C++ threads, C++ seems to be really bloated (and therefore not better than Java).

Define bloat.

If by bloat you mean, slow because of extra features/addons, then I disagree. C++ is certainly not slow.
If by bloat you mean, too many features/addons, then I partially agree. However, you don't have to use every single feature of C++ in every source file of every program. C++ gives you choice.

Is C++ simple and clean like Python? No of course not. C++ gives you the speed of C(very close to) plus the ability to choose the programming paradigm you want. Have a small program to write? Use C++ to write a structured program(very much like you would with C). Have some some code you'd like to easily reuse? Use C++ for generic programming. Have a large project? Use C++ for OOP.

Don't get me wrong C++ is not perfect but, there is a reason why it is so widely used.

Last edited by dalingrin (2009-04-14 15:07:42)

Offline

#6 2009-04-14 15:06:25

quetzyg
Member
From: /home/quetzyg
Registered: 2006-08-03
Posts: 129

Re: Objective-C?

MrAllan wrote:

(...)Or should I just go with pure C (though I'm not sure about leaving all those nice OOP-principles behind)?

Have you tried using C implementing ADT's?


ZzZz...

Offline

#7 2009-04-14 15:10:49

MrAllan
Member
Registered: 2008-12-08
Posts: 132

Re: Objective-C?

moljac024 wrote:

lol are you comparing c++ to java in bloatness ?

Yes.

dalingrin wrote:

Define bloat.

If by bloat you mean, slow because of extra features/addons, then I disagree. C++ is certainly not slow.
If by bloat you mean, too many features/addons, then I partially agree. However, you don't have to use every single feature of C++ in every source file of every program. C++ gives you choice.

Is C++ simple and clean like Python? No of course not. C++ give you the speed of C(very close to) plus the ability to choose the programming paradigm you want. Have a small program to write? Use C++ to write a structured program(very much like you would with C). Have some some code you'd like to easily reuse? Use C++ for generic programming. Have a large project? Use C++ for OOP.

Yeah, but reading those C vs C++ threads makes me feel there's something seriously wrong about C++.
And if I had to write my own libraries to use Objective-C on Linux, it seems like C is way to go.

Offline

#8 2009-04-14 15:25:55

dalingrin
Member
Registered: 2009-03-18
Posts: 128

Re: Objective-C?

MrAllan wrote:
moljac024 wrote:

lol are you comparing c++ to java in bloatness ?

Yes.

dalingrin wrote:

Define bloat.

If by bloat you mean, slow because of extra features/addons, then I disagree. C++ is certainly not slow.
If by bloat you mean, too many features/addons, then I partially agree. However, you don't have to use every single feature of C++ in every source file of every program. C++ gives you choice.

Is C++ simple and clean like Python? No of course not. C++ give you the speed of C(very close to) plus the ability to choose the programming paradigm you want. Have a small program to write? Use C++ to write a structured program(very much like you would with C). Have some some code you'd like to easily reuse? Use C++ for generic programming. Have a large project? Use C++ for OOP.

Yeah, but reading those C vs C++ threads makes me feel there's something seriously wrong about C++.
And if I had to write my own libraries to use Objective-C on Linux, it seems like C is way to go.

There is a subset of users who feel that C++ is the plague. Keep in mind this is just a subset of users. It comes down to personal choice. I don't prefer to use C++ because I'm a masochist.
You, as someone who is coming from java, are probably going to get about halfway into C then decide it isn't worth the trouble.
There are so many things that you probably take for granted in Java that will be lacking in C.  I think C++ is a much better compromise. I say this from the experience of starting out in Python and trying C then going with C++.

These two questions sum up how I feel about C vs C++:
What can you do in C that you can't do in C++? What can you do in C++ that you can't do(easily) in C?

This is all predicated on developing things other than kernel or drivers. Otherwise you do need to break our your C and Assembly language books.

You really need to define what you mean by bloat.

Last edited by dalingrin (2009-04-14 15:33:07)

Offline

#9 2009-04-14 15:29:33

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: Objective-C?

There's nothing seriously wrong with C++. Learn it and you won't be sorry.


Matt

"It is very difficult to educate the educated."

Offline

#10 2009-04-14 15:34:21

MrAllan
Member
Registered: 2008-12-08
Posts: 132

Re: Objective-C?

dalingrin wrote:

You really need to define what you mean by bloat.

It's not exactly bloat, but: Java is slow, you have to have the JVM installed, "write once, run everywhere" really comes down to "run anywhere, it sucks everywhere" (i.e. Swing), mediocre support from Sun, ....

Edit:

mrunion wrote:

There's nothing seriously wrong with C++. Learn it and you won't be sorry.

OK, so Objective-C isn't cool on Linux, so I'm probably going with C/C++.

Last edited by MrAllan (2009-04-14 15:38:25)

Offline

#11 2009-04-14 15:40:39

dalingrin
Member
Registered: 2009-03-18
Posts: 128

Re: Objective-C?

MrAllan wrote:
dalingrin wrote:

You really need to define what you mean by bloat.

It's not exactly bloat, but: Java is slow, you have to have the JVM installed, "write once, run everywhere" really comes down to "run anywhere, it sucks everywhere" (i.e. Swing), mediocre support from Sun, ....

Trust me C++ is not bloated in the sense of speed.
Its one of the most widely used programming languages in performance critical applications.

I'll take C++/Qt for "write once, run everywhere" way before Java.

You are letting the GTK+ people get to you.

Last edited by dalingrin (2009-04-14 15:41:33)

Offline

#12 2009-04-14 15:47:20

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: Objective-C?

Imo, C++ is be best choice. It is fast, widely supported and there is plenty of libraries. Just you do not have to be shy and seek a little in the Internet.

The only reasons I can see for using C instead of C++ are:
- lack of good compilers, in the embedded systems world for example
- the will to learn, C++ gives you many powerful features C does not. Being forced to reimplement everything gives lots of knowledge about how technologies works and how much they cost: just imagine how in C you would implement classes and hierarchy of classes with virtual functions; managing all those tables of function pointers is instructing.

Offline

#13 2009-04-14 19:03:02

ghostHack
Member
From: Bristol UK
Registered: 2008-02-29
Posts: 261

Re: Objective-C?

MrAllan wrote:

Hello all,

I've been learning Java for a while now, but it seems very bloated and not at all lightweight, so I want to learn something else.
People have written good things about Objective-C in this forum, but I wonder about compability with Linux. It seems that without Cocoa, Objective-C is pretty useless?
Or should I just go with pure C (though I'm not sure about leaving all those nice OOP-principles behind)?

If you are interested in Objective-C you might want to look at the GNUStep project (http://www.gnu.org/software/gnustep/) they implement the OPENStep specification and most of the cocoa extensions.  The main downside to using objective-c on linux that I can see seems to be the lack of visual integration with gtk/Qt desktops if you are writing a GUI application.

Offline

#14 2009-04-14 21:08:38

dalingrin
Member
Registered: 2009-03-18
Posts: 128

Re: Objective-C?

Objective-C is a nice language and I would love to see gnustep get some more development. It would be great if they could implement some kind of a native widget scheme on various platforms.

Offline

#15 2009-04-14 21:13:08

MrAllan
Member
Registered: 2008-12-08
Posts: 132

Re: Objective-C?

Well, say I learn Objective-C, I guess I will learn some C (and maybe even C++) on the way, right?

Last edited by MrAllan (2009-04-14 21:26:27)

Offline

#16 2009-04-14 22:30:44

dalingrin
Member
Registered: 2009-03-18
Posts: 128

Re: Objective-C?

MrAllan wrote:

Well, say I learn Objective-C, I guess I will learn some C (and maybe even C++) on the way, right?

You will learn the syntax that they all have in common, yes. 


Out of curiosity, what type of things do you plan to program? Did you learn Java in school?

Offline

#17 2009-04-14 23:38:41

Zariel
Member
Registered: 2008-10-07
Posts: 446

Re: Objective-C?

Why not try D?

Offline

#18 2009-04-14 23:54:05

jumzi
Member
Registered: 2009-02-20
Posts: 69

Re: Objective-C?

I hate c++ ./flame ./flame ./flame ./flame

Offline

#19 2009-04-15 00:50:06

orph
Member
From: Montréal, Canada
Registered: 2009-03-01
Posts: 25
Website

Re: Objective-C?

MrAllan wrote:

Well, say I learn Objective-C, I guess I will learn some C (and maybe even C++) on the way, right?

Let's say you sit down and learn Objective-C, you will learn many new and interesting things. Even if you ditch it after some time because you think it's grotesque, you will at least have learned something new.. And that can't be bad, isn't it? I mean, it's fun to talk about programming languages, looking for the "best one" and whatever, but as your doing that, you're not learning any new languages.
About your question: I never wrote Objective-C code, but it doesn't seem so far from C. What you say about trying it and give us your feedback?

Anyway, best of luck for your projects!


I KISS you.

Offline

#20 2009-04-15 06:44:28

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: Objective-C?

dalingrin wrote:

There is a subset of users who feel that C++ is the plague. Keep in mind this is just a subset of users.

Well, if it's just a subset then they must not know what they're talking about. hmm

This wouldn't be the first time something terrible was popular. See: most popular things.

Offline

#21 2009-04-15 08:01:12

MrAllan
Member
Registered: 2008-12-08
Posts: 132

Re: Objective-C?

orph wrote:

I mean, it's fun to talk about programming languages, looking for the "best one" and whatever, but as your doing that, you're not learning any new languages.

True that lol

dalingrin wrote:

Out of curiosity, what type of things do you plan to program? Did you learn Java in school?

Yeah, I (still) learn Java in school. And I have no idea what to program, because for everything usefull there's a program already, so I'm basically just coding pointless stuff to learn the language.

GNUStep seems nice, but the fact that it doesn't blend with GTK/QT is a real drawback. No GUIs for Linux, then.

Last edited by MrAllan (2009-04-15 08:01:36)

Offline

#22 2009-04-15 10:52:35

krigun
Member
From: Norway
Registered: 2005-06-06
Posts: 122
Website

Re: Objective-C?

Zariel wrote:

Why not try D?

I would wait with recommending D to anybody until the issue with the conflicting standard libraries has been resolved (if it ever will). It's just ridiculously confusing for anybody who wishes to learn the language and the fact that v2.0 of D is still a somewhat moving target does not make things easier. But I agree that for ex Java developers, D would be a smooth transition to.. lower level languages.

Offline

#23 2009-04-15 11:06:34

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Objective-C?

krigun wrote:
Zariel wrote:

Why not try D?

I would wait with recommending D to anybody until the issue with the conflicting standard libraries has been resolved (if it ever will). It's just ridiculously confusing for anybody who wishes to learn the language and the fact that v2.0 of D is still a somewhat moving target does not make things easier. But I agree that for ex Java developers, D would be a smooth transition to.. lower level languages.

Is D ever going to kick off ?


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#24 2009-04-15 11:42:20

krigun
Member
From: Norway
Registered: 2005-06-06
Posts: 122
Website

Re: Objective-C?

moljac024 wrote:

Is D ever going to kick off ?

I personally believe that languages like Vala might "make it" before D does. The problem I have with D, is that the C++'s ABI is not fully supported. That's why I think it will never make it. If you make a language for oldtime C++ developers, you better be backwards compatible. Just look at Scala (for oldtime Java developers).

Oh, and did I mention the two conflicting "standard" libraries? I guess that's the good thing about standards; so you can choose which one to use. hmm

Last edited by krigun (2009-04-15 11:51:24)

Offline

Board footer

Powered by FluxBB