It's over, Apple reinvented programming

It's over, Apple reinvented programming.

Other urls found in this thread:

youtube.com/watch?v=5MJLi5_dyn0
pbm.com/~lindahl/real.programmers.html
twitter.com/AnonBabble

Again.

When will they finally come up with a computer that is programmable in normal human language. I'm tired of all these hyped nonsense reinventing the wheel every 5 years...

>applefags
>bananas
>that freudian slip

Swift is not considered a business language yet. No one take it seriously apart from some Cocoapod hipsters.

Swift is a pain to maintain as Apple can, in any moment, change the grammar unnecessarily (as they did with swift 1.1 and 1.2)

Swift is not enough for serious work as core stuff in iOS is only available in Objective-C.

Swift was created to attract children and women to iOS. Most of its features are gimmicks that increases code length.

Swift code slows down XCode to unacceptable levels in big enough projects. Auto-completion or access to class properties may not work at all for several seconds.

Swift has no reason to exist. Objective-C 4 life.

>you don't even need to type semi-colons
are they implying that this is a good thing?

Gonna use this post thanks fãm

Who is this cum drum? Nice taste in grills

>Swift was created to attract children and women to iOS
Kek

>Inferred types make code [...] less prone to mistakes

Here's a javascript equivalent:
Object.defineProperty(String.prototype, "banana", {
get: function () {
var shortName = this.substr(1);
return this + " " + this + " Bo B" + shortName + " Banana Fana Fo F" + shortName;
}
});

>Swift code slows down XCode to unacceptable levels in big enough projects. Auto-completion or access to class properties may not work at all for several seconds.
So C++ in Visual Studio?

> ;
> ;
> ;
hahahahahahahahahahahahahahahahahahahahahahahahaa

Although semi colons are not required in Javascript, anybody who doesn't use them should be shot.

> java
> script
wew lad

>"It's over," "Apple" "reinvented" "programming".

You mean, some fag employed by Apple (that was redundant) made a slightly less painful syntax compiler interface to Apples standard libraries than ObjC and Apple jumped on the bandwagon.

Only recently they have released an equivalent to .Net Core, but even .Net Core can get in line itself behind Go, D, Zig, Crystal, BugVM, Kotlin, Ceylon, Scala, Vala and a number of other faggot meme languages, which partially are even better, appeal more to specific platforms and more mature.

looks like shit, just get c++ and trim it down a bit

>\/\(self)\\___some more bullshit__//(self)
>cleaner code less prone to mistakes
ayy lamao

> write equivalent code in C++
> 300 lines of code
> ;;;;;;;;;
> compiles
> breaks with no error message
wew lad

What's wrong with ";"s?

Are programmers so lazy these days they can't even bother to press a single key? I miss those days when programming was made by actual scientists and enthusiasts, not pseudo-nerd hipsters.

I still use Pascal, and my software can be compiled to run in any platform I'd like, including Mac and iOS. Also Android, Linux, Windows, bretty much everything out there actually. Also no ridiculous functional syntax and no SJWs. Feels Goodman.

Looks like a fucked up version of Javascript

var banana : String

Why not just
var banana for implicit declaration.
String banana for explicit declaration
?

I like Swift.

I think she needs to see a skin doctor. Damn that's bad...

>knowing C
>you
wew fampie

Never. Mathematically not possible. Too many possible programs vs. Number of English descriptions

>even though they aren't required, people should use them anyway.

makes perfect sense.

However, They are required though. but any standard compliant engine auto inserts them.

The real problem with that example is that stupid object shit instead of just making a prototype.

what isn't wrong with semicolons?

if anything they encourage people to break formatting conventions.
forcing them out of the language requires people to comply with the parser's style conventions.

And why can't you just use a function for this?

youtube.com/watch?v=5MJLi5_dyn0
You uncultured heathen

c++
#include
#include

std::string operator""banana(const char a[], size_t z) {
std::string s{a,z};
return s + " " + s + " Bo B" + s.substr(1)
+ " Banana Fana Fo F" + s.substr(1);
}

