Welcome, Guest. Please login or register.

Author Topic: The Swift Progamming Language...  (Read 7753 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 all replies
    • 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 bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #1 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 bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #2 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 bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #3 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 all replies
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #4 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 bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #5 on: June 04, 2014, 07:45:00 AM »
Quote from: persia;765662
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?


If you have a developer licence you can try it now.

If you don't hold its Pascal like syntax against it, you haven't used Pascal ;-)

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #6 on: June 04, 2014, 10:26:17 AM »
Now I've had a day or so to ruminate on the subject, I accept that swift offers advantages for application development.

But the biggest turn off is the lack of control I'm used to with Obj-c. I have a clear mental picture of what is happening on my CPU and how my memory structures are arranged. That's a feature of C and its derivatives. With Swift, one is kept away from the hardware. That was the intention and concept behind languages like obj-c in the first place...

I will probably learn to live with it :-(

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #7 on: June 04, 2014, 11:28:55 AM »
Quote from: Duce;765682
For the most part, you really won't have a choice.
I do have that fear, but since the runtime is still NeXTStep Obj-C isn't going anywhere soon... And by the time they do decide to cull it, I doubt I'll ether (be alive/ be developing apple apps/care) delete as appropriate :)

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #9 on: June 05, 2014, 06:24:17 PM »
Quote from: nicholas;765743
The Swift syntax is bloody awful. They could have at least kept semi-colons to make it more familiar to C/Obj-C programmers.

For anyone who isn't a registered Apple developer, XCode 6 and Yosemite are up on TPB.



To be fair you are still allowed to use semicolons as stamement terminators... My biggest gripes are;

The bizzare function definition syntax.
The odd variable/constant type placement (though, they didn't have much choice)
The method calling feels clunky (Obj-C looks weird but is actually rather elegant*)

Due to the unfamiliar nature of the syntax, as someone coming from C, class definitions appear almost random in swift.
My confident, and probably inaccurate, prediction for the future is that Swift will be picked up by beginners and a few hobbyists... But serious developers will stick to Obj-C/C++ since they know it and will almost certainly be working in other C derived languages on other platforms/projects... Swift will then be silently dropped and remembered as an interesting little experiment :)


* I think C++ gets it right as methods are sort of functions in a struct and Obj-C gets it right as methods are executed in response to a message. Both beautiful implementations of their object models!
« Last Edit: June 05, 2014, 08:29:55 PM by bloodline »
 

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #10 on: June 05, 2014, 07:00:27 PM »
Quote from: SysAdmin;765754
I'm wondering if Swift was developed to make Apps harder to port from iPad/iPhone to other platforms? It's up to the developer what they use of course but new developers that only learn and develop in Swift are locked into Apple's ecosystem right?
There hasn't been any announcement from Apple as to the open/closed nature of the compiler... But if the language is popular (which I doubt it will be), then the language could be added to the gcc suite if someone was so motivated. One would of course need GNUStep to make any real use of it...

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #11 on: June 05, 2014, 07:20:43 PM »
Quote from: Nlandas;765758
I read the discussion with interest but didn't reply as I haven't taken the time to look at the language. However, this was my question - is this planned as a cross platform development system? I didn't see that discussed. As such, I had the same thought as SysAdmin.

   Had anyone read further on the topic?

-Nyle


Chris Lattner (who designed Swift), says Apple haven't decided yet, also the language is still considered beta as the final compiler hasn't been released yet...

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #12 on: June 05, 2014, 10:24:47 PM »
As usual, Arstechnica have a nice review of Swift... I generally agree with their assessment too.

http://arstechnica.com/apple/2014/06/a-fast-look-at-swift-apples-new-programming-language/

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: The Swift Progamming Language...
« Reply #13 on: June 06, 2014, 08:19:14 PM »
Quote from: nyteschayde;765833
I agree 100% with you on Objective-C. I really do like it. And I've been struggling to build libobjc2.a for 68k Amigas. My biggest fear with Swift is that they'll eventually migrate off of Objective-C which would effectively kill the language. Bloodline, if you're interested in helping port libobjc2.a let me know; there are some things there that are over my head.

Back on topic, I think as long as both languages are supported I'm good with Swift and I basically feel the same as you, again. There is a weird sense of detachment involved when looking at and working with Swift. I kinda feel like I don't know exactly how to get there from here, sometimes.

I'm surprised there weren't many references to it's similarity to JavaScript as well. I'm probably in the minority here insofar as I also love JavaScript as a language, outside of the browser. There are some syntax bits I'd like to see in JS, and they are slowing appearing over time. I also like it in the browser, but only because I know it very well.


I too love JavaScript, and see no similarity with swift... Objective-J is better, actually!?! Why the F didn't apple develop objective-j instead of swift!?



Message sent by the way ;)