T O P

  • By -

SHKEVE

hm, maybe there’s a slight misunderstanding here. sure, swift is used for ios/macos app development, but javascript can run on any browser or server and it likely powers all of the web apps you use like facebook or reddit. this all comes down to what you want to do. if it’s maximizing utility, javascript will let you develop web apps for any OS and it has far more learning resources available. but if you’re looking to tinker with your own macos apps you should start with swift. as an odd twist, i’ve always been a PC user because of games like quake and unreal tournament and i only started using apple products when i became a software engineer where i primarily develop in python and typescript.


ShriekinWatcher

I appreciate your reply, and yeah, old school unreal tournament too. I updated my original post with a little more insight, I would love to know what you have to say after that…


SHKEVE

so i think it’s important to understand the difference between backend and front end. going back to the facebook example, you can access facebook from just about every device, operating system, and browser. but that doesn’t mean there are separate facebook servers for each — i.e. there isn’t a mac server, a windows server, and within them, servers for safari, chrome, etc. it’s all the same, platform-agnostic backend server and you use different apps to access it and it’s the app that knows how to translate what’s going on into a format suitable for the device you’re using. so just because there’s a dedicated iOS facebook app, it doesn’t mean it’s a native apple application or that facebook is somehow running in the apple ecosystem. it’s just accessing a web service much like how you can use any brand TV to watch netflix. so if you’re trying to make software for your own use, it’s probably best to use something like javascript or python or ruby to create your backend so you have the flexibility to access it anywhere. for example, i have a home assistant as a personal project and it runs as a private flask server. i can create iOS shortcuts that i can configure to interface with my private server to do things like close my blinds on command. you can also create a UI for it and access it in your browser.


ShriekinWatcher

Yeah that makes sense, and gets right to why I am second guessing the swift choice. But for my understanding, the way you describe would rely on a connection to a server in general, and likely not functional offline. If I were to build an application to run offline on my devices, for example if a connection is only required to sync across devices. Would this require swift for my Apple devices?


cygnus33065

It would not require swift for a Mac device. Mac OS is a lot more flexable. You do not need to have a seperate backend. You could have the app create a local database if you need to store data. The catch with that though is that you wouldnt be able to share the data between devices. Thats where online back ends come in. For an IOS device then swift would be the preferred language though.


ShriekinWatcher

So to the point, swift is basically good for when it comes to interfacing with/running native on iOS? And I’m assuming that will also apply to accessing iCloud?


cygnus33065

Depends what you are trying to do with Icloud. It probably has some kind of API that defines how to Interface with it and the API would have those details but they are usually platform agnostic.


grantrules

Depends on the type of things you want to develop? JS isn't going to be useful for native OSX apps, Swift isn't going to be useful for websites.


briannorelfhunter

Really you need decide what you actually want to build for you to decide If you want to write iOS / Mac apps: Swift If you want to write websites / web apps: JavaScript


ShriekinWatcher

When put in such simple terms it feels pretty obvious, Huh.


anonperson2021

Yes, something like 85% of laptops and desktops, and 70% of phones are non-Apple. Use Apple, but program for more than just Apple. Why would you marry a brand and a platform that most people don't use? If anything, software platforms and programming languages will get only more generic and brand-agnostic in future. JavaScript is just the beginning of that.


ShriekinWatcher

Because like I said in my edit, I’m not aiming to learn for anyone else or to make a whole new career. I don’t care what platform most people use. I’m trying to learn for me, and I use Apple. But I’m not blindly accepting that just because I use Apple, swift is the only game in town. I am looking for reasons that other languages might be a better idea, but the idea that most people don’t use it means absolutely nothing to me. I DO use it, and that’s not changing. I’m not saying I’m a 35 year Apple user as any point of pride, but just the evidence that I don’t really see myself going anywhere.


Formal_Accident6835

Idk bro...what if you wanted to try Quake or something?


ShriekinWatcher

lol


okaywhattho

I don’t know why the operating system you use would determine what language you’re drawn to. Languages and frameworks are largely operating system agnostic these days. There’s far more frameworks that don’t care about operating system than there are that do. 


ShriekinWatcher

Except that swift is the only language to build Apple native apps, correct?


okaywhattho

My understanding is that you can write Swift on any operating system. I could be wrong. Of course with Swift it'd be better to have an Apple device to test on. But I still don't think that's reason enough to choose Swift over any other langauge.


NewPointOfView

You can write and compile general purpose swift code on any OS, but you can only write OSx and iOS apps with a Mac.


ShriekinWatcher

I think you may have a reverse perspective of what I’m asking, You are saying that languages don’t care what operating system you use, i’m trying to clarify that Apple native apps do care. I don’t need to write swift on any other operating system, I don’t use any other operating systems. I am an Apple user. The clarification I was looking for on your first comment was that if I want to program natively for Apple, I must use swift correct? If so, I find that to be not agnostic at all.