int main() {
auto bananaName = "Jimmy"banana;
std::cout

Good points, but Xcode has no trouble being a load of shit by itself. give me AppCode any day

>dropFirst(1)
Why the fuck this function takes arg? First means just the first element of array

Apple kept on using this ugly Objective C language far too long and now (after decades) relized it's shit and needs replacement.

So they invented a maymay language which takes the most common elements from current languages..

>well, everybody has lambdas, let's include them!

Nothing new under the sun, just a less shitty way to code for Apple. And of course Swift programmers are bound to stay at apple, because nobody else will use Swift..

>THE RIDE NEVER ENDS

It can also mean "the first few" (as "the last few"), silly.

You know you've fucked up as a language designer
when even C++ is more readable than OP's mess

>strong vars, weak vars
>strong vars, weak vars
>strong vars, weak vars

Y tho?

Let me just say I understand this code but I hate it.

>var shortName = this.substr(1);
I prefer this over
>let shortName = String(characters.dropFirst(1))
Also, if types are inferred why do you even need to specify String output, or even use characters to drop the first character? Sounds to me like Swift is a frankenstein abomination.

>forcing them out of the language requires people to comply with the parser's style conventions.
And if they don't then it may just compile fine and good luck finding the error when it comes to debugging!

is extending a class some sort of new hip feature now

Genius! We'll call it "AppleScript". You'll be able to tell things what to do.

>Swift is not enough for serious work as core stuff in iOS is only available in Objective-C

surely you don't believe that not having NSInvocation is missing "core stuff in iOS".

>supertype string
nigga, even js can do that shit with crappy prototypes

>fucking normies getting cucked by applel and enjoying it
kek

> getting cucked by applel
b-but swift is open source, it respects m-muh freedoms!

>Pascal
pbm.com/~lindahl/real.programmers.html

> Although semi colons are not required in Javascript, anybody who doesn't use them should be shot.

Are you living under the rock? No-semicolon is the standard nowadays

Wow looks so much nicer and easier to use than any other langauge. Apple might just be the greatest company ever to exist!

> javascript
> web development
I literally puked

>using IDEs at all

Javascript isn't open source?

I thought Swift was supposed to be compiled to ordinary object files. If you change the structure of the String type, how will independent compilation units know about that?

they dont

>Stephen Stephen Bo Btephen Banana Fana Fo Ftephen

Such marvelously round breasts.

Like bags of sand

How do strings not break across compilation units, in that case, though?

cuz ur a fag xD

Actually, it's proprietary shit.

>not coding in machine code

>It's over, Apple reinvented programming.
Are you fucking serious? I finally decided to start learning C, ordered some books online, they literally arrived this week.

Welp, into the recycling they go!

You can already do
var banana = "hey"

and it will infer the type (String)

But
String banana

makes no sense—is it mutable? immutable? (var vs let)

that's not even the same thing, you are just overloading the "" operator, not actually defining a new function in std::string

you should leave this website then, chum :^)

Swift is a nightmare, I don't understand how anyone would ever want to use it. I hate it with a passion and I pray that it will never leave it's niche as iOS app language.
XCode sucks compared to IDEs of other langues.

>langues
vous aimez les baguette? hon hon

And in C#, though you can't create extension properties.
static class Extension {
public static string Banana(this string @this) {
var shortName = @this.Substring(1);
return @this + " " + @this + " Bo B" + shortName + " Banana Fana Fo F" + shortName;
}
}

xcode != swift, not only you can use other editors and ides to use swift, xcode isn't even available outside of osx

> not controlling electricity with your penis

'use strict';
function banana(name) {
let shortName = name.substr(1);
return `${name} ${name} Bo B${shortName} Banana Fana Fo F${shortName}`;
}

console.log(banana("Jimmy"));
I never knew why people wanted to complicate things?

Objective C is so horrible that this shit is actually an improvement? Lel.

Bullshit. Minifiers need the semicolons to collapse whitespace and concatenate files together. You do use a minifier right?

Swift 1.1 to 1.2 is easy, it came with an automated tool to convert the syntax

Just like go

IBM have already committed to Swift for their http server backend system

I already used swift only to make iOS/OS X apps and made a Linux Swift http REST server

Objective-C is deprecated

Swift is based, functional aspects are good

But I'd rather use F#

However swift is better than say Java

(defun banana (name)
(let ((shortname (substring name 1)))
(concat name " " name " Bo B" shortname " Banana Fana Fo F" shortname)))

(defvar bananaName (banana "Jimmy"))

>what is reference counting

do you even know what prototype inheritance is?

((nice (post)))

If you can't express it in English, you can't express it in a programming language either, fucktard.

Fun stuff:

