Welcome, Guest. Please login or register.

Author Topic: The Swift Progamming Language...  (Read 7647 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
The Swift Progamming Language...
« on: June 03, 2014, 08:59:57 AM »
I want some feedback from proper programmers... Is Apple's new Swift programming language really any good?

I've just spent the night reading the developer guide and I can't get over the horrible syntax...

Your thoughts please!! :-(

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: The Swift Progamming Language...
« Reply #1 on: June 03, 2014, 09:10:10 AM »
Quote from: bloodline;765619
I want some feedback from proper programmers... Is Apple's new Swift programming language really any good?

I've just spent the night reading the developer guide and I can't get over the horrible syntax...

Your thoughts please!! :-(


Not looked at it yet but now you can understand how I feel looking at seeing smalltalk constructs in C...
int p; // A
 

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #2 on: June 03, 2014, 09:23:32 AM »
Quote from: Karlos;765620
Not looked at it yet but now you can understand how I feel looking at seeing smalltalk constructs in C...

But the smalltak syntax added to C to make obj-c is tiny. Essentially a couple of keywords and a message calling construct. The rest is just lovely lovely C...

Swift is unreadable... I know it's probably just "shock of the new", but I can't understand why they didn't make the language more beautiful to read?

I can spend hours reading over C/C++ and Obj-C without feeling like I want to be sick... Try that with swift, it feels very "clunky". But I don't have a degree in computer science so maybe I'm wrong!?

-edit- I think also, swift feels too separate from the hardware for me. I don't like not knowing what's going on. The nice thing about Obj-C is that there is very little hidden away.
« Last Edit: June 03, 2014, 09:59:02 AM by bloodline »
 

Offline RedskullDC

  • Full Member
  • ***
  • Join Date: Sep 2003
  • Posts: 136
    • Show only replies by RedskullDC
Re: The Swift Progamming Language...
« Reply #3 on: June 03, 2014, 10:02:24 AM »
Hi Bloodline, et al.

Just had a bit of a thumb through the swift guide.
Here: https://itunes.apple.com/us/book/swift-programming-language/id881256329
for anyone interested. Free download.

Initial thoughts:

1. Type Safety vs. Type Inference

I don't think you can have it both ways.
Inference makes it easier on the programmer, but also allows subtle bugs to creep in.
Did some work recently in RUBY where this became an issue.

Or maybe I have just spent too long programming in VHDL :)

2. Tuples
Seems like a nice idea for functions to be able to return compound values without the overhead of creating a class definition.

3. Property Observers
Could be handy to trigger a function when a property is changed.
Presumably this will work across threads?
Guide doesn't go into that level of detail.

4. Extensions
"Extend types for which you do not have access to the original source code"
Can you say security hole?
I couldn't see any way of preventing Extensions?
(It wasn't clear to me whether the 'final' attribute blocks this functionality?)

5. Generics
Good. Enough said.

6. Custom Operators
Good. Enough said.

7. No Pointers?
Makes hardware bashing rather difficult.
It may be possible to import modules/functions written in other languages which do though?
The "import (import kind)" isn't very clear on this

Seems to have borrowed a few ideas from other languages, and renamed them for no good reason:

Closures <=> Lambdas (Java,Ruby etc.)

I agree, the Obj-C syntax can be rather quirky.

---

Will have to wait and see the release version before passing final judgement...

Cheers,
Red
Redskull @ Digital Corruption
A500, 4000/060-75MHz
WinUAE on Windows7-X64Ult
Minimig DE1
-------------------------
 

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #4 on: June 03, 2014, 10:08:17 AM »
I suppose I should say something positive...

It's a lot nicer than Python...
It's not Java.

-edit- RedscullDC, I've never used generics so have no idea what they are, or what I would use them for. But the syntax looks really awkward :-/
« Last Edit: June 03, 2014, 10:12:46 AM by bloodline »
 

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1149
    • Show only replies by Thorham
Re: The Swift Progamming Language...
« Reply #5 on: June 03, 2014, 11:48:04 AM »
Oh joy, yet another programming language. Does it do anything interesting?
 

Offline commodorejohn

  • Hero Member
  • *****
  • Join Date: Mar 2010
  • Posts: 3165
    • Show only replies by commodorejohn
    • http://www.commodorejohn.com
Re: The Swift Progamming Language...
« Reply #6 on: June 03, 2014, 12:27:09 PM »
It's Objective-Pascal. Did the world really need this? Whatever, I'm never going to do any iOS development anyway.
Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
Synthesizers: Roland JX-10/MT-32/D-10, Oberheim Matrix-6, Yamaha DX7/FB-01, Korg MS-20 Mini, Ensoniq Mirage/SQ-80, Sequential Circuits Prophet-600, Hohner String Performer

"\'Legacy code\' often differs from its suggested alternative by actually working and scaling." - Bjarne Stroustrup
 

Offline zombi

  • Full Member
  • ***
  • Join Date: Nov 2005
  • Posts: 123
    • Show only replies by zombi
    • http://www.webdefteri.com
Re: The Swift Progamming Language...
« Reply #7 on: June 03, 2014, 12:36:12 PM »
As an unexperianced hobby programmer i really love the playgound.
Only Amiga Makes It Possible!
 

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1149
    • Show only replies by Thorham
Re: The Swift Progamming Language...
« Reply #8 on: June 03, 2014, 01:21:04 PM »
Quote from: commodorejohn;765630
Did the world really need this?
Of course not :lol:
 

Offline jj

  • Lifetime Member
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4051
  • Country: wales
  • Thanked: 2 times
  • Gender: Male
    • Show only replies by jj
Re: The Swift Progamming Language...
« Reply #9 on: June 03, 2014, 06:54:35 PM »
Quote from: bloodline;765626
I suppose I should say something positive...

It's a lot nicer than Python...
It's not Java.

-edit- RedscullDC, I've never used generics so have no idea what they are, or what I would use them for. But the syntax looks really awkward :-/

I really like Java, what are your reasons for not liking it ?  i but I agree Python is horrible :)

generics are pretty useful, does obj-c not have them
“We don't stop playing because we grow old; we grow old because we stop playing.” - George Bernard Shaw

Xbox Live: S0ulA55a551n2
 
Registered MorphsOS 3.13 user on Powerbook G4 15"
 

Offline persia

  • Hero Member
  • *****
  • Join Date: Sep 2006
  • Posts: 3753
    • Show only replies by persia
Re: The Swift Progamming Language...
« Reply #10 on: June 03, 2014, 11:12:57 PM »
My Objective C programming was never great, I can get by, but....

I'm interested in giving Swift a go.  Apple obviously didn't create the language from scratch, does anyone know the base language Apple used?
[SIGPIC][/SIGPIC]

What we\'re witnessing is the sad, lonely crowing of that last, doomed cock.
 

Offline SysAdmin

  • News posting Auto Agent
  • Hero Member
  • *****
  • Join Date: Aug 2009
  • Posts: 1393
    • Show only replies by SysAdmin
    • http://www.a-eon.com
Re: The Swift Progamming Language...
« Reply #11 on: June 03, 2014, 11:42:25 PM »
Quote from: persia;765656
My Objective C programming was never great, I can get by, but....

I'm interested in giving Swift a go.  Apple obviously didn't create the language from scratch, does anyone know the base language Apple used?


Unicorn tear drops mixed with pixie dust then wait 24 hours, Swift is born!
Posts on this account before August 4th, 2012 don\'t belong to me.
 

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #12 on: June 04, 2014, 01:37:18 AM »
Quote from: JJ;765646
I really like Java, what are your reasons for not liking it ?


I freely admit, my dislike of Java is irrational, I'm sure it's a fine language now. I have several friends who earn a living through it... But try developing anything, and it feels like you are trying to code wearing boxing gloves. I don't feel connected to the coding experience.

Quote

  i but I agree Python is horrible :)


Python feels dated... Compared to C... For me, everything feels dated compared to C (and C derived languages, including Jave).

Quote

generics are pretty useful, does obj-c not have them


Hmmm, no... I suppose in Obj-c everything is an object, so you don't worry about types on high level components.  :-/

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #13 on: June 04, 2014, 01:42:02 AM »
Quote from: persia;765656
My Objective C programming was never great, I can get by, but....

I'm interested in giving Swift a go.  Apple obviously didn't create the language from scratch, does anyone know the base language Apple used?


It looks like they did create it from scratch. It's a weird combination of C# paradigms on pascal syntax with all the features of C we couldn't live without, running on the obj-c runtime....

I'm sure I will get used to it... But it is a truly ghastly looking language. Why they didn't just clean up C, I dint know?!

Offline persia

  • Hero Member
  • *****
  • Join Date: Sep 2006
  • Posts: 3753
    • Show only replies by persia
Re: The Swift Progamming Language...
« Reply #14 on: June 04, 2014, 01:42:29 AM »
From a quick perusal of the ebook the language reminds me of Pascal. But I'm not going to hold that against it.  I want to take it for a spin, when will it be available?
[SIGPIC][/SIGPIC]

What we\'re witnessing is the sad, lonely crowing of that last, doomed cock.