Friday, June 26, 2015

Playground revisited for Xcode7

Yesterday I watched WWDC 2015 "What's new in Playground", snuggled down in my bed, ready to enjoy my session, better than a Luc Besson's movie ;)
(yes that's the kind of things geeks do).

I use playgrounds a lot.

They are part of my Swift toolbox. Good ideas found on Twitter, things I experiment, I store them in my Swift github repo. Very practical too, to share recipes with others.

If we look behind for a bit of history in playground releases (not to worry Playground and Swift are just one year old, so history will be short!).

Looking behind...

Xcode 6.0 beta brings playground. I'm convinced playgrounds have played a crucial role in the so rapid Swift adoption. Of course, playgrounds were quite buggy in beta and used to crash a lot but, with playgrounds, you can code Swift snippets, add text explanation to them to share with others. It's what the Swift guided tour offered you. You can even embed images ans CSS in Resources folder.

Xcode 6.2 brings us markdown format, see my blog post Even more fun with Playground. To me, this was one of the biggest improvement: not to have to write fragments of explantation in HTML and then associate Swift files using some XML glue file... Markdown is just great! See my Swift playground in Xcode6.2 format.

Xcode 6.3 brings us Sources folder. Like we used to have the Resources folder. So now to be able to test a Swift framework, you can put it in Sources. No need to work with a workspace like described in Playground and libraries post. We also have inline results, quite practical too. See my Swift playground in Xcode6.3 format.

So what's new in Xcode7?

Xcode 7 brings us Pages. I used to gather together all my Swift recipes in my toolbox within a workspace. With a workspace, I could also embed Swift library (prior to swift 6.3). But now with Xcode7, bye bye workspace, I'll stick to a single .playground file with different pages.

You can navigate between pages using markdown syntax:
[First Page](@first)
You can even go to one of your pages using its name. For a full markdown syntax go and visit Apple prerelease markdown reference page.

Enough talking, enough writing, let's convert my existing Swift toolbox into Swift2 and Xcode7 format. After trying the automatic Xcode Swift2 conversion (Go to: Edit -> Convert -> To Latest Swift Syntax), I gave up on that as it screwed up all my markdown and decided to migrate by hand. The code conversion was easy, the most tedious part was moving from .xcworkspace to one single .playground with multiple pages.

A few minutes later....
See my Swift playground in Xcode7 format.

Where's to go from here?

This year all WWDC videos are available to view to all developers, I encourage you to go through "What's new in Playground", a good video to enjoy with pop corn and coke.
Another great place to look at is Erica's blog, I haven't checked out her iBook on playground yet, I keep it for another great evening ;)

Last, do not forget to:
Practice, practice, practice.
Happy Swift2 playing!

Saturday, June 13, 2015

RivieraDEV is over... See you all next year!

2 days of sun, sea and sushi...
And great talks too!
The conference made by developers for developers with the theme "we're not only coders".

Here is some miscellaneous notes, mumblings and souvenirs from this edition.

Thursday starts with a Duchess France presentation made by Blandine: as you've seen we not only located in Paris. If you want to get in touch, participate in such event, drop us a line on Duchess Google group.

Some Design Pattern reloaded and polyglotism latter, out for lunch with great buffet and socca!

For the afternoon, I had to miss Julien's presentation on Vert.x, as I was the speaker next room :]
I've been pleased to see a full room for my Swift presentation. Sophia Antipolis might hold more iOS/OSX developers than I thought maybe time to start a cocoaheads meetup like Florian suggested. If you're interested tweet me. And for those of you who wants to explore Swift in more details, here is my slides with more links.

I also missed the sushi cooking workshop coz I went to Sebastien's talk on 24 mins to build a web app. Although I know the talk by heart (I work with Sebi on AeroGear project), I never miss one of his talk, it's always fun and my favorite part is the 24 mins of live coding. Today on the menu was.... ShushiApp of course.

Friday keynotes were very inspiring. From "what does innovation culture mean for Atlassian?" to "how your boost you professional karma" to end with "the code explained to my mum". I really liked Katia's talk, she's so good at story telling and the anecdote of the boomerang is very true.

This edition will always be a special souvenir for me as it was he first time I've been on the other side: not only an attendee, not only a speaker but this year I was proud to wear the yellow T-shirt as part of the RivieraDEV team.

What makes a good conference is not just the great talks, the quality of the food, the fun workshops, the affordable ticket... It's all about the people you meet. With a friendly atmosphere, it's easy to talk to any body. It's the place where you learn that Vert.x or Ceylon committers are also passionate sushi cookers. You can talk to Angular committer, meet the voice behind the cast coder, chat with one of the Duchess, see Nao, talk about kids or just bump into an ex-Amadeus co-workers.

Thanks for the thanks guys, and see you all next year.

Wednesday, June 10, 2015

Swift new super power

To me, the most sensational news that came out of this year WWDC is without any doubt Swift going Open Source next Fall. Swift (the compiler and standard library) running on Linux!

I've started on Swift since day one with AeroGear libraries, switching from ObjC to Swift is quite change of paradigm. In my Swift journey, I learnt some "super powers" I like to talk about when I do presentations on Swift. See my slides for more super-hero drawings ;)

Apple told us in 2014 when launching Swift: "It's Objective-C without the C" and it's going to be be its successor. In WWDC 2015, Craig Federighi said Objective-C was around for the last 30 years and Swift will be here for the next 20 years.

It turns out that Swift is not Objective-C at all, but for sure it's here to stay :]

Developers have understood it and it's no surprise to me that Swift is ranked 22nd at Redmonk indice with a fulgurant growth this year.

Why do I like Swift so much?

Its elegant syntax

Just for not having to deal with block syntax agin, I love you Swift.
Some have said Swift wasn't innovative, it got lot of family ressemblance from other langages. True, it takes advantage from the experience hard-won by many other languages said Chris Lattner in his blog.
I like the consistent reusable syntax: I override subscript operator like I write computed properties etc... Easy.

Playground is just fun

Easy too, to get started with Swift. Download the Swift guided tour playground. With some REPL and hands-on, it's fun. I love how you can build your own toolbox with Swift playgrounds: mixing explanations and code snippets. See my previous post about it and I'm happy to share my toolbox with you.

Open the way to new paradigms

Swift opens the way to new paradigms: with a statically type language, generics, functions, closures, we've got the tools to do more functional programming. Immutability is right into Swift's heart. With constants and variables, Swift let you define what is immutable. Besides, almost all types in Swift are value types, including arrays, dictionary, numbers, booleans, tuples, and enums. Classes are the exception rather than the rule. Functional fun is not just for JVM language.

Open Source as a new super power

For the last year, when giving presentations on Swift, I've been regularly asked: What are Apple plans on open sourcing Swift?
At last, we've got the answer!
There is no doubt that going Open Source will fuel Swift progression, it will also, most probably open new opportunities.

Future looks bright and as a Swift developer, we can contribute.