topcoder-platform / thrive-submit

Thrive article tracking
6 stars 5 forks source link

What is unique about Kotlin? #281

Closed andiirawan-art closed 4 years ago

andiirawan-art commented 4 years ago

What is unique about Kotlin_.docx

andiirawan-art commented 4 years ago

The following is an example of submission for this challenge: https://topgear.topcoder.com/challenges/30120975 Title: What is unique about Kotlin? Author: Programming paradigm

Track Category: Development Subcategory: paradigms (Multi paradigm). Tags: programming language, Kotlin, Programming paradigm Read Time: 7 min Banner Image (minimum 760px x 555px) https://drive.google.com/open?id=1lxOZLwmOVTpMji_tB69zoihWUwJnuM-d Content Introduction What is unique about Kotlin? One of them, Kotlin is a programming language that can be targeted to various platforms (Multiplatform) and also has several paradigms (Multiparadigm). Therefore, we need to know what is meant by the Multiplatform and Multiparadigm. Let's discuss them one by one. Multiparadigm Maybe some of us are still unfamiliar with the term multiparadigm in the world of programming. According to Wikipedia, the programming paradigm is a way to classify programming languages based on the features they have. The paradigm here is related to how to code in a programming language is organized, such as grouping code or modifying it. More precisely, what kind of code structure can be applied to the programming language. There are several paradigms that are commonly held by a programming language. When we want to classify programming languages based on the way they are written in syntax, object-oriented programming (OOP) and functional programming (FP) are 2 (two) paradigms that are well-known among developers. In terms of construction, Kotlin itself covers both. You can use both OOP and FP styles, and even mix them when writing Kotlin syntax. With high support for features such as higher-order functions, function types, and lambda, Kotlin is the right choice for you to explore functional programming. Almost all General Purpose Language ow supports multiparadigm. For more details, let us discuss one by one of the two paradigms.

Object-oriented Programming A programming language can be classified into OOP if the data and methods used to manipulate it are stored as a unit that can be called an object. OOP has perfect encapsulation features. Furthermore, the only way that other objects or users can access data is the object method. Thus, the workings of an object can be changed without affecting other code that uses the object. Kotlin provides broad support for developing object-oriented programs. In OOP we will recognize several concepts such as objects, classes, properties, constructors, etc. With OOP we can solve complex problems into smaller sets by creating objects. The object has 2 (two) main characteristics, namely state (state) and behaviour (behaviour). We will discuss the OOP components in Kotlin in more depth in a separate module. As an opening, let us consider the following example:

  1. A motorcycle is an object. Motorcycle has 2 (two) wheels which we can call as states. Motorbikes can drive, can be brakes, can also change gears. Well, those three things we can call behaviour.
  2. A horse is an object. Horses have names, colours, and also types which are states of horses. Horses can run, eat, and so on. This is what we call behaviour. An object such as a motorcycle can also have small objects in it, such as wheels, brakes, body, engine etc. Everything can be interconnected and interact. In addition, OOP is also based on the concept of Message Passing, which is a type of communication between process and object. That is a simple description of the OOP concept that we will study.

Functional Programming There are so many perceptions regarding functional programming. Every perception depends on who interpreted it. An F-sharp programmer will interpret FP as what is in F-sharp. Likewise, Swift programmers will interpret FP as what is in Swift. But we can conclude that all programming languages that support first-class citizens are included in FP. First-class citizen itself is an entity that supports all operations that are generally available for other entities. For example, a function that can be passed as a parameter. Functional programming is a paradigm that is being hyped among developers today. This paradigm treats computing as an evaluation of mathematical functions and avoids changing circumstances or data that can change. In FP, programming is done by expression or declaration. So a function produces a value that only depends on the argument passed to that function. Eliminating effects such as state changes that do not depend on input functions, can make it easier to understand and predict the behaviour of a program. This is the main purpose of functional programming. There are still many developers who immediately imagine OOP when they hear the word "Kotlin". In fact, as mentioned before, Kotlin is a multiparadigm language. Kotlin has several features that have a functional programming style, though not fully functional programming. Why is that? Indeed Kotlin is an object-oriented programming language that has a functional structure. This means that Kotlin is also a functional programming language. Functional programming also aims to make it easier for us to understand code. The idea behind FP is to add and subtract certain things to make our code a little easier to understand. Kotlin has many interesting features that make it functional programming like higher-order functions, function types, extension functions, lambda, etc.

kkartunov commented 4 years ago

@andiirawan-art this has "Plagiarism was detected". Please, fix and resubmit.

hokienick commented 4 years ago

We will pick back up operations of Thrive articles in July.