How do you guys practice in SWIFT for Mac OS?

Hi to everyone, it has been a while since I started learning programming for mac os x. Well, I have gone through some guides and tutorials. Pretty much learned the basics and wrote some apps, easy ones though:)

For the reason that I am new to the whole Apple system (I bought my first Mac and iPhone some 4 month ago haha yes that happens some times, especially when one is from a poor country you know), I am kind of confused.

The most important part of learning is to read others people code, right? Well, at least I did so when I was learning python. There are tones of open source projects and apps written in python or php but just a few in SWIFT and especially of those that are listed in the app store.

I spent the whole evening trying to find an example of how to write an app that will be established on the notification center and on the upper menu bar, but I didn’t, even a single example :/ well, probably I don’t know the right resources yet.

Could you please share your experience with me? How do you proceed after having the basics learned?


I have a simple idea for my first app, but I barely can find any examples of how to realise it, despite the fact that there are many similar apps in the app store.



Thank you guys =)

PiratePhil wrote:


The most important part of learning is to read others people code, right?

Hello PiratePhil,

No. The most important part of learning to code is writing the code. The code should perform the tasks you want and be readable and maintainable so that you can easily change it later. You will never learn to write code by reading it alone.

There are tones of open source projects and apps written in python or php but just a few in SWIFT and especially of those that are listed in the app store.

There are tons of open source projects in Swift. It is now one of the most popular languages in the world.


However, in spite of Apple's "everyone can code" campaign, and the "playground" approach, Apple's own engineers have long since lost control of the language. It is not a language suitable for learning. It is one of the most complicated computer languages ever made.


Software developers like to think of themselves as smart and like to show off how smart they are with clever puzzles. Although it may seem counter-intuitive, they often choose the most difficult way to solve a problem rather that the easiest. This is why langages get more popular as they get more complicated. No one wants to master an easy language or framework, because that doesn't impress anyone. That being said, there is nothing wrong with impressing people, especially when those people are paying good money, which is what all this is about - money.


But this is a game you just can jump into. You have to learn it. You've already missed the boat on Swift, I'm afraid. Since you are just starting out, there will always be someone with at least 5 more years of Swift experience than you have. What you have to do instead is learn how to program. I suggest a local college or university. It doesn't matter what language they use. It will probably be Windows and C# or maybe Javascript. It doesn't matter. You have to learn how to program and that is going to take years. At some point, you will get good enough at it so that you can identify whatever the hip new language is going to be next year and you can learn that, on your own, before most other (older) people have a chance. They will be too busy maintaining horribly complicated Swift apps running on old legacy iOS devices. Those old greybeards will be unemployable in any decent companies. If you play your cards just right, this should happen in about 6-8 years.


I can't tell you what that hip, future language will look like. It will almost certainly be dynamically typed. These things all go in cycles. When the new generation forgets the mistakes of the prior generations, they repeat them. Swift is currently repeating the static typing failure. If my prediction is correct, that will be good for you because dynamic languages are so much more pleasant to use. But the bottom line is that you have to learn how to program. The language you use, and the platform you develop for, are the most inconsequential parts of the problem. Your programming skills will still be with you when Swift is long dead.

You have examples of code in Apple's doc:

h ttps://developer.apple.com/library/content/navigation/index.html#topic=Sample+Code&section=Resource+Types


Where you can search for MacOS and for sample code.

One certainly doesn’t need to go to a uni to learn how to program… what a pity, I learnt English within 2 years and passed c2 in the uk without attending any courses. Yes, one has to practice a lot, that’s true. That’s why I asked about open source projects lol, to read the code and to get to know new tricks. I already have learnt how to program, I know python well enough to write telegram bots and easy server apps.

>One certainly doesn’t need to go to a uni to learn how to program


One would argue that statement is a simplification that ignores key elements such as exposure to coding discipline. Being self-taught is a two-edged sword. Don't allow impetus to displace opportunity. Don't let shortcuts become a way of life.

PiratePhil wrote:


One certainly doesn’t need to go to a uni to learn how to program

You would learn more at university than just programming. University doesn't teach programming skills. Any programming skills you learn in University should be just side effects of the process and won't be directly useful. The more skills you learn at University, the lower the value of the degree. Among the many truly valuable kinds of knowledge you will learn at university, such as pacing, planning, research, logic, and critical self-evaluation, is learning how to learn.


You posted a question in the Developer forums specifically asking about how to learn. You received an answer that has been documented and proven millions of times over. Yet you reject the answer you specifically asked for because of your experience learning English. Learning English is nothing at all like learning how to write software. And with all due respect, your English isn't very good. That's why I added that little bit about "critical self-evaluation". If you are confident that you already know all you need, then why did you even bother asking? Go forth and program!

My question was more about how to practice, not how to devote your life to the CS, not to mention that I am a student myself rn. For example I didn’t know that many of cocoa and swift programming books are available for free on iBooks, just got to know from a different discussion on this forum.


I have a friend which actually brought me into programming. He started in 2014 with web design and ever since has become a professional well paid web and iOS developer with his own studio. Thus it only depends on one’s abilities, isn’t it?


My English is not perfect omg of course it isn’t, I started 2 years ago from scratch and I didn’t learn it in an English speaking country. I just needed to pass the test. And it isn’t my second or even the third language lol. I made this example to show that one doesn’t need to go to a uni to learn something.

thx brof:) I also found free books on ibooks ...

How do you guys practice in SWIFT for Mac OS?
 
 
Q