Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. ×

Comment Re:What do you think of /. (Score 1) 338

Our shop has done several major projects in Swift, and (despite the pain thus far in migrating from, say, 2.2 to 3,0) will continue to recommend to our clients that all new development be done in Swift.

One of the major talking points that seems to be holding up is that Swift code seems to have about half to a third the bugs found in a typical Obj-C program.

The one thing I miss from Obj-C is a good built-in implementation of KVO for Swift object and structs.

Comment Re:Why are strings passed by value? (Score 5, Informative) 338

In Swift arrays, dictionaries and strings are structures with value-semantics. As to why, well, to quote the Swift language reference manual: "One of the primary reasons to choose value types over reference types is the ability to more easily reason about your code. If you always get a unique, copied instance, you can trust that no other part of your app is changing the data under the covers. "

Behind the scenes, however, structures (including strings) are passed by pointer. Swift then uses copy on write so that the objects are completely copied only if and when the program attempts to change a value in them.

As such, a string parameter to a function has value semantics, but it behaves as if it's an immutable pass-by-reference object from a performance standpoint. Kind of the best of both worlds.

An exception would be a parameter specified as inout. (e.g. func f(s:inout String) )

Comment Re: I wish (Score 3, Informative) 71

Please reread the above comments for comprehension this time. We're on track to having nearly HALF the country out of work in the next couple of decades. And as I pointed out below, it doesn't matter how inexpensive things become if you have no job (and as such no income) with which to buy them.

And given current trends, it's looking as if more and more of the wealth generated by our increased productivity is going to be locked up by the top 1%, with a good chance that the rest of us is going to be living in a Matt Damon/Elysium-style world, begging for scraps and choking on our own pollution.

So tell me, oh wise one, given our current corporate, economic and political structure, do you see all of that wealth and productivity being distributed to those that need it? Or will the rich keep on getting richer while more and more people and regions lose work, lose income, and lose hope?

The benefits of automation and productivity and renewable energy can be used to benefit us all... or a very, very, very few.

Hence my comment regarding tectonic upheavals. Without good planning, things in our country could get very dramatic... and extremely messy, with no guarantees that the future we get is the one best for us all.

Slashdot Top Deals

"You can have my Unix system when you pry it from my cold, dead fingers." -- Cal Keegan

Working...