I’m new to programming (and posting to forums!) and would be very grateful for your help. I’m a mature student studying for a conversion course in Computing and have written a dissertation comparing Java and Swift for new programmers. Part of this is a ‘guideline’ for new students to object-oriented programming.
For feedback on the guideline, I’d be really interested to hear if you think I’m right or wrong in what I’ve concluded, and for any comments on which language, as a student of OOP you found to be easiest to learn, had the best IDE, or was of the most relevance.
• When choosing which language to learn there are multiple factors to consider – ease of learning, working environment (Integrated Development Environment), the raw speed and the relevance of the chosen language; How applicable is it to the intended use?
• The results of my critical analysis demonstrated that both object-oriented languages are straightforward to pick up, with a wealth of learning materials available. However, of the two programming languages, Swift is easier to pick up do to the more straightforward syntax and fresh and modern learning materials.
o As an example, there is no ‘main’ method required in Swift and the syntax is certainly more intuitive and readable.
o While Java is associated with a large volume of learning material, built up over three decades, Swift is only five years old but first and third-party material has a more exciting look and feel about it.
• In terms of the IDEs, Java certainly wins in terms of choice – there are many IDEs to choose from, and if a student doesn’t like one, it is straightforward to try another. As a personal preference, I found the Xcode interface to be a more pleasing environment in which to work.
• When it comes to popularity and practical application, Java is the preference - only 7% of developers on stack Overflow (a popular question and answer site for developers) are currently using Swift, compared to Java’s 41% (Stack Overflow, 2019).
• In term of raw speed, my quantitative analysis of the bubble sort and prime decomposition algorithms demonstrated that Java is orders of magnitude faster than Swift when repeatedly processing these looped algorithms. Although this may have a lot to do with the code being run in Swift playgrounds, this significant performance differences may be a deciding factor.
• The comparatively sluggish speed of Swift may be judged as being ‘worth it’ depending on the intention of the student: If the intention is to work in established, often speed-critical areas, then Java is the clear winner. Alternatively, if iOS development is the end-goal, then the choice should be Swift.
• In terms of ease of use and inspirational, modern materials, Swift is an excellent language to learn. Additionally, if programming apps within the iOS environment is the number one goal, then Swift is the clear choice.
• Should aspiring programmers require a well-rounded introduction to object-oriented programming, while keeping their future goals open, or consider speed to be a significant goal in the applications that they produce, then their decision should be weighted towards Java.
I'm a student and not a professional programmer so here are my thoughts:
- Swift and iOS development tie you up to one vendor, Apple's hardware is quite expensive - traditional uni will stay away from it as it means extra costs for them and courses will be less popular
- Java is a safe choice, low barriers to entry and large job market, easy to find tutors, courses cheap to create and will be popular, it just screams large profit margins for the university
- Why just these two? Why not consider Smalltalk or Dart?
I'm thinking of vacationing in the United Kingdom. What language should I learn? English or Welsh?
Swift is a very popular language, but only in one small corner of the Realm. Like its predecessor Objective-C, it's not used - and probably not even available - outside of the Apple sphere.
At this point in technology, I'd be reluctant even to suggest a Windows-only language system, much less an Apple-only one unless you have very definite career goals that don't anticipate ever needing fluency on any other platform.
Java attempts (with good success) to be universal. Swift doesn't. And as Adrian noted, just getting development capabilities on Swift can cost considerably. You can set up a Linux Java development system on an old box that's no longer good enough for Windows and was going to get tossed away otherwise. Yes, educational institutions can get all sorts of deals and freebies on proprietary products, but that all goes away when you graduate. And if you want to augment your learning by looking at how successful open-source projects were done, you'll find relatively little done in Swift.
Rather than consider Swift versus Java for learning you might consider Python. Or Kotlin.
Incidentally, I once calculated that if everyone in my hometown were to learn Welsh, the total Welsh-speaking population of the world would have doubled. English, of course, goes a lot further.
"privilege" comes from the Latin words for "private" and "law" (legal) and dates to feudal times. To "claim privilege" meant that you were above the laws that applied to the common people.
posted 11 months ago
Thanks for your entertaining and valuable reply Tim. Definitely food for though, and I enjoyed the language analogy!
Adrian - as a fellow student (although I’m a mature (oldish) one), I appreciate your perspective and your points make perfect sense.
Sorry about the short reply for now - but I’ll revisit your replies over the next few days.
I realize this was from two weeks ago but I just read this post .
I liked Tim's language analogy but if you are living in Wales ,learn Welsh.
Same with programming languages. What is your goal ?
If you are comparing two languages because you want to be a phone developer then looking into which apps/app store generates the most money for their developer makes more sense than language specifics.
If you want to learn Object Oriented programming ,you might consider an object oriented language that does not use a garbage collector like C++ . Learning about how memory pointers work is a solid start for any programmer .
As far as a general computer language goes, just regular C is a pretty good start as a lot of other languages use C like syntax.