I am using brave browser for a long time and for m...
# getting-started
d
I am using brave browser for a long time and for me it is so much better than chrome or Firefox. But today when I visited brave's repository, I was surprised to see it was written in JavaScript. Also, Figma, vs code, etc are written in JavaScript. This forced me to reevaluate some of my beliefs. I think: • languages like Kotlin, Java, C++ give way more fastness than JavaScript • I should not use JavaScript Cross platforms frameworks if my main goal is to delivery good quality software. • JavaScript has too many flaws. • more like this.... But if I see around, there is nothing that cannot be done with JavaScript, without much complexity compared to other languages. Note: I am from JavaScript background, learning Kotlin. Recently I was arguing with my friend about getting into mobile development. He wanted to use React-Native, while I was more keen to use platform specific languages. I argued about performance. But right now, I am worried.... Do I even need to learn Kotlin or any other language? It seems like JavaScript has all solutions and I cannot say it is doing bad. I hope I am able to convey my concerns and thoughts. Suggestions, advice and help on this matter is really appreciable.
d
Kotlin is the best investment you can make for your future. With the raise of WebAssembly, Javascript will gradually lose its appeal also for the web. Think about PHP, as a server-side language. You can still use it and write any sort of website, but what a mess and how poor is the maintainability of code written with such paradigms. Similarly, with Javascript you can write any sort of front-end and even server-side code, but what a mess, and how many incompatible frameworks have born in order to provide some advanced functionalities. Kotlin is a modern statically typed language with a concise syntax which allows you to compile efficiently to any platform (now also WebAssembly!). You can write very beautiful code which is very easy to maintain. If you want to become a strong professional in apps development, Kotlin is clearly the way to go.
K 4
💯 5
d
Ok
m
I do agree with Daniele, but I also understand your point Dron. It's hard to think about "the best technology" for development, because this depends mostly on experience, community support and organization culture. I think that, what makes we choose something above the other options, is the context where we apply it. I can't imagine myself working with javascript in mobile development. Dart, because is typed and has null safety check, maybe. But still, the environment (android) is to complex, I don't feel like doing it. But, on the other hand, js is king for web application, the browser does almost all work for us, and we're slowly (really slowly) moving to a better typed system with type script.
👍 1
r
In 2007, Jeff Atwood made a quote that became popularly known as Atwood's Law: "Any application that can be written in JavaScript will eventually be written in JavaScript." Regarding TypeScript, it provides similar functionality to Kotlin, such as type checking, extension functions, and null safety. The only difference is the compilation step, as TypeScript uses Node, which utilizes the V8 engine, while Kotlin compiles in a different way and produces Java-compatible bytecode. The only concern here is performance, but we can either create a better runtime or engine for JavaScript that can execute it faster. In my opinion, the performance of JavaScript/TypeScript is not bad at all. Are there any metrics showing that apps in React Native are extremely slow? We can easily write cross-platform apps using a statically typed and concise syntax with TypeScript. It is easier to maintain complex applications and moderately easy to maintain when written correctly and isn't messy. We can also create components that can be easily shared between platforms, and it has a low barrier for entry. Additionally, we can write native code in React Native if we want to. This is a hotly debated topic, and in my opinion, all the answers are biased. I admit my bias because I come from a heavy JavaScript background. Kotlin is also very good and fast. However, I haven't noticed any significant performance issues with JavaScript so far, maybe just a few seconds of delay in opening the app and larger APK sizes. So, is TypeScript bad, and should I use it for Android, desktop, and iOS apps, or should I only use it for frontend development?
d
I don't really see the point in using React Native, when Compose is there and it's multiplatform, and Kotlin is a much better language than Javascript/Typescript in all respects. Ideally I would use share-code Kotlin with native declarative UI (Compose for Android and SwiftUI for iOS). But now that Compose is progressing for iOS and Wasm, I see Compose Multiplatform as a clear winner w.r.t. React for greenfield projects.
💯 2
r
What are the drawbacks of TS??
d
JS/TS code on mobile will never be comparable to natively compiled code that Kotlin allows
r
Then why are big tech companies like Tesla, Coinbase, Shopify, Discord, etc. https://reactnative.dev/showcase using it?? This is my doubt
d
Because they are not building greenfield projects
For new multiplatform projects, if you carefully analyse the benefits of Kotlin w.r.t. JS/TS I think it's very clear which is the best choice.
1
r
According to what I know a greenfield project is any project that a team starts from scratch. But in a greenfield project mvps are built in react native and highly complex apps with large user bases shift to native code. but here I am not seeing that trend. I know that performance wise Kotlin is better but the only thing that is making me think twice is the wy the big tech corporations are using it as they have huge user bases.
d
More and more companies are using Kotlin for their new projects. At the moment, it might be easier to find developers that know React, but many developers are now shifting to Kotlin.
d
@Daniele B Now I am little more confused...
r
"Kotlin/JS provides the ability to transpile your Kotlin code, the Kotlin standard library, and any compatible dependencies to JavaScript." if JS/TS is so bad then why is kotlin code converted to JS??
d
The future of Kotlin for the Web is not Kotlin/JS, but Kotlin/Wasm. I have never been a fan of Kotlin/JS.

https://youtu.be/-pqz9sKXatw

K 2
d
I think a drawback of JS is that it is single threaded...
👍 1
k
At the present moment and for the next five years at least, the JavaScript ecosystem is the most vibrant, with the best developer tools, with the widest and deepest variety of libraries and frameworks. Kotlin has a lot of promise in native / multiplatform area, but the other ecosystems are not resting and waiting for Kotlin to catch up. This isn't really well suited to this channel or server, but you need to make your decisions based on what you are after, or at least what you think you're after.
1
👍 1
d
I believe a junior engineer can make a much better investment by focusing on Kotlin rather than Javascript, because Javascript is an old language with an older community of developers, while Kotlin represents the future of programming and shares many features with other new languages such as Swift and Golang. Learning Kotlin allows you to develop a modern mentality of software development.
K 1
💯 1
r
totally agree with @Daniele B. JavaScript is a mess.
@Dron Bhattacharya focus on Kotlin ecosystem. keep Go, Rust, and Swift/SwiftUI in your sight too.
d
ok