8 ms·
Try Objective-C
- mv 13y agothe site is very slow loading next page after clicking submit... Also, no option to skip the stupidly easy levels.
- rubymaverick 13y agoI'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)
- peteretep 13y agoYow, that backend compilation step taking 20 seconds makes this way less fun than it looks like it should be :-/
- deleted 13y ago[deleted]
- icesoldier 13y agoI 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 13y agoGood idea, and our minis thank you ;)
- rubymaverick 13y agoSorry 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
- nikai 13y agoFWIW, Git Real 2 is working nicely at my place. I'm at level 2 now, looks great so far!
- sjtgraham 13y agoLooks 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 13y agoI 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.
- deleted 13y ago[deleted]
- rwl4 13y agoHave you considered ccache? http://ccache.samba.org/ http://ccache.samba.org/ You could also roll your own in a very few lines of code. Maybe even have the output of the program, not the compiled code, be the content of the hashed file, assuming you aren't reading STDIN or anything like that from the user.
- rubymaverick 13y agoThat's a really cool project! Definitely going to look into it for some of our more complicated courses, but for this course compilation is usually under a half-second so it's not the compilation that's slow (it's the way we are tearing down an entire VM after every submission, we are working on changing that now)
- rwl4 13y ago
- mietek 13y agoVery 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 13y agoWe'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?
- rubymaverick 13y agoLooks like work has started on using emscripten with Objective-C code: https://github.com/kripken/emscripten/pull/1162/files https://github.com/kripken/emscripten/pull/1162/files Still, a long way to go.
- simcop2387 13y agoYou 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.
- blueprint 13y agoWow, this is totally awesome. This is my first time hearing about emscripten and I've been a Cocoa and JS programmer for about 9 years. What are some of the coolest applications of emscripten?
- no_more_death 13y agoPDF.js is used by Firefox to render PDFs in the browser.
- croikle 13y ago
- bestdayever 13y agoThis seems fun. Unfortunately it is stuck at challenge 2 and takes about 2 minutes per compile.
- dreen 13y agoI 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 13y ago"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 13y agonothing 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 13y agoYou hate X because of a completely-unrelated-thing-Y? Try acting like an adult.
- hockeybias 13y agoIf this was still the early 1980s I'd take you up on it... Coming from C# and Java, I really find it unappealing.
- Fightback 13y agoOnly getting 504s at the moment. Will try again later..
- na85 13y agoI 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 13y agoIt's running on Mac Minis dude, and they're getting hammered. Bookmark it and visit again later. That's what I'm doing. :)
- deleted 13y ago[deleted]
- dchuk 13y agoIs there anywhere I can read about the mac mini backend for this? Sounds interesting.
- fabriceleal 13y agoIs 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.
- rubymaverick 13y agoWe'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 ;)
- eridius 13y agoVery 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 13y agoHuh? How so?
- jcromartie 13y agohttp://en.wikipedia.org/wiki/Uncontrolled_format_string http://en.wikipedia.org/wiki/Uncontrolled_format_string
- eridius 13y agoIf 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 13y agoIs there any reason NSLog doesn't filter input to escape these format args?
- Siecje 13y agoI like the new Git course, but I still can't take the first one... maybe fix that first?
- renz 13y agoWe 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 http://codeschool.com/support and drop them a ticket. :)
- jayfuerstenberg 13y agoI wish I had this 7 years ago when I was first learning the language.
- kristopher 13y agoThe Super Mario World theme is cool, although super ironic since Objective-C/iPhone is helping to displace the Nintendo Empire.
- greenranger 13y agoWhich is a little ridiculous considering nintendo likely stands to make a kabillion dollars if it begins releasing mario titles for iOS devices.
- Rafert 13y agoVery 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.
- josteink 13y agoGood 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?
- canttestthis 13y agoSo creating apps for an OS that controls 40% of the market share is limited value? Open source is good, but I don't condemn software that's closed source. I use OSX and dualboot Windows, for one.
- yarrel 13y agoPolitically 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 13y agoSince 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.
- osmano 13y agoit seems a nice place to start.
- rubymaverick 13y agoI repurposed the content in the course to produce a simple HTML version of the course here: http://rubymaverick.com/try-objectivec-book/ 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 https://github.com/rubymaverick/try-objectivec-book
- austinhyde 13y agoOnly 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 13y agoThanks 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!