Try concatenating more than a couple of arrays together in Swift. The compiler freaks the fuck out. According to StackOverflow it has to do with the fact that the + operator is overloaded as fuck.

It truly is a garbage language, but at least it's not Objective C.

Much more legible than the OP example.

I see 2 problems in this thread. Number 1 is the people posting functions, when the feature showcased in OP's pic is extending an existing class with a new method.

The second problem is that the example breaks down if you give it a name like 'Charlie', or even 'Anna' FFS! Ideally you want to strip leading consonants from the name.

In the interest of being a jerk, I'm going to do this in Perl 6. Suck it, nerds!

use MONKEY-TYPING;

augment class Str {
method banana($name:) {
my $short-name = $name.lc.subst(/« +/, '');
"$name $name Bo B$short-name Banana Fana Fo F$short-name";
}
}

say 'Anna'.banana; # Anna Anna Bo Banna Banana Fana Fo Fanna
say 'Jimmy'.banana; # Jimmy Jimmy Bo Bimmy Banana Fana Fo Fimmy
say 'Charlie'.banana; # Charlie Charlie Bo Barlie Banana Fana Fo Farlie


Yep, in Perl 6 if you want to augment a class, you have to enable the 'MONKEY-TYPING' pragma. It's a hilarious reminder you're being a dick and fucking with base classes. Instead you should declare a new class that inherits from `Str`, or mix in a Role as needed.

role Banana {
method banana { ... }
}
my $name = 'Jimmy' does Banana;

damn, that looks hot

I think he was more referring to the fact that too many words in all spoken languages have legitimate double meanings which are usable in speech. Some of these meanings cannot be deciphered if a computer is given a single line to read from.

"Jimmy was buffing his banana"
"Moot is a faggot"
"That is a school of fish"

Sure you can say, the computer should be able to infer what the meaning is due to common usage, but what about edge cases where you have users who literally want a school building full of aquatic life?

Spoken like a true troglodyte who can't into programming.

Well he said "mathematically", so I assumed he was referring to the fact that English sentences are countable, while programs are not. Missing the fact that you cannot express every program in a programming language.

>The real problem with that example is that stupid object shit instead of just making a prototype.
How would you do something like
console.log("Jimmy".banana)
Without the "stupid object shit", though?

i hope you kill yourself very rapidly.

Whats wrong with semicolons?

String.prototype.banana = (name) => {
let shortName = name.substr(1);
return `${name} ${name} Bo B${shortName} Banana Fana Fo F${shortName}`;
}
"Jimmy".banana()

I never understood why people want to complicate things

Are you retarded? Programs are countable. It's the first thing you learn in CS and the basis of all complexity theory.

Are you blind? There are no parentheses in the OP's picture.

Literally nothing but some fags get butthurt when they miss one and can't find it.

Rust
trait Banana {
fn banana(&self) -> String;
}

impl String {
format!("{0} {0} Bo B{1} Banana Fana Fo F{1}", &self, &self[1..])
}
}

fn main() {
let bananaName = "Jimmy".banana();
println!("{}", bananaName); //prints: Jimmy Jimmy Bo Bimmy Banana Fana Fo Fimmy
}

>why do you even need to specify String output
Inference with subclassing is undecidable without hints at the function level. There are very complex studies on trying to make that a non-issue, but it's ultimately easier to require types at the function level. Beside, it's what people would do even with full inference as with haskell, because it's the right mix between convenience and clarity. If you've ever written in dynamic languages, you'll understand why people like to give at least that much information.

>or even use characters to drop the first character?
It is either a class or module spec, i.e. it provides a utility (dropFirst). Probably, "hello".dropFirst(1) would also work (I don't know shit about swift), but here it's showcasing automatic currying. shortName is a function.

>Sounds to me like Swift is a frankenstein abomination.
Its syntax certainly is.

The only good language apple ever invented was dylan, and they just threw it in the trash in favor of unusable dogshit like objective-c and swift.

Shit, said programs and actually meant functions. Sorry, CS was a while ago.

Here's a Haskell equivalent

banana :: String -> String
banana name = [i|#{name} #{name} Bo B#{shortName} Banana Fana Fo F#{shortName}]
where shortName = drop 1 name

bananaName = banana "Jimmy"

Fucking disgusting bitch

I'm using swift for an ios app project but i would never use it anywhere else. These fags that think they can use swift outside of ios dev are even bigger faggots than the nodejs fags