Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Doc Block
Apr 15, 2003
Fun Shoe

Martytoof posted:

every language that isn't c-style looks weird as gently caress

i got over it for objective-c because it's mostly c-style with a bunch of brackets, but i'm having a hard time with python and stuff

and then i tried to learn ruby on rails because i wanted to make a quick website and everything about it was weird as gently caress. i am a little depressed that i can't pick this stuff up easily anymore :(

this x 1 million

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe
Objective C

Doc Block
Apr 15, 2003
Fun Shoe
it's poo poo

Doc Block
Apr 15, 2003
Fun Shoe
It costs $99/year to be in the iOS developer program.

The language people use to make native (ie good) apps is Objective C. You can use C# with MonoTouch if you really really really want to, but that's 3rd party. The only high level frameworks and APIs from Apple are for Objective C, with the low level stuff being in C.

edit: you can download Xcode and run stuff in the iOS simulator for free, but if you wanna test on a device and publish in the App Store then you gotta pay $99/year.

Doc Block fucked around with this message at 03:03 on May 11, 2013

Doc Block
Apr 15, 2003
Fun Shoe

chumpchous posted:

the verbosity is fine for methods and etc but it would be nice if they had some easier syntax for doing things like allocating/initializing arrays/dictionaries/etc. it seriously takes 2 lines to make an empty goddamn mutable array

???

NSMutableArray *array = [NSMutableArray array];

or, if you aren't using ARC and want an owned object returned instead of an autoreleased one:

NSMutableArray *array = [[NSMutableArray alloc] init];

Doc Block
Apr 15, 2003
Fun Shoe
LOL if having everything be an anonymous type is considered good code in C#. B-b-but I saved myself a split second of typing, who cares about readability!

Of course, this is a Microsoft language, so of course C# devs think it's a good idea to put the class type in all methods and variable names.

Doc Block
Apr 15, 2003
Fun Shoe

Mr SuperAwesome posted:

neither of these things are true but please tell me more

How are you not essentially putting the class type in method, property, and variable names if instead of, say,
CloudSyncUpdate fileUpdate = whatever
...
fileUpdate.fetchLatestUpdate()

you have to do

var fileUpdate = whatever
...
fileUpdate.fetchLatestCloudSyncUpdate()

to keep it readable? Or, so that you can still tell what fileUpdate is:

var cloudSyncUpdate = whatever
...
cloudSyncUpdate.fetchLatestCloudSyncUpdate()

to keep it readable?

Because if you're designing your API with var usage in mind, having methods just named stuff like fetchUpdate isn't very descriptive.

Disclaimer: I've only dabbled with C#, and it was a long time ago.

Doc Block fucked around with this message at 16:56 on May 12, 2013

Doc Block
Apr 15, 2003
Fun Shoe
That is the One True Brace Style. Functions & methods get the opening brace on a separate line. if/else, for loops, etc., get the opening brace on the same line. The closing brace always goes on a separate line.

Doc Block
Apr 15, 2003
Fun Shoe

Shaggar posted:

yes the one truly bad brace style

And what, pray tell, is the Shaggar-approved brace style?

Doc Block
Apr 15, 2003
Fun Shoe
lol you would know

Doc Block
Apr 15, 2003
Fun Shoe

Nomnom Cookie posted:

my shaggier.xls has allman on it. if thats the one where opening braces always go on the same line then hes right

allman style is this dumbass poo poo
code:
if (yourmom == laffo)
{
    gb2gbs();
}
else
{
    yospos_bitch();
}
real men use the K&R One True Brace Style
code:
int main(int argc, char *argv[])
{
    if(yourmom == laffo) {
        gb2gbs();
    } else {
        yospos_bitch();
    }

    return 0;
}

Doc Block
Apr 15, 2003
Fun Shoe
When I was only three
My momma said to me
"Don't go hanging with the web devs
Or you're gonna learn PHP"

Doc Block
Apr 15, 2003
Fun Shoe
Also, tabs are 4 spaces, saved as hard tabs. 8 spaces is acceptable, depending on the language.

Doc Block
Apr 15, 2003
Fun Shoe

Tiny Bug Child posted:

this is almost correct, but opening braces never go on their own line

Maybe if you're writing in a babby p language, but in Real Programming Languages, when writing functions & methods the opening brace goes on its own line.

Doc Block
Apr 15, 2003
Fun Shoe

I'm the one line case statements.

Doc Block
Apr 15, 2003
Fun Shoe
lol

Doc Block
Apr 15, 2003
Fun Shoe
Don't use global variables, problem solved.

Doc Block
Apr 15, 2003
Fun Shoe
LOL wrong

Doc Block
Apr 15, 2003
Fun Shoe

Ericadia posted:

Yeah I think it looks better this way tbh. When I see braces I think multiple statements.

What happens when you add a statement but forget to add the braces?

Doc Block
Apr 15, 2003
Fun Shoe
The worst programmers are the ones who can't/won't read compiler error messages, and instead immediately jump on [whatever programmer forum/site] and ask people how to fix it. Especially when they just paraphrase the error message instead of posting it and the offending code. Especially especially when they're using clang.

Doc Block
Apr 15, 2003
Fun Shoe
Yeah, umm, gently caress that poo poo.

Doc Block
Apr 15, 2003
Fun Shoe

chumpchous posted:

every time i get probated (a lot), i secretly feel kinda bad about it (once or twice ifelt really bad because i definitely deserved it). if anyone ever commented on or cared about it i think it would suck a lot more than i'd ever admit

you were pretty much asking for it with the maggots in noses videos you linked to.

Doc Block
Apr 15, 2003
Fun Shoe

Shaggar posted:

none of this has 2 do w/ ios.

LOL if ur a developer but aren't making mobile apps ITYOOL 2013

Doc Block
Apr 15, 2003
Fun Shoe
b-b-but the Ruby guys said Xcode is bad and that I should use Vim!

Doc Block
Apr 15, 2003
Fun Shoe

THC posted:

Im inclined to think the entire message passing concept is apple being different for the sake of being different. (NB: I realize this is not the actual reason why obj-c has messaging but to someone raised on c/++ c# and java it is just so very peculiar.) they just get turned into function calls at compile time anyway so wtf

No they don't, at least not in the way that you mean. They get turned into calls to the C function objc_msgSend(), which sends the object the message.

The message passing is what makes Objective-C such a dynamic language.

For instance, you can add methods to objects at runtime because calling methods is really just sending messages instead of making direct function calls like in c++/c#/whatever. And you can ask an object if it responds to a given message so that you can, say, use a method added in a certain version of iOS but still maintain backward compatibility without having to remember what specific version of iOS it was that added the method.

You can forward messages to other objects, or even make an object that consumes all messages.

Message passing is one of the things that I like about Objective-C.

Doc Block fucked around with this message at 09:12 on May 31, 2013

Doc Block
Apr 15, 2003
Fun Shoe

prefect posted:

is this a religious thing, or was there some guy named church who thought them up?

I think he means Roman Numerals

Doc Block
Apr 15, 2003
Fun Shoe

Jerry SanDisky posted:

Lots, usually on the same monitor

Doc Block
Apr 15, 2003
Fun Shoe

THC posted:

in obj-C is there any particular reason to use your own instance variables and methods instead of just dropping a @property in there? they're not doing anything fancy with the accessors except return some value so im confused why they dont just use @properties.

Property setters are slower because they also have to do all the KVO stuff and whatnot.

ARC has pretty much eliminated the reason people started using properties for instance variables.

Doc Block
Apr 15, 2003
Fun Shoe

Brain Candy posted:

most people are assholes. all people are terrible. :ssh:

Doc Block
Apr 15, 2003
Fun Shoe

uG posted:

visual C will never be updated past c89 so we can deduce that c99 is not real C

msvc is poo poo. ms going out of their way to purposefully not implement c99 is bullshit. making their own c99-esque safe string functions that take the exact same arguments and produce the same results but have different names is bullshit.

clang/LLVM supremacy.

Doc Block
Apr 15, 2003
Fun Shoe
Why learn Ruby when you can learn Objective-C, which is rapidly being turned into compiled Ruby by all the Ruby devs flocking to it.

Doc Block
Apr 15, 2003
Fun Shoe

chumpchous posted:

objective c is a really stupid language seriously use ruby motion and if you need something to be fast write it in c

said a terrible programmer.

polpotpi posted:

theres no good tutorials or books for objective c

"how do i maek iphone apps, post tutorials plz."

Doc Block
Apr 15, 2003
Fun Shoe

Bloody posted:

why not gcc/g++?

because it's poo poo. it's slower, its c++11 implementation isn't as complete as clang's, and it produces really awful error messages.

clang is fast. clang has a (nearly) complete c++11 implementation, and, thanks to its developers trying to make it understand your code really well, it produces error messages that are so helpful it can actually suggest fixes. that same code understanding also gives clang a really good static analyzer and makes things like Objective-C's ARC possible.

additionally, clang/LLVM are architecturally superior to GCC. GCC is basically a big monolithic thing that its devs are only now trying to modularize in any meaningful way. LLVM is constructed as a bunch of independent libraries, and these libraries can be used by other, non-LLVM code. you can use this to build LLVM right into an IDE like Xcode does, or use it to build your own code analysis tools, or use it to more easily create your own domain-specific language. you can even write your own optimization steps.

Doc Block
Apr 15, 2003
Fun Shoe

uG posted:

if you need to be coddled through your mistakes then sure thats p cool

what's cool is that clang/LLVM is better than GCC at analyzing your code. on the surface this manifests as more helpful error messages, it also leads to more optimization opportunities and better code analysis tools.

also, final decisions re: clang/LLVM don't rest with a bunch of freetards.

Doc Block
Apr 15, 2003
Fun Shoe
If you learn Objective-C from a book be prepared to do a substantial amount of catch-up reading on line.

Doc Block
Apr 15, 2003
Fun Shoe

OBAMA BIN LinkedIn posted:

just use mvim idiots

ftfy, because :lol: if u don't use mac

Doc Block
Apr 15, 2003
Fun Shoe
Use BBEdit (or TextWrangler if you're a rule 36er) for editing text and writing dumb p-lang poo poo.

Doc Block
Apr 15, 2003
Fun Shoe

BONGHITZ posted:

textwrangler


more like textmangler, am i right?

Nope, TextWrangler is a perfectly good text editor if you're somehow a Rule 36er (the non-poor best text editor is BBEdit, the paid version of TextWrangler)

Doc Block
Apr 15, 2003
Fun Shoe
hey guys this honorary p-lang is better than that actual p-lang!

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe
what moobie is dat?

  • Locked thread