Flappy Bird in Swift
81–90 of 126 posts
Re: Flappy Bird in Swift
#82Always had a problem with Objective C, could never read it (Android Dev) but this right here is pretty impressive. I like the mixture of language features. But my only question, are you still locked to using an mac to develop for iOS. I guess since the language is closed source it depends on some osx libs at compile time.
Yes, you still need a Mac to develop for iOS. Come to the dark side! :)
Re: Flappy Bird in Swift
#83Swift looks fine, the only thing I don't like its that is for Apple only products... that kinda defeats the purpose of having a programming language.
Good luck compiling Objective-C on Windows :)
Re: Flappy Bird in Swift
#84I got mixed feelings about the language at first sight. I guess my mammalian brain recognizes languages based on the particular combination of the following naming decisions. * func, function, fun, defun fu, funct * CamelCase vs snake_case * whitespace, semicolon or comma usage * var, int/integer/uint64/Integer/ * choice of (), {}, [] or better (){a[]} * import/include/require, class/class, override, self vs this, ne…
> PS: next time you design a new language just make a random unique combination of the above. That's my impression whenever I see a new programming language too. Why would someone switch to your language if the syntax is just the same boring old syntax they've been using in another language?
Use different syntax and naming for the things that are genuinely different about your language.
Re: Flappy Bird in Swift
#85Swift looks fine, the only thing I don't like its that is for Apple only products... that kinda defeats the purpose of having a programming language.
> Swift looks fine, the only thing I don't like its that is for Apple only products... that kinda defeats the purpose of having a programming language. Tell that to Microsoft ;)
Re: Flappy Bird in Swift
#86Earlier quoted context omitted.
That's my problem. I can't even find the entry point for this application. Looking at AppDelegate.swift I see an unused var (window) and that's it.
@UIApplicationMain is the key there, from what I can see. An Objective C iOS app typically includes a main.m entry point which calls UIApplicationMain and passes the AppDelegate. This seems to have been removed in favour of what Swift is calling a "declaration attribute", which presumably does the same thing. In this sense, the code is even less clear than the Objective C implementation.
Re: Flappy Bird in Swift
#87Re: Flappy Bird in Swift
#88Swift looks fine, the only thing I don't like its that is for Apple only products... that kinda defeats the purpose of having a programming language.
On principle I'd like to see Apple put Swift under a free software license of some kind and ideally make a cross-platform reference implementation, but realistically, even if they do that it's unlikely to ever get wide use anywhere but Apple products.
Re: Flappy Bird in Swift
#89Author here - I didn't expect to see this here this morning. I'd intended to write a longer post :) In any case, here's a few things I learned about swift yesterday building this. Please note that I have about 4 hours swift experience, so feel free to correct anything I say that's wrong. 1. To make properties on a class you simply declare the variable on the class e.g.: class GameScene: SKScene { var bird = SKSpriteN…
I think just the fact that you were able to build a game with just 4 hours of learning a new language speaks volumes about Swift's barrier to entry. Well done!
Re: Flappy Bird in Swift
#90Earlier quoted context omitted.
I get where you're coming from - but in my experience, the barrier is totally psychological. Objective C isn't that unusual a language - the syntax is a bit foreign, but nothing that takes more than a couple of days to wrap your head around. You'll spend far more time getting to grips with Cocoa/Cocoa Touch.
the barrier is totally psychological Of course it is. It's certainly not a physical barrier. But psychological or not, other languages don't have a similar barrier.
Lisps have the RPN psychological barrier. Python has the significant whitespace psychological barrier. etc. Any language can present someone with some psychological barrier.
I think the OP's strongest point was, Objective-C the language is pretty trivial to learn quickly (after all, it's just C with message passing). You'll spend far longer trying to learn the Cocoa APIs than you will spend learning Objective-C-the-language.
For instance, I decided to try to learn swift and SpriteKit at the same time. I spent far longer looking up methods on SKSpriteNode than I did looking up language constructs. (i.e. I assumed "let" was the same as in ES6 and couldn't figure out why the compiler was mad.)