Language:
switch to room list switch to menu My folders
Go to page: First ... 25 26 27 28 [29] 30 31 32 33 ... Last
[#] Sat Apr 25 2009 19:17:03 EDT from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

And how serious is JavaScript?

Don't laugh, javascript is the new basic.
It's a simple, type stupid beginner language that runs on your machine in a little interpreter.
But instead of print statements on a left to right top to bottom terminal, it outputs html.

[#] Sat Apr 25 2009 21:40:49 EDT from IGnatius T Foobar @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

I happen to think JavaScript is a wonderful language. It's the busted data model in most browsers that makes people go insane when they write JS code.

[#] Sat Apr 25 2009 23:01:55 EDT from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

So today I'm learning objective C from here: http://cocoadevcentral.com/d/learn_objectivec/

So I have a few question. Is EVERYTHINg in objective C an object?
what's the difference between release and dealloc? dealloc frees an object, but release frees a member variable, isn't that also an object?

[#] Sat Apr 25 2009 23:04:49 EDT from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

oh, dealloc is the name of the destructor. So something automatically calls dealloc for you, and you have to release your member objects, yes?

[#] Sat Apr 25 2009 23:20:35 EDT from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

okay, so I went through the entire tutorial.
So what's the difference between alloc and retain.
I get it that alloc allocates, but why then is it not automatically 'retained' if it's reference count has been incremented.
if I alloc something, then I say self.member = something;
I've effectivly retained it, no? I should just [something release]; to counteract the alloc, but the setter would have incremented the reference count so the object would still exist yes?
I guess the setter's [input retain] does that?
I think I get it, but it doesn't seem very orderly to me. or uniform.
I imagine this is what it feels like to somebody learning C++.
It's weird, I haven't not known what I was looking at in a long long time.

[#] Sun Apr 26 2009 04:08:37 EDT from dothebart @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

 

Sa Apr 25 2009 17:33:45 EDT von fleeb <>

And how serious is JavaScript?

did you know that there is even a servlet language arround that speaks JS? I think it uses the mozilla or konqueror emcascript interpreter...



[#] Sun Apr 26 2009 07:11:08 EDT from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

 

Sun Apr 26 2009 04:08:37 EDT from dothebart <>

 

Sa Apr 25 2009 17:33:45 EDT von fleeb <>

And how serious is JavaScript?

did you know that there is even a servlet language arround that speaks JS? I think it uses the mozilla or konqueror emcascript interpreter...

I did know this, actually.

I was kind of joking when I asked that question, but I think the language has definately come into its own.  I wouldn't use it for heavy lifting, but it's great for web-related stuff.  It has a bizarre kind of elegance and simplicity to it that I like... it doesn't try to be anything more than exactly what it is.



[#] Sun Apr 26 2009 21:57:39 EDT from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


Well, Peter Pulse is the guy to ask about any and all things Objective, including Objective-C. That said, clearly not everything is an object, because Objc is a superset of C.

[#] Sun Apr 26 2009 22:33:43 EDT from IGnatius T Foobar @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Does ObjC compile down to C and then get fed into an ordinary C compiler, the way the original C++ compilers did?



[#] Mon Apr 27 2009 08:56:19 EDT from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

I don't think so, it's not a joke language, like it first seems like, but I haven't checked out enough to make sure.
Without having looked it up yet, I gather before or around the time of stroustrup, somebody else had the idea to add objects to C and this is what they came up with.
I think C++ was a little better thought out though, syntax wise. C++ is more C like than objcetive C seems to be, but the jury's still out.

[#] Mon Apr 27 2009 14:17:24 EDT from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


No, ObjC has the same type of frontend as any other GCC language. It's a first class frontend, not a bolt-on.

[#] Mon Apr 27 2009 14:18:18 EDT from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

I think C++ was a little better thought out though, syntax wise. C++

is more C like than objcetive C seems to be, but the jury's still out.


According to those "in the know" (Pulse) it's actually better that ObjC is less C-like.

[#] Mon Apr 27 2009 14:20:36 EDT from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


Personally, I never use Java serialization, except when some package I'm using (RMI or session persistence) uses it for me.

[#] Tue Apr 28 2009 09:37:38 EDT from Peter Pulse @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Well, it's been 15 years since I did real objective c coding.. but alloc actually allocates the object, that's the factory method, init is the standard constructor.
As far as dealloc, that's like.. well I will have to look that up because I also remember there being a 'free' and I forget the difference. As far as retain and release, those increment and decrement the reference counter, and if I remember correctly it will call the destructor (dealloc/free/whatev) when ref count goes to zero. The object is created with ref count 1. There is no magic with retain and release they are just instance methods of Object, they don't get automatically done for you, it is your problem to use those methods if you want. I don't actually remember using those methods much if at all in my NeXT programming, I think maybe they were a lateraddition to the language after ns was written or while it was being written. The class reference docs for ns very clearly indicated, whenever an object was returned from something, who would be responsible for freeing that object. Dealing with deallocation when you needed to bail out of a complex method was (maybe still is) as painful as c is when you've allocated a lot of stuff in a function. But we had tricks. One trick was to push your local objects onto a list when you alloc them. Then you can free them all along with the list in one line of code. Another clever thing to do was, for objects you needed to return in a gui app.. if you know that object is only important for the duration of the gui event, you push all that stuff on a list of stuff you want to keep around for the duration of the event. Now you can return that object and it can be used, and not freed by anyone.. because you register a delegate (csllback) that clears out that list and frees everything on it upon return of the event handler. I am sure things have changed a bit since I did it
.. for example the idea of memory allocation zones was a new thing when I was doing all this. So perhaps people don't use any of these tricks anymore.
Anyway Ford I will be in Brewster in a few minutes so we can talk there.
Treo typing isn't too bad but it isn't too good either...

[#] Tue Apr 28 2009 09:53:32 EDT from Peter Pulse @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

As far as o-c syntax being un-c-like.. vs c++, well o-c did start out as a precompiler/preprocessor, so having a distinct syntax may have been done to make the parser easier. In C++, objects ARE c structures, so C syntax works on them, whereas in o-c, objects belong to the runtime and you don't know what they are. In C++M methods are functions with a little sugar sprinkled, and again you know that.. they have pointers and get passed parameters the c way. In o-c, you don't know the implementation and you will never have a pointer to a method, you do that through the runtime, which is to say, you use the method call syntax of o-c to do these things, and o-c also gives you a way to do what you used to do with function pointers. So that all the object stuff still works. Explaining this, it seems super complex, but it is actually a lot simpler than C++. When you look at the code it is very clear what is going on.

[#] Tue Apr 28 2009 22:50:49 EDT from IGnatius T Foobar @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Sounds like garbage collection "done right."

[#] Wed Apr 29 2009 07:53:09 EDT from dothebart @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

just found

http://code.google.com/p/google-perftools/

seems to be a real good tool to get more performance in multithreadded applications just by linking another malloc implementation.



[#] Wed Apr 29 2009 07:53:11 EDT from dothebart @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]



[#] Wed Apr 29 2009 13:09:05 EDT from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


except that it isn't actually garbage collection.

[#] Wed Apr 29 2009 15:40:19 EDT from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Sounds like garbage collection "done right."

I think I still like C++ desctructors better. I never really thought garbage collection was a great idea.
Sorry I missed time to chat yesterday, I dunno if you follow the threads but we had one of our random network-kill-everything problems again yesterday. That's why I was running around so much.

Go to page: First ... 25 26 27 28 [29] 30 31 32 33 ... Last