DEV Community

loading...

Swift or Java or Kotlin?

Bret
・1 min read

Is Swift better than Java or C?

I don’t want to be limited with a language. Is Java realistic to learn now, or is Kotlin better?
I keep hearing that C is good?
But......is that,
“C”, “C#” or “C++” ???

Which one is good?

Discussion (10)

Collapse
adrianbudzynski profile image
AdrianBudzynski

First of all, you should ask yourself what type of development you wish to do with this language. Most of the platforms/environments are bound with their default language (There are exceptions - but it is not relevant at this level of discussion).

iOS/native MacOS - Swift
Android - Kotlin
Embedded/Microprocessor - C/C++
Windows - C#
Web - JavaScript/TypeScript
Data Science/Machine Learning - Python
Backend - Java/Ruby/Python/Javascript/Typescript

Basic concepts for all of the above-mentioned languages are very similar. If you will get to know them you are not going be limited to just language.

Collapse
yobretyo profile image
Bret Author

Thank you, I like python, but it’s said to be slow and older? I’m liking data science, but you need college for it basically to be taken seriously?

Collapse
adrianbudzynski profile image
AdrianBudzynski

Unfortunately, data science is hard to be proficient in. To be honest it is easier to learn the programming language to process the data if you understand data rather than learn the language and then process it. Math and statistics are a must-have.

Python is slower than modern languages, I agree, but lately, it has a second life thanks to data science and machine learning. I would forget about that minor issue.

As mentioned previously. Find the area you would like to extend your knowledge and then decide what language to learn.

Thread Thread
yobretyo profile image
Bret Author

Ok, I like python/Django.... but with mentioning Datascience is tough to be proficient, well, is using Python/Django worth it even? Or, what’s a alternative?.
Or, is Python/Django + React or Vue good?

Thread Thread
adrianbudzynski profile image
AdrianBudzynski

If you like it.. go for it. I think if you like something it is going to be a pleasure to work on it and you are going to be at least two times more productive. If you like data science, you would be able to extend the knowledge in that area as well in time, according to the Slight edge principle.

Backend in Django, and frontend in React/Vue/Angular.. why not? You would be full-stack then which opens a lot of new opportunities.

insights.stackoverflow.com/survey/... The last StackOverflow survey even confirms Django is really high. Right after Java's Spring framework, one of the most popular framework in enterprise solutions.

I personally for the front end use Angular and NestJS for the backend. But it is not a popular combination. I just like TS, and the possibility to share the code between backend and frontend. You can check the results at: owwly.com .

Collapse
webbureaucrat profile image
webbureaucrat • Edited

Java--very useful but legacy language

Kotlin--a newer (and in my opinion much better) language compatible with Java. Yes, it is used often with Android, but it's compatible with any Java codebase, not just android. Kotlin is basically Java with a bit of a slimmed-down syntax.

C/C++--These are mainly used for low level stuff. I don't mean easy stuff; I mean stuff that runs very close to the machine. Do you want to write an operating system? Do you want to write a program for a robot that has a tiny processor that couldn't handle a big Java program? Are you trying to write a driver for a new hardware device. These are all good reasons to use C/C++. Breaking it down even further:

C: Does not have object-orientation, which is a particular way of organizing code.

C++: It's C language, but with object orientation.

For what it's worth, I think every intermediate or advanced level developer should learn low-level programming in a language like C, C++, or Rust, but not as a first language.You mentioned that you heard C and C++ are "good." That's not the right way to think about it. Almost every single programming language is "good" at something and almost no programming language would be "good" at everything that can be done.

C#: It's a common misconception that C# is related to C in the way that C++ is. It's not. It's named after C/C++ because, like Java, it has a vaguely C-like syntax, but it's most like Java. Actually, it was created specifically because Microsoft got sued for violating Java's copyright and had to write their own. C# is very popular in game development and it's popular in enterprise (I work in C#).

Like I said, it's very important to not think of "which language is best so I can learn that one." Instead, think, "What do I want to write?" and then ask which languages are good candidates for what you're trying to do.

Also, try a lot of different things. For example, a lot of people really hate writing JavaScript because it's so permissive that it's easy to write something wrong. Other people really like the permissiveness of JavaScript because they find it freeing. You need to fully learn about four or five very different languages before you'll figure out what features you like in a language.

Collapse
stojakovic99 profile image
Nikola Stojaković

C++ is not C with OOP but a completely distinct language for decades now.

Collapse
yobretyo profile image
Bret Author

I want to use a language that is diverse, but tho, needed as in, it’s stable and have a variety of uses. Swift is Apple. So your really limited to basically how the company is doing

Collapse
joelbonetr profile image
JoelBonetR

Java for big companies that had big projects such banking apps, kotlin is more wide on Android development, swift is to develop iOS APPs, of course C is good but is more used near the hardware. C++ for game development , C# for windows Apps... Each tech has its own nieche so think where you like to work and then choose one, or do a project with each one and find out which you like most.

Collapse
mustufa786 profile image
Mustufa Ansari

to learn Kotlin firstly you need to learn java or C.