• What are you working on? November 2011 Edition
    3,673 replies, posted
Why would I write in obj-c instead of c++?
[QUOTE=Robber;33283859]Awesome. Add multithreading support and adjustable cloth resolutions! I'd buy it (if it's not free).[/QUOTE] sure thing it's gonna be free, i wanna experiment with ads [editline]15th November 2011[/editline] today i'm gonna add tearing and accelerometer support to mess with the gravity
[QUOTE=DrLuke2;33287460]Wait, that's possible? I didn't know... How would I do that? loadstring("create_box(10,10)") ?[/QUOTE] Is this purely in Lua or something?
[QUOTE=i300;33288246]I love Objective-C. I love C# and C++ as well. I love the way it looks, works, and reads. Keywords are changed, but you can use raw C or C++ code mixed in with it. I feel like the only damn person on FP who actually likes Obj-C.[/QUOTE]I like Obj-C too, I use it all the time.
[QUOTE=likesoursugar;33288412]Why would I write in obj-c instead of c++?[/QUOTE] ...If you like the syntax?
[QUOTE=ief014;33287506]I would prefer java [i]much[/i] more than obj-c. Java isn't even a bad language, it's just a bit old[/QUOTE] If you don't mind having OOP shoved in uncomfortable places. And the complete lack of ability to work with any sort of binary data. Passing vertex info to OpenGL is a chore, loading BSP maps is a chore. Everything that would take me about two minutes in regular C is near impossible in Java. Even [i]PYTHON[/i] has better support for packed binary data. Fuck Java and fuck whoever was involved in its design.
Quick little demo of our group game for a presentation on Friday, Input is abit hard with a mouse as your meant to use your finger. [media]http://www.youtube.com/watch?v=-joerr1IRgw[/media] Edit: None of the graphics are final, especially the dildo looking ship!
[QUOTE=ROBO_DONUT;33288797]If you don't mind having OOP shoved in uncomfortable places. And the complete lack of ability to work with any sort of binary data. Passing vertex info to OpenGL is a chore, loading BSP maps is a chore. Everything that would take me about two minutes in regular C is near impossible in Java. Even [i]PYTHON[/i] has better support for packed binary data. Fuck Java and fuck whoever was involved in its design.[/QUOTE] In my view, a language is merely a tool. True, some tools are just better than others, but it sounds like your using the wrong tool or using the tool in the wrong way, not that the tool itself is bad. I've used java on numerous occasions and I've never felt that is completely awful, sometimes I've even thought it was clever or useful for some task.
I figured out Lagrange forms for interpolation polynomials today. Then I proceeded to integrate one without any prior knowledge in integration, with just MAOL to help me. I feel accomplished.
[QUOTE=Shrapnel :3;33285072]Programming for iOS really makes you love languages like C# and C++. Everything is just a fucking struggle with objective C. It has some nice things about it, but they're ruined by the fact that it is upsetting to look at and loads of the keywords have been changed for no real reason. This shit ain't logical.[/QUOTE]I don't like Obj-C. Look at this: [code]if (![[options objectForKey:NSDocumentTypeDocumentOption] isEqualToString:NSPlainTextDocumentType] && ((ignoreHTML && [docType isEqual:NSHTMLTextDocumentType]) || (ignoreRTF && ([docType isEqual:NSRTFTextDocumentType] || [docType isEqual:NSWordMLTextDocumentType])))) { [text endEditing]; [[text mutableString] setString:@""]; [options setObject:NSPlainTextDocumentType forKey:NSDocumentTypeDocumentOption]; [self setFileType:(NSString *)kUTTypePlainText]; [self setOpenedIgnoringRichText:YES]; retry = YES; } else { NSString *newFileType = [[self textDocumentTypeToTextEditDocumentTypeMappingTable] objectForKey:docType]; if (newFileType) { [self setFileType:newFileType]; } else { [self setFileType:(NSString *)kUTTypeRTF]; // Hmm, a new type in the Cocoa text system. Treat it as rich. ??? Should set the converted flag too? } if ([workspace type:[self fileType] conformsToType:(NSString *)kUTTypePlainText]) [self applyDefaultTextAttributes:NO]; [text endEditing]; } } while(retry); layoutMgrEnum = [layoutMgrs objectEnumerator]; // rewind while (layoutMgr = [layoutMgrEnum nextObject]) [text addLayoutManager:layoutMgr]; // Add the layout managers back [layoutMgrs release]; val = [docAttrs objectForKey:NSCharacterEncodingDocumentAttribute]; [self setEncoding:(val ? [val unsignedIntegerValue] : NoStringEncoding)]; if (val = [docAttrs objectForKey:NSConvertedDocumentAttribute]) { [self setConverted:([val integerValue] > 0)]; // Indicates filtered [self setLossy:([val integerValue] < 0)]; // Indicates lossily loaded } [/code] How fucking unreadable is that? I don't know objective-C – luckily. I program in C and perl mostly for the command line, I was just wondering because it seemed like most of you guys program games and gui apps for Windows.
[QUOTE=ROBO_DONUT;33288797]If you don't mind having OOP shoved in uncomfortable places. And the complete lack of ability to work with any sort of binary data. Passing vertex info to OpenGL is a chore, loading BSP maps is a chore. Everything that would take me about two minutes in regular C is near impossible in Java. Even [i]PYTHON[/i] has better support for packed binary data. Fuck Java and fuck whoever was involved in its design.[/QUOTE] Never thought you had so much rage against Java ROBO. Also, what do you mean by "near impossible"?
Pretty sure that's just an extreme example.
[QUOTE=blkducky_v2;33289232]Pretty sure that's just an extreme example.[/QUOTE]I don't know, I don't like the message style method calls at all.
Java has a lot of annoying features, like everything being a pointer to an object. I mean, gosh.
[QUOTE=garry;33288472]Is this purely in Lua or something?[/QUOTE] Yes, I am using Löve.
[url=https://github.com/Jookia/dplane]Desert Plane is on GitHub![/url]
[QUOTE=RyanDv3;33289104]In my view, a language is merely a tool. True, some tools are just better than others, but it sounds like your using the wrong tool or using the tool in the wrong way, not that the tool itself is bad. [/QUOTE] You don't have much of a choice on Android. The 'right way' to write an Android application is 100% in Java. You [i]could[/i] write some C with the NDK, [i]in theory[/i], but it still has to be bound to Java through the JNI anyway, which is pretty gross. So, it's either put up with Java or put up with Java+JNI. Guess how many good options there are. Zero.
That's why I included the "using the tool in the wrong way" part; you are trying to program C code in java. Of course you are going to fail. That's like a java person claiming C is shit because they have they have to worry about the the stack and the heap, etc. [editline]15th November 2011[/editline] Although I admit it would be friendlier towards developers to be able to program in any language.
[QUOTE=Darwin226;33289223]Never thought you had so much rage against Java ROBO. Also, what do you mean by "near impossible"?[/QUOTE] I don't mind using applications written in Java, and I like the fact that, as a user, I can use a Java application anywhere. I probably wouldn't even mind writing Java if I had a problem which played to its strengths. However, as an overall language, I think it's just awful. It's like it was designed in a vacuum based on software philosophy rather than actuality. I understand how all of Java's core ideas could seem appealing in theory, but I don't like how they all work out in practice. Maybe it's just me. By "near impossible" I mean that Java provides one extraordinarily awkward class for reading packed binary data (I don't remember what it's called) from a file. I can't read the data straight into a byte array and cast it to the appropriate values like I could in C or C++ because Java doesn't allow casting. It doesn't support a lot of the integer formats that C would support. To complicate things even further, Android, specifically, doesn't even provide that one awkward binary file parsing object in it's standard library, so if you have to parse binary files, you're pretty screwed. Java [i]does[/i] provide something called a Buffer/ByteBuffer (and its child classes), but it's downright awful, clumsy, disgusting, gross, unwieldy, and just bad. [editline]15th November 2011[/editline] [QUOTE=RyanDv3;33289662]That's why I included the "using the tool in the wrong way" part; you are trying to program C code in java. Of course you are going to fail. That's like a java person claiming C is shit because they have they have to worry about the the stack and the heap, etc.[/QUOTE] I was NOT trying to write C code in Java. I WAS trying to load a binary file. If a language cannot load a binary file cleanly, it is not worth using.
[QUOTE=ROBO_DONUT;33288797]If you don't mind having OOP shoved in uncomfortable places. And the complete lack of ability to work with any sort of binary data. Passing vertex info to OpenGL is a chore, loading BSP maps is a chore. Everything that would take me about two minutes in regular C is near impossible in Java. Even [i]PYTHON[/i] has better support for packed binary data. Fuck Java and fuck whoever was involved in its design.[/QUOTE] I'm sorry, but what do you mean? Reading and writing binary data is extremely easy. What could you possible need other than reading bytes and bit manipulation? The absence of unsigned types is sometimes a problem though, that's true. Edit: [QUOTE=ROBO_DONUT;33289853]I don't mind using applications written in Java, and I like the fact that, as a user, I can use a Java application anywhere. I probably wouldn't even mind writing Java if I had a problem which played to its strengths. However, as an overall language, I think it's just awful. It's like it was designed in a vacuum based on software philosophy rather than actuality. I understand how all of Java's core ideas could seem appealing in theory, but I don't like how they all work out in practice. Maybe it's just me. By "near impossible" I mean that Java provides one extraordinarily awkward class for reading packed binary data (I don't remember what it's called) from a file. I can't read the data straight into a byte array and cast it to the appropriate values like I could in C or C++ because Java doesn't allow casting. It doesn't support a lot of the integer formats that C would support. To complicate things even further, Android, specifically, doesn't even provide that one awkward binary file parsing object in it's standard library, so if you have to parse binary files, you're pretty screwed. Java [i]does[i] provide something called a Buffer/ByteBuffer (and its child classes), but it's downright awful, clumsy, disgusting, gross, unwieldy, and just bad.[/QUOTE] Sounds like you were doing it wrong. There are tens of classes for reading and writing binary data and they are all included in the Android SDK. And it supports casting and it has 8 bit integers, 16 bit integers, 32 bit integers and 64 bit integers...
[QUOTE=Robber;33289871]I'm sorry, but what do you mean? Reading and writing binary data is extremely easy. What could you possible need other than reading bytes and bit manipulation? The absence of unsigned types is sometimes a problem though, that's true. Edit: Sounds like you were doing it wrong. There are tens of classes for reading and writing binary data and they are all included in the Android SDK. And it supports casting and it has 8 bit integers, 16 bit integers, 32 bit integers and 64 bit integers...[/QUOTE] The ability to load an entire flat data structure in two lines of code. In C, it's as simple as: 1. Define a struct (be careful with packing) 2. Call read(buffer, count, sizeof(type)) The entire structure gets filled with data [i]exactly as it appears in the file[/i], bit for bit. Which, IMHO, is way cleaner than having a class with a constructor with about five thousand "file.readInt()" and "value |= file.readInt() << 4" lines.
[QUOTE=ROBO_DONUT;33289853] If a language cannot load a binary file cleanly, it is not worth using.[/QUOTE] What does the loading of binary files have to do with the quality of java as a language? Perhaps you are complaining about java's standard library of classes? I mean, just because something is implemented poorly doesn't mean the language is bad.
[QUOTE=RyanDv3;33290109]What does the loading of binary files have to do with the quality of java as a language? Perhaps you are complaining about java's standard library of classes? I mean, just because something is implemented poorly doesn't mean the language is bad.[/QUOTE] Java is its standard library of classes. Every language is, to some extent.
[QUOTE=ROBO_DONUT;33290037]The ability to load an entire flat data structure in two lines of code. In C, it's as simple as: 1. Define a struct (be careful with packing) 2. Call read(buffer, count, sizeof(type)) The entire structure gets filled with data [i]exactly as it appears in the file[/i], bit for bit. Which, IMHO, is way cleaner than having a class with a constructor with about five thousand "file.readInt()" and "value |= file.readInt() << 4" lines.[/QUOTE] What you are talking about sounds like a problem that could be solved by serialization. Which in java is accomplished with like 3 lines of code.
[QUOTE=RyanDv3;33290109]Perhaps you are complaining about java's standard library of classes? I mean, just because something is implemented poorly doesn't mean the language is bad.[/QUOTE] "The language is great and you can use it just fine if you create your own standard library"? Sure, the Java language itself is bearable, but it's packaged in layers of shit and runs on a VM apparently designed to prevent anyone casually creating programs for it. You have to be DEDICATED and be willing to spend hours looking up obscure directives to get it to do simple things like dynamically link to libraries. (I never managed to get it to use both system libraries and local ones from within a jar package, no matter how hard I screamed)
Yeah, so instead of having my file loading code in one place, it's spread over a bunch of classes in a bunch of different files. You have to at least admit that it's a ton of extra boilerplate. Instead of just typing out the format as structs of the data and loading it directly, like you would in C, you're copying and pasting hundreds lines of inane shit just to load a few integers.
[QUOTE=ROBO_DONUT;33290148]Java is its standard library of classes. Every language is, to some extent.[/QUOTE] [quote=java sucks article]The fact is that there are four completely different things that go by the name ``Java'': A language; An enormous class library; A virtual machine; A security model. [/quote] The source of that is, for completely unrelated reasons to this discussion, from an article titled "[url=http://www.jwz.org/doc/java.html]java sucks[/url]".
[QUOTE=RyanDv3;33290301]The source of that is, for completely unrelated reasons to this discussion, from an article titled "[url=http://www.jwz.org/doc/java.html]java sucks[/url]".[/QUOTE] I'm not even sure what your point is.
blah blah java blah binary blah </argument> on topic, i'm working off a piece of crumpled up loose leaf i wrote ideas on during school :v:
[QUOTE=ROBO_DONUT;33290314]I'm not even sure what your point is.[/QUOTE] My point was that saying that "java" the language and "java" the class library are the same thing is incorrect. [editline]15th November 2011[/editline] [QUOTE=ROBO_DONUT;33290263]Yeah, so instead of having my file loading code in one place, it's spread over a bunch of classes in a bunch of different files. You have to at least admit that it's a ton of extra boilerplate. Instead of just typing out the format as structs of the data and loading it directly, like you would in C, you're copying and pasting hundreds lines of inane shit just to load a few integers.[/QUOTE] I don't understand this mentality; the completely insane, stubborn, pointless idea there are ABSOLUTELY no good ways of using a certain tool for a certain job. Especially when that tool is a programming language, which means it has quite a bit of flexibility due it's very nature. I guess all the people who develop in java are just using it because they're dumb, then? Because obviously if they were smart, they'd upgrade to C, right?
Sorry, you need to Log In to post a reply to this thread.