Goodbye ++ and -- operator and how to contribute to Swift 3.0

Hi CodeBugs,

As Swift is now open-source the code bug follows swift mailing lists, so here is a piece of information you may have missed:

Swift 3.0 is coming in the fall of 2016. The nice thing is that we know what is coming and can be prepared.

One of the accepted changes is removing the ++ and -- operators from the language. Here is the pull request to Remove the ++ and -- operators. The best thing to do is to avoid having any ++ and -- operators. If we don't do this, the Xcode Swift migrator will do this for us.

But hey, what about all these for loops we have:

for (var i = 0; i < 5; i++) {  
    // code
}

Yeah.. say goodbye to them too. Here is the merged Pull request Proposal to remove C-Style For-Loops from Swift 3.0

If you are like me you're wondering what will you do without C-style for loops. But I quickly realised that I haven't used this kind of for loop in a long time and .map and for in has reduced my need for it.

The Code Bug himself took part in one discussion, for re-instating self as mandatory for iVar access. I argued that implicit self is dangerous:

Some teams use underscores for their iVars  
which is very unfortunate. Myself, I use self  
whenever possible to be explicit. I'd like the  
language to force us to be clear." -- Dan,  
robear18@gmail.com  

If it gets merged, you should also start using "self." for accessing iVars. This to avoid another code migration when and if this change happens.

PS: Given how "open" Apple is about future plans, it's wonderful that the Swift team managed to open source the language. Congratulations to the Swift team for the effort.

PPS: If you are curious about the future of Swift, there is the swift-evolution mailing list where you can discuss and debate things. Follow the GitHub page updates, and look at Pull Requests.

The Code Bug

A passionate iOS developer. Looking to radically improve the way we all develop software.

Amsterdam