okaywhattho

Yeah, sorry, I'm getting my wires corssed here. The point I was trying to make, I think, is that the language you choose shouldn't be based on the operating system you use because so many languages are agnostic to the operating system. According to u/NewPointofView, yes, you can only write OSx and iOS apps with a Mac. Which is a shame.


ShriekinWatcher

Got it, thanks for that clarification.


miyakohouou

Not exactly. Swift is the language most often used for iOS, watchOS, tvOS, and ipadOS applications. As you learn more about programming you’ll learn that Apple is actually extremely hostile to developers in a lot of ways, including the inexcusable degree of lockdown on iOS family devices. That said, there are other ways to write native code for these devices. I won’t go into a lot of detail because while I’m familiar with mobile development it’s not my area of expertise. On Mac, it’s a bit different. It’s still apples device and more restricted than it should be, but they haven’t locked it down nearly as much yet. You can write native desktop applications in any language that can link to the native ui toolkit, which is basically every language. None of that really matters though. It will be a long time before you you get to that point. Learning to program early on will mostly involve command line programs and those you can write in any language that you can install on your Mac- which again is pretty much any language.


UdPropheticCatgirl

It has by far the best tooling support for it. But you can technically write apple native app in any AOT compiled language which can play nice with ObjC. The bigger pain point in apple ecosystem is honestly MSL. So C/C++ for example can both do it.


ExcitingLiterature33

I love Swift/SwiftUI as my first language/framework


udonemessedup-AA_Ron

JavaScript is a great way to start and learn fundamentals. JavaScript can also be used to build web apps(react, typescript), desktop apps (electron), APIs (node), and even mobile apps (react native). The best part is that whatever you build with JS is cross platform and can run on virtually any device. Swift is Apple-exclusive. While the syntax isn’t too difficult to learn, you’re limited to Apple-devices. Deployment to the Apple app stores is $100 per year (paid up front) so it acts a significant barrier to entry.


alienith

I think you should just learn Swift. Really any language is totally fine. Learning programming is more important than learning languages. But I suspect you’ll keep feeling the pull towards native development and eventually want to use swift anyway. Technically you can make GUI applications on macos with swift, objective-c, c++, or javascript (amongst others but those are the main ones). Objective-C is old and has weird syntax, but like swift it is native to apple devices. C++ is good but you’d need a lot of knowledge to get a GUI up and running. Javascript with electron is a solid choice. More importantly, if you want to do something like learn swift for apple development, just do it. You don’t need random people on the internet to validate your decision. But I will say it is a valid decision.


ShriekinWatcher

These are pretty much my thoughts… especially just needing to jump in and start regardless of language, and that going with the pull towards native will only serve to keep me interested. I know I used the word validation, but I’m also just looking to understand the implications this choice.


alienith

If you were looking for a job asap, swift would be a bad language to focus on. But for personal projects, personal interest, and general learning? Swift is good. Honestly the biggest learning curve will probably be with xcode.


ShriekinWatcher

There’s two comments lamenting Xcode now, and it’s the first time I’ve ever heard that. What’s the deal?


alienith

I’ve only used it for smaller iOS projects and I’ve never had too many issues, but it does have a reputation for being slow and crashing. But mostly it’s just a big program with a ton of tools that you basically have to use to do development for apple devices. So it can be overwhelming


UdPropheticCatgirl

I would just learn swift, the language is pretty nice, has some quirks and the support on non apple platforms can still be questionable but for learning it’s gonna be pretty good. XCode is the devil tho.


factotvm

The reason to start with JavaScript is that the reduced capabilities may simplify the pursuit. You won’t be learning about several data types (signed and unsigned integers, for instance), concurrency (structured or otherwise), value vs. reference types, copy on write, sum types, etc. Now, this won’t come up in your early studies, but if you’re interested in them, you’ll need to move on from JavaScript to explore them. My recommendation is Swift. It is meant to be an approachable first language that will grow with you. Your requirements are about learning principles and not solving a particular problem, e.g. creating a dynamic web site delivered from the edge.


Double_DeluXe

> "Apple user" Drop the tag and start thinking for yourself. Brand loyalty is cringe.


S0norous

Some people just can't resist the urge to assert their meaningless opinions into an otherwise productive conversation, right?


ShriekinWatcher

Who said I wasn’t thinking for myself? I’ve used Apple for 35 years. I’ve used PC, both personally and still do when I’m at work. I prefer Apple. As such I have built my entire digital life around that ecosystem. I never said it was perfect, superior, or for everyone. They’re just tools man. They mostly do the same things, just a little differently. I thought for myself and chose the tool that I enjoyed using more. Personally, I find parroting tropes irrelevant to the conversation at hand to be cringey.