Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
As an Amazon Associate, MacRumors earns a commission from qualifying purchases made through links in this post.
If let is not the only mechanism available to handle optional types. Depending on the situation, you can use the guard syntax, optional chaining, the nil coalescing operator, and flatMap. These constructs give you a full range of methods for dealing with optional values. It is kind of the point of optionals that you have to deal with both the value and the lack of a value. I'm not sure how else this could be accomplished without checking.

And really, if let is not much worse than handling pointers to dynamically allocated memory in some other languages (C, C++). After you dynamically allocate memory and wish to use it in some way, you should check to make sure your pointer isn't null to avoid a crash. In Objective C, you should be doing:

if (!controller.navigationController) {
UINavicationController *nav = [[UINavigationController alloc] init];
}

[nav pushViewController:myViewController animated:YES];

Is that any better than binding a value with if let?


Ugh, that obj c syntax :eek:
 
You can develop a lot of crap in a few hours....

Thats all I read and all I'm going to say is take a look at my signature. If you think thats crap for less than 6 months, then thats fine

------------------------

PS. Read your full comment and partially agree on learning the real meat behind something but if you think the guys behind Facebook or Snapchat knew all the meat you are super wrong. Look at the initial page of Facebook, you will LOL.

Regarding learning design, I totally agree people in everything not just programming need to learn the meat behind something. But we didn't discuss the educational system. This whole discussion started when someone asked if the should learn swift first and I said DEFINITELY.

Because I rather learn how to take a selfie before learning what lens I used, get my drift? If you want to learn basic coding that will get you results, then start with Swift. I got into javascript, html5 and sever side scripts AFTER and I was like ah this sounds similar though a lot harder and complex.

Chronic has 50+ downloads and I'm already making money of it and its all thanks to the simplistic approach of Swift coupled with Xcode's storyboards, auto layout and size classes.
 
Last edited:
The Air Force tried this. Teaching newbie pilots in real planes designed for fighting. Result was a lot of dead pilots. They switched to buying slower planes specifically designed as trainers. Then later switched the successful (alive) trainees to faster more complex planes. Result was more and better (non-dead) fighter pilots.

So some programming languages should be designed specifically for teaching. Students should not be encouraged to use professional programming tools if they can't even think their way through something simpler in a teaching environment (code their way out of a paper bag using simple Basic or Python subsets) first.

Maybe Swift can be simplified, de-complexified and made safe enough. TBD.

We can argue about this all day and give examples of Air Force training. All I'm saying is that I was a newbie coder and had such a hard time with other languages including objective c. Swift came along and I was able to push to great ideas in less than 6 months, with a huge learning curve.

it would be great to see some of your work
 
Last edited:
It seems your understanding of people is lacking. I'm pretty sure firewood understood exactly what you were trying to say, and was in turn saying that a person "shouldn't" start learning with Swift before they grasp the fundamentals of programming.

Standard schools start off with teaching languages like "Logic", to allow the student to learn the right mindset for programming, because of the fact that most people cannot grasp the thinking necessary for programming. Your inability to grasp that concept, reflects your self-centeredness (inability to think beyond yourself). And in self-centered fashion you in turn warped his reply to make it seem like he was actually advocating your stance, because you are blinded by your self / experience. -- However, your warped thinking is abnormal and ironically makes you more inclined to learn programming. You are able to grasp the manipulation of programming constructs, because you regularly manipulate what you see. For you, learning in Swift creates opportunity, a "playground" of sorts for you to run free in manipulating constructs as you see fit.

That does not work for most people.

The sheer number of possibilities is far too overwhelming. Most people need limits in order to grasp foundations to build upon. This is why standard schools start off teaching fundamentals in languages the students will never truly program in (so that they will not develop language bias). Control items like a semi-colons encourage the thinking necessary catching ones mistakes with seemingly "small" things, with expressive languages this becomes much more daunting / overwhelming for most people. Most people learn by being given less. So even firewood's concise replies are more effective for most people, but ineffective for one such as you. Most people learn more with smaller bits of information to digest. That is basic psychology, and an inability to accept that reality just reflects your mind state. Your specific psychology makes this process backwards, because you are backwards, so you see things as backwards.

That being said, this reply is probably moot. Color me a masochist.

Not getting into that. Sorry. Do as you wish, I stated my experience.
 
Last edited:
Just a general statement:

I think if you are not at least interested in coding or have coding experience you should not be making a comment here. I don't think it makes sense to talk about Air Force irrelevant training techniques or the educational approach to teaching or even to provide someone with a phycological evaluation of self().
 
Last edited:
Too much to read but as stated I was a beginner and managed to achieve a lot with [X].

True for almost any successful programmer, but usually with a different X for different programmers, and with X including almost every programming language (Basic, Lisp, Java, Swift, Perl, Go, C, 6502 assembly, et.al.).

Thus such individual statements are nearly useless for comparing languages or helping someone to pick a more optimal first programming language.

Teachers exposed to large numbers of students, and who've tried many different coding environments, can at least gather success statistics from a large and possibly random or representative enough sample set to reach some scientifically reproducible hypothesis on the topic of teaching programming. That is still TBD for Swift, but I hope and expect the results to be better than with Java (currently very well tested as a college prep AP course in the U.S.)

I never did like Java as a teaching language, BUT that's just my personal opinion. Nothing to do with facts.
 
True for almost any successful programmer, but usually with a different X for different programmers, and with X including almost every programming language (Basic, Lisp, Java, Swift, Perl, Go, C, 6502 assembly, et.al.).

Thus such individual statements are nearly useless for comparing languages or helping someone to pick a more optimal first programming language.

Teachers exposed to large numbers of students, and who've tried many different coding environments, can at least gather success statistics from a large and possibly random or representative enough sample set to reach some scientifically reproducible hypothesis on the topic of teaching programming. That is still TBD for Swift, but I hope and expect the results to be better than with Java (currently very well tested as a college prep AP course in the U.S.)

I never did like Java as a teaching language, BUT that's just my personal opinion. Nothing to do with facts.

Again I'm not sure why you keep going back to teaching. This thread nor how we got here was about teaching. It was about learning a language. and I provided with you 2 apps I created as a FACT that with swift you can achieve a lot as a beginner. How is that statement nearly useless?

What have you provided for facts that any other language is better to learn except point that swift isn't? and why do we care so much about a programming language being teachable?
 
with [...] you can achieve a lot as a beginner. How is that statement nearly useless?

One would hope, as someone who lists stock trader in their signature, that you would discount the latest trading strategy success story (especially from a new trader) until you determine whether or not it was just due to lucky survival bias.

Same with programming language touts.
 
One would hope, as someone who lists stock trader in their signature, that you would discount the latest trading strategy success story (especially from a new trader) until you determine whether or not it was just due to lucky survival bias.

Same with programming language touts.

Haha I'm sorry but this is a joke. Its clever to comment out the most important part of that statement to make a point. Anyways as a trader I would not discount anything. If someone recommended a trading strategy I never used I wouldn't bother commenting or making a statement. If that person has wining trades using his strategy then bravo, i still wouldn't make a comment.

PS StockSwipe is being considered by UBS's innovations team. Not to shabby eh?
 
Its an interesting discussion we are getting into here :) Personally, I agree with acegreen that you don't need any 'toy languages' to teach programming to beginners as long as you do it in a structured way. The important thing is to teach them the concepts and abstractions. Here, I see Swift as a language that is particularly well suited for teaching, as you can use it to explain fairly simple concepts such as data and control flow as well more advanced topics like manual memory management, higher order typing etc. — and do all that in a practical setting. That makes Swift probably one of the most interesting languages for teaching. C is too difficult to get into, Haskell is just confusing, Python is way too idiosyncratic (it is quite easy to damage a person for life by teaching them python as their first language), Java is simply PITA. Swift can offer programming models of most above languages while being very accessible to beginners. Of course, the others in this thread are also correct that additional tools can be employed to aid the understanding of the abstractions (here I think of turing machines, the GOTO/WHILE languages, lambda calculus and so on).

Disclaimer: I actually teach programming at a university.
 
Disclaimer: I actually teach programming at a university.

Note that students at a university of any selectivity might be more adapt at picking up abstract concepts than the typical non-student adult or child, such as, say a typical reader of macrumors.

But even in selective university settings, I've encountered bright (in other subject areas) students who failed intro-to-programming (or got a passing grade only by extreme hand-holding).

Whereas I once helped a school teacher set up an Apple II+ to teach AppleSoft Basic to the kids... which worked out better than either of us expected. Thus my bias towards learning (at first) simple programming languages with an embarrassingly low level of structure and abstraction.
 
Its an interesting discussion we are getting into here :) Personally, I agree with acegreen that you don't need any 'toy languages' to teach programming to beginners as long as you do it in a structured way. The important thing is to teach them the concepts and abstractions. Here, I see Swift as a language that is particularly well suited for teaching, as you can use it to explain fairly simple concepts such as data and control flow as well more advanced topics like manual memory management, higher order typing etc. — and do all that in a practical setting. That makes Swift probably one of the most interesting languages for teaching. C is too difficult to get into, Haskell is just confusing, Python is way too idiosyncratic (it is quite easy to damage a person for life by teaching them python as their first language), Java is simply PITA. Swift can offer programming models of most above languages while being very accessible to beginners. Of course, the others in this thread are also correct that additional tools can be employed to aid the understanding of the abstractions (here I think of turing machines, the GOTO/WHILE languages, lambda calculus and so on).

Disclaimer: I actually teach programming at a university.

If C is too difficult to go into, then they probably shouldn't be learning programming in first place. It has so many concept and why things works the way it is. Swift on the other hand I honestly think its a pile of crap from multiple different language into one, in rush. It doesn't really give people the concept of memory management and pointer access...etc

PS: I have been doing programming since BASIC
 
If C is too difficult to go into, then they probably shouldn't be learning programming in first place.

PS: I have been doing programming since BASIC

And that explains why you think people should know C... For most cases in which a person wants to get into Apple Development, C is useless.
 
If C is too difficult to go into, then they probably shouldn't be learning programming in first place.

Why not? Tons of kids have had lots of fun just learning a bit of Basic, Logo or Squeak (et.al.)

With programming, often the only way to find out if it's too difficult for someone is for them to try it.

...I have been doing programming since BASIC

And you are a prime example. Everyone has to start somewhere.
 
If C is too difficult to go into, then they probably shouldn't be learning programming in first place.

I was specifically talking about beginners. The problem with C is that you need to do a lot of things manually, where advanced programming languages do the boring bookkeeping for you.

It has so many concept and why things works the way it is.

I can't follow you here. C works so well simply just because it does not have many concepts (e.g. its type system is non-basically existent). It is a very low level language. I believe that knowing C is still very important for a well-rounded programmer (and I use it regularly in my work), but its simply not the right tool for most common tasks.

Swift on the other hand I honestly think its a pile of crap from multiple different language into one, in rush. It doesn't really give people the concept of memory management and pointer access...etc

Swift gives you full access to pointers and pointer arithmetics — if you need it. It also fully and seamlessly interoperates with C. As to memory management and pointers... why would you even need them in modern programming? Automatic memory management works so much better for virtually every task!

PS: I have been doing programming since BASIC

Good for you!
 
FYI. I forgot to mention an app @swifty_app

For anyone interested in learning Swift check it out. I didn't know about it when I learnt Swift and already had my apps but I'm going through it as I write this and definitely learning a thing or two.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.