Skip to main content

C, c++C++, C#, Java, as well as many other statically typed languages have the type before variable like (int a =5int a =5, auto c = 4auto c = 4, etc.).

Non-statically typed languages (such as Javascript, basic) use var var (or letlet) before the name (var a = "asd"var a = "asd")

Why does Kotlin, a statically typed language, use a mixture (var i: Intvar i: Int)?

Why not define it as (Int i = 5Int i = 5)? It's a bit less typing and I don't see the advantage in form #2?

C, c++, C#, Java, as well as many other statically typed languages have the type before variable like (int a =5, auto c = 4, etc).

Non-statically typed languages (such as Javascript, basic) use var (or let) before the name (var a = "asd")

Why does Kotlin, a statically typed language, use a mixture (var i: Int)?

Why not define it as (Int i = 5)? It's a bit less typing and I don't see the advantage in form #2?

C, C++, C#, Java, as well as many other statically typed languages have the type before variable like (int a =5, auto c = 4, etc.).

Non-statically typed languages (such as Javascript, basic) use var (or let) before the name (var a = "asd")

Why does Kotlin, a statically typed language, use a mixture (var i: Int)?

Why not define it as (Int i = 5)? It's a bit less typing and I don't see the advantage in form #2?

added 1 character in body; edited title
Source Link
yannis
  • 39.7k
  • 40
  • 185
  • 218

Why does kotlinKotlin require type after variable, rather than before?

C, c++, C#, Java, as well as many other statically typed languages have the type before variable like (int a =5, auto c = 4, etc).

Non-statically typed languages (such as Javascript, basic) use var (or let) before the name (var a = "asd")

Why does Kotlin, a statically typed language, use a mixuremixture (var i: Int)?

Why not define it as (Int i = 5)? It's a bit less typing and I don't see the advantage in form #2?

Why does kotlin require type after variable, rather than before?

C, c++, C#, Java, as well as many other statically typed languages have the type before variable like (int a =5, auto c = 4, etc).

Non-statically typed languages (such as Javascript, basic) use var (or let) before the name (var a = "asd")

Why does Kotlin, a statically typed language, use a mixure (var i: Int)?

Why not define it as (Int i = 5)? It's a bit less typing and I don't see the advantage in form #2?

Why does Kotlin require type after variable, rather than before?

C, c++, C#, Java, as well as many other statically typed languages have the type before variable like (int a =5, auto c = 4, etc).

Non-statically typed languages (such as Javascript, basic) use var (or let) before the name (var a = "asd")

Why does Kotlin, a statically typed language, use a mixture (var i: Int)?

Why not define it as (Int i = 5)? It's a bit less typing and I don't see the advantage in form #2?

Post Reopened by yannis
Post Closed as "Opinion-based" by Ixrec, CommunityBot, Robert Harvey, gnat, yannis
Source Link

Why does kotlin require type after variable, rather than before?

C, c++, C#, Java, as well as many other statically typed languages have the type before variable like (int a =5, auto c = 4, etc).

Non-statically typed languages (such as Javascript, basic) use var (or let) before the name (var a = "asd")

Why does Kotlin, a statically typed language, use a mixure (var i: Int)?

Why not define it as (Int i = 5)? It's a bit less typing and I don't see the advantage in form #2?