
Try Objective-C - noinput
http://tryobjectivec.codeschool.com/
======
mietek
Very nice presentation, but it seems like this could benefit from an
Emscriptened browser-based Objective-C compiler.

Fabrice Bellard's browser-based Linux boots in less time than this prints out
"Hello, world!"

~~~
rubymaverick
We're reusing the stuff we built for the Try iOS course we came out with late
last year. I've looked into Emscripten for this and from what I saw it really
wouldn't work with this course, although maybe I missed something?

~~~
simcop2387
You could always boot the VM with an image that contains the compiler and run
there. If it truly does boot faster than the results take otherwise then you
could move it all into javascript that way, and not have to worry as much
about the infrastructure around it.

------
eridius
Very cute. I did the first 9 challenges. I am rather worried though that
you're teaching people that `NSLog(var)` is acceptable, because it's a
horribly dangerous thing to do if var contains untrusted input.

~~~
coldtea
Huh? How so?

~~~
eridius
If the variable's value contains any format args, e.g. %s, then NSLog (or
printf, or whatever string formatting function you're using) will look for
another argument, which you didn't actually pass, so it starts looking at
garbage stack values.

Besides causing incorrect output, this may crash your program, or potentially
be a vector for an exploit.

~~~
joshschreuder
Is there any reason NSLog doesn't filter input to escape these format args?

~~~
Someone
It can't. <http://en.wikipedia.org/wiki/Uncontrolled_format_string>:

 _"In particular, the varargs mechanism allows functions to accept any number
of arguments (e.g. printf) by "popping" as many arguments off the call stack
as they wish, trusting the early arguments to indicate how many additional
arguments are to be popped, and of what types."_

NSLog is similar; it has to trust its first argument to be consistent with the
number and types of arguments actually passed to it.

If you call NSLog(x), but do not have complete control over the value of x,
you cannot guarantee that.

------
rubymaverick
Sorry for the slow response times on the challenge submissions everyone. We
only have so many Mac Minis running these things . We are looking into ways to
speed it up

~~~
sjtgraham
Looks like those Mac Minis are getting smoked right now, poor little guys. I
can't load the page unfortunately to see myself, but could you use GNUStep to
compile the examples on any flavour of box?

~~~
rubymaverick
I know I feel so bad for them. We are working on some temporary fixes
(including caching which as we all know is really easy to do) and changing the
way we isolate the code submissions so we can get more throughput. GNUStep
might be an interesting long term fix.

------
dreen
I have to work on porting an iPad app to Java from a guy that didn't bother to
use comments or any documentation and his idea of versioning system are a
bunch of folders 1,2,3 for different components whose numbers dont always
match up.

I'm afraid I've been scared off Obj-C for life now.

~~~
smspence
"a guy that didn't bother to use comments or any documentation and his idea of
versioning system are a bunch of folders"

What does this have to do with the Objective-C language itself?

~~~
dreen
nothing at all. but it scared me off. like in highschool i had this german
teacher who scared me off german because she was a massive bitch. not the
language's fault, but i hate german now.

~~~
UmOkThatsCool
You hate X because of a completely-unrelated-thing-Y? Try acting like an
adult.

~~~
dreen
Why don't you try acting like a human.

------
icesoldier
I really like this, but I'll have to give it another try in a few hours after
work when the HN rush subsides and gives the server some time to
breathe/compile the challenges.

~~~
rubymaverick
Good idea, and our minis thank you ;)

------
rubymaverick
I repurposed the content in the course to produce a simple HTML version of the
course here:

<http://rubymaverick.com/try-objectivec-book/>

The content is up on my Github and any pull requests would be welcome!

<https://github.com/rubymaverick/try-objectivec-book>

------
peteretep
Yow, that backend compilation step taking 20 seconds makes this way less fun
than it looks like it should be :-/

------
rubymaverick
We've gotten the course back up and responding to submissions in a reasonable
amount of time (2.5~ seconds as compared to 30~ seconds earlier).

Please form a single file line behind mietek ;)

------
dchuk
Is there anywhere I can read about the mac mini backend for this? Sounds
interesting.

------
austinhyde
Only one complaint from me: error messages. I realize this is probably a
complicated problem, but on the other hand, can alienate beginners.

For example, on the first exercise, you're asked to write NSLog(@"Name"); When
I did it, I first missed the semicolon, and got an error "expected ‘;’ after
expression". Okay, fine and good, that makes sense. I added the semicolon and
got "‘extern’ variable has an initializer" because I called NSLOG instead of
NSLog. Even for a programmer, that's not a helpful error message...

~~~
rubymaverick
Thanks for the examples, and I agree that error messages are super-important
for beginners. We have written a bunch of code trying to "massage" error
messages to be more helpful. I'll be adding these to the list, thanks!

------
Fightback
Only getting 504s at the moment. Will try again later..

------
kristopher
The Super Mario World theme is cool, although super ironic since
Objective-C/iPhone is helping to displace the Nintendo Empire.

------
Rafert
Very interesting. I started with Try iOS but getting an actual app together in
Xcode proved more difficult than I thought, partly because Obj-C still felt so
weird after only learning Java/C# during university.

I ended up buying the Big Nerd Ranch book (it's great!) on iOS programming,
which also covered Objective C in more detail.

------
fabriceleal
Is it just me or do I really have to answer to Moby-Dick trivia while coding
Objective C?

On the 1st level, I couldn't progress unless I used 'Ishmael' as firstName and
'Moby-Dick' as lastName.

------
jayfuerstenberg
I wish I had this 7 years ago when I was first learning the language.

------
na85
I clicked "Start Course" and was greeted with a 404 that took way too long to
load on my 50 megabit connection.

/shrug

Oh well, I'm sure there are other sites out there.

~~~
sjtgraham
It's running on Mac Minis dude, and they're getting hammered. Bookmark it and
visit again later. That's what I'm doing. :)

------
Siecje
I like the new Git course, but I still can't take the first one... maybe fix
that first?

~~~
renz
We see green across the board for all 3 git courses, if you're personally
having problems with one of them you should head on over to
<http://codeschool.com/support> and drop them a ticket. :)

------
mv
the site is very slow loading next page after clicking submit... Also, no
option to skip the stupidly easy levels.

~~~
rubymaverick
I'm actually working on extracting all the content for just a plain HTML
version so people who don't want to do all the challenges will have something
to read (it's almost a books length of content)

------
osmano
it seems a nice place to start.

------
bestdayever
This seems fun. Unfortunately it is stuck at challenge 2 and takes about 2
minutes per compile.

------
josteink
Good stuff... I guess?

I still fail to see the appeal of learning a language with such extremely
limited value (only works, has tools and adaptation on a certain lawsuit-happy
gadget-vendor's OS).

Anyone? And what about principles? What about giving back to the community?
Shouldn't hackers hacking away on the next big thing be using open
technologies as open technologies was what enabled them to get hacking in the
first place?

~~~
yarrel
Politically I agree, but Objective-C is a better language than C++ or Java,
and Cocoa is a better framework than the STL or the Java core libraries.
That's before we get to the GUI experience. Learning it will make you a better
programmer.

~~~
primitur
Since I became a convert to the "put your own VM in the frameworks and add a
cute language for your core logic" kind of school of thought, I seriously
cannot see the value in Obj-C and the Android/Java thing. I've been writing
code in these environments for decades: I'm now seriously addicted to Lua.

2 years of Lua work, and I absolutely cringe with the idea of having to go
back to Java/Obj-C/C++, in any context other than to push a bridge across the
VM gap to some framework.

Its a smaller language, its lighter. It performs quite well, and can be put
almost anywhere there is a lib.so file (so: everywhere). Choose what you want
to link with, extend the external API's with Lua, and leave the whole problem
of obscure languages for the young 'uns..

So, its not so much about my desire to pimp Lua, but my point is this: You can
choose whatever language you want, actually, to develop a core host
environment with, but use a very simple, sweet language for the majority of
the work.

