<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Abhishek Peiris</title>
    <description>The latest articles on DEV Community by Abhishek Peiris (@abhishek_peiris_).</description>
    <link>https://dev.to/abhishek_peiris_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2507967%2Fa054905a-e10a-4b57-aeb6-1031ead8ce42.jpg</url>
      <title>DEV Community: Abhishek Peiris</title>
      <link>https://dev.to/abhishek_peiris_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abhishek_peiris_"/>
    <language>en</language>
    <item>
      <title>Core Math Skills for Data Science: Statistics &amp; Probability</title>
      <dc:creator>Abhishek Peiris</dc:creator>
      <pubDate>Fri, 09 May 2025 19:30:30 +0000</pubDate>
      <link>https://dev.to/abhishek_peiris_/statistics-basics-72o</link>
      <guid>https://dev.to/abhishek_peiris_/statistics-basics-72o</guid>
      <description>&lt;h2&gt;
  
  
  Mean, Median, Mode
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Term&lt;/th&gt;
&lt;th&gt;What It Means&lt;/th&gt;
&lt;th&gt;Why We Need It&lt;/th&gt;
&lt;th&gt;Real Example&lt;/th&gt;
&lt;th&gt;Why Not Another&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Mean&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Average value&lt;/td&gt;
&lt;td&gt;To find the center of data&lt;/td&gt;
&lt;td&gt;Average salary in a company&lt;/td&gt;
&lt;td&gt;If a few people earn huge salaries (outliers), mean gets unfairly pulled!&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Median&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Middle value when data is ordered&lt;/td&gt;
&lt;td&gt;To find a fair "typical" middle when data has outliers&lt;/td&gt;
&lt;td&gt;Median house price in a city&lt;/td&gt;
&lt;td&gt;Median is better when data is uneven (e.g., few very expensive houses)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Mode&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Most common value&lt;/td&gt;
&lt;td&gt;To find the most frequent happening&lt;/td&gt;
&lt;td&gt;Most sold shoe size in a store&lt;/td&gt;
&lt;td&gt;Mode needed when "most common" is more important than "average"&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;✅ In short:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Mean = good for normal data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Median = better when data is skewed (unfair).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mode = for the most popular thing.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Range, Variance, Standard Deviation
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Term&lt;/th&gt;
&lt;th&gt;What It Means&lt;/th&gt;
&lt;th&gt;Why We Need It&lt;/th&gt;
&lt;th&gt;Real Example&lt;/th&gt;
&lt;th&gt;Why Not Another&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Range&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Max - Min value&lt;/td&gt;
&lt;td&gt;Quick idea of spread&lt;/td&gt;
&lt;td&gt;Highest and lowest test marks in a class&lt;/td&gt;
&lt;td&gt;Only shows extremes, not how all values behave&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Variance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Average of squared differences from mean&lt;/td&gt;
&lt;td&gt;Measure how spread out all data is&lt;/td&gt;
&lt;td&gt;Variance of stock prices&lt;/td&gt;
&lt;td&gt;Hard to interpret because it's squared units&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Standard Deviation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Square root of variance&lt;/td&gt;
&lt;td&gt;Easy-to-read spread measure (same unit as data)&lt;/td&gt;
&lt;td&gt;How much daily temperatures change from average&lt;/td&gt;
&lt;td&gt;Easier to explain to non-math people&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;✅ In short:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Range is rough and fast.&lt;/li&gt;
&lt;li&gt;Variance is deep but harder to read.&lt;/li&gt;
&lt;li&gt;Standard Deviation is what we usually tell people.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Correlation and Covariance
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Term&lt;/th&gt;
&lt;th&gt;What It Means&lt;/th&gt;
&lt;th&gt;Why We Need It&lt;/th&gt;
&lt;th&gt;Real Example&lt;/th&gt;
&lt;th&gt;Why Not Another&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Correlation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Strength and direction of relationship between two variables (scale: -1 to 1)&lt;/td&gt;
&lt;td&gt;Find if two things move together&lt;/td&gt;
&lt;td&gt;Height vs Weight; Study hours vs Exam score&lt;/td&gt;
&lt;td&gt;Shows strength and direction both&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Covariance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Direction of relationship, but scale is not fixed&lt;/td&gt;
&lt;td&gt;Early step before correlation&lt;/td&gt;
&lt;td&gt;Stock A and Stock B moving up/down together&lt;/td&gt;
&lt;td&gt;Hard to compare across different datasets&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;✅ In short:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use Correlation when you want to see if two things are linked.&lt;/li&gt;
&lt;li&gt;Covariance is more technical, and only used internally.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Probability
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is Probability?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Probability&lt;/strong&gt; = chance of something happening.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tossing a coin: Chance of Heads = 0.5&lt;/li&gt;
&lt;li&gt;Drawing a red card: Chance depends on deck.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Important Probability Concepts&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Concept&lt;/th&gt;
&lt;th&gt;What It Means&lt;/th&gt;
&lt;th&gt;Why We Need It&lt;/th&gt;
&lt;th&gt;Real Example&lt;/th&gt;
&lt;th&gt;Why Not Another&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Independent Events&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Events not affecting each other&lt;/td&gt;
&lt;td&gt;To model truly random things&lt;/td&gt;
&lt;td&gt;Tossing 2 coins separately&lt;/td&gt;
&lt;td&gt;Can't assume dependence when there is none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Dependent Events&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Events affect each other&lt;/td&gt;
&lt;td&gt;To model real-world connections&lt;/td&gt;
&lt;td&gt;Drawing 2 cards without replacement&lt;/td&gt;
&lt;td&gt;If you assume independence wrongly, you get wrong results&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Bayes Theorem&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Updating probability when new information arrives&lt;/td&gt;
&lt;td&gt;To make smarter decisions after getting new data&lt;/td&gt;
&lt;td&gt;Medical test accuracy given patient history&lt;/td&gt;
&lt;td&gt;Without Bayes, decision making will be "blind" to new facts&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;✅ In short:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In real life, events are often dependent → like disease tests, fraud detection.&lt;/li&gt;
&lt;li&gt;Bayes theorem makes models smarter when new evidence arrives.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Real-World Data Science Examples
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;th&gt;Math Concept Used&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Predicting customer churn (customer leaving)&lt;/td&gt;
&lt;td&gt;Probability + Statistics&lt;/td&gt;
&lt;td&gt;Need to model uncertainty&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stock price prediction&lt;/td&gt;
&lt;td&gt;Mean, Variance, Standard Deviation&lt;/td&gt;
&lt;td&gt;Understand volatility&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Health risk prediction (Diabetes, Cancer)&lt;/td&gt;
&lt;td&gt;Bayes Theorem + Statistics&lt;/td&gt;
&lt;td&gt;Update risk with patient data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recommendation systems (YouTube, Netflix)&lt;/td&gt;
&lt;td&gt;Mode, Correlation&lt;/td&gt;
&lt;td&gt;Find popular/common patterns&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>statistics</category>
      <category>maths</category>
      <category>datascience</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>From Java to Kotlin: A Java Developer's Guide to Kotlin Basics</title>
      <dc:creator>Abhishek Peiris</dc:creator>
      <pubDate>Sun, 09 Feb 2025 12:11:23 +0000</pubDate>
      <link>https://dev.to/abhishek_peiris_/from-java-to-kotlin-a-java-developers-guide-to-kotlin-basics-423p</link>
      <guid>https://dev.to/abhishek_peiris_/from-java-to-kotlin-a-java-developers-guide-to-kotlin-basics-423p</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl5qq1p72crqww0sgj1ca.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl5qq1p72crqww0sgj1ca.png" alt="Java to Kotlin" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;As a Java Developer, you may have heard of Kotlin, a modern language created by Jet Brains that's gaining popularity for its conciseness and safety. Kotlin is fully interoperable with java, making it easy to adopt without a complete rewrite.  &lt;/p&gt;

&lt;p&gt;In this guide, we'll cover Kotlin basics, highlighting the key differences and improvements over Java. Whether you're starting a new project or enhancing an existing one, this article will help you quickly get up to speed with Kotlin's syntax, null safety, and powerful features. &lt;/p&gt;

&lt;h3&gt;
  
  
  Kotlin Syntax Overview:
&lt;/h3&gt;

&lt;p&gt;With an emphasis on minimizing boilerplate code, Kotlin's syntax is intended to be clear and expressive. Many of the principles will seem familiar to Java developers, but Kotlin makes them easier to understand and better.&lt;/p&gt;

&lt;h4&gt;
  
  
  Variables and Types:
&lt;/h4&gt;

&lt;p&gt;Kotlin uses &lt;code&gt;val&lt;/code&gt; for immutable variables and &lt;code&gt;var&lt;/code&gt; for mutable ones. Unlike Java, you don’t always need to specify the type because Kotlin can infer it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;val name: String = "Kotlin"   // Immutable
var age: Int = 25             // Mutable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Nullable:
&lt;/h4&gt;

&lt;p&gt;Kotlin also supports nullable types, marked with a &lt;code&gt;?&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var name: String? = null   // Nullable type
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Type Inference:
&lt;/h4&gt;

&lt;p&gt;Kotlin often infers the type of a variable, making the code cleaner and easier to read.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;val name = "Kotlin"   // Inferred as String
var age = 25           // Inferred as Int
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Null Safety:
&lt;/h4&gt;

&lt;p&gt;Kotlin eliminates the risk of &lt;code&gt;NullPointerException&lt;/code&gt; with built-in null safety. You can define nullable types using &lt;code&gt;?&lt;/code&gt;, and safely access them with &lt;code&gt;?&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;val length = name?.length   // Returns null if 'name' is null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Elvis operator &lt;code&gt;?:&lt;/code&gt; provides a default value when a nullable variable is null.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;val length = name?.length ?: 0  // Returns 0 if 'name' is null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Functions:
&lt;/h4&gt;

&lt;p&gt;In Kotlin, functions can be written in a simplified and more flexible way using features like &lt;strong&gt;single-expression functions, default parameters, named arguments, higher-order functions, and extension functions&lt;/strong&gt;. Here's how you can make your functions cleaner and more concise:&lt;/p&gt;

&lt;h5&gt;
  
  
  Single-Expression Functions:
&lt;/h5&gt;

&lt;p&gt;Instead of using &lt;code&gt;{ return ... }&lt;/code&gt;, you can use &lt;code&gt;=&lt;/code&gt; for simple functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Traditional function
fun square(x: Int): Int {
    return x * x
}

// Simplified version
fun square(x: Int) = x * x

println(square(5)) // Output: 25
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Default parameters:
&lt;/h5&gt;

&lt;p&gt;You can provide default values to avoid overloading functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fun greet(name: String = "Guest") = "Hello, $name!"

println(greet())       // Output: Hello, Guest!
println(greet("John")) // Output: Hello, John!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Named Arguments (Flexible):
&lt;/h5&gt;

&lt;p&gt;Named arguments allow calling functions in any order.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fun createUser(name: String, age: Int, country: String) = "$name, $age years old from $country."

println(createUser(age = 25, name = "Alice", country = "USA"))
// Output: Alice, 25 years old from USA.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Lambda &amp;amp; Higher-Order Functions:
&lt;/h5&gt;

&lt;p&gt;Kotlin supports passing functions as arguments.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fun operate(x: Int, y: Int, op: (Int, Int) -&amp;gt; Int): Int {
    return op(x, y)
}

// Using lambda functions
println(operate(5, 3) { a, b -&amp;gt; a + b }) // Output: 8
println(operate(5, 3) { a, b -&amp;gt; a * b }) // Output: 15

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Extension Functions (Adding Functions to Existing Classes):
&lt;/h5&gt;

&lt;p&gt;You can add functions to existing classes without modifying them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fun String.firstChar(): Char = this[0]

println("Kotlin".firstChar()) // Output: K

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Inline Functions:
&lt;/h5&gt;

&lt;p&gt;In-lining reduces function call overhead.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;inline fun repeatMessage(times: Int, action: () -&amp;gt; Unit) {
    for (i in 1..times) action()
}

repeatMessage(3) { println("Hello") }
// Output:
// Hello
// Hello
// Hello

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Classes and Inheritance:
&lt;/h4&gt;

&lt;p&gt;In Kotlin, classes are simpler to work with compared to Java. Highlight how classes are declared and the differences with Java’s inheritance model.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Class Definition&lt;/strong&gt;: Primary constructors are part of the class declaration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inheritance&lt;/strong&gt;: Kotlin classes are &lt;code&gt;final&lt;/code&gt; by default. To inherit from a class, use &lt;code&gt;open&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;open class Animal(val name: String)

class Dog(name: String) : Animal(name) {
    fun bark() {
        println("Woof!")
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Data Classes: Automatically Implemented Methods
&lt;/h4&gt;

&lt;p&gt;One of Kotlin's most loved features is the &lt;code&gt;data class&lt;/code&gt;, which automatically provides &lt;code&gt;toString()&lt;/code&gt;, &lt;code&gt;equals()&lt;/code&gt;, and other methods.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data class User(val name: String, val age: Int)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Control Flow: When and If Expressions
&lt;/h4&gt;

&lt;p&gt;Kotlin’s &lt;code&gt;when&lt;/code&gt; expression is more powerful than Java’s &lt;code&gt;switch&lt;/code&gt;, and &lt;code&gt;if&lt;/code&gt; is an expression that can return a value.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;If Expression:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;val max = if (a &amp;gt; b) a else b

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;When Expression:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;when (x) {
    1 -&amp;gt; println("One")
    2 -&amp;gt; println("Two")
    else -&amp;gt; println("Unknown")
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Collections: Immutable and Mutable List Operations
&lt;/h4&gt;

&lt;p&gt;Kotlin’s standard library includes powerful features for working with collections.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Immutable Collections: Use &lt;code&gt;listOf()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Mutable Collections: Use &lt;code&gt;mutableListOf()&lt;/code&gt; and modify them as needed.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;val immutableList = listOf(1, 2, 3)   // Immutable
val mutableList = mutableListOf(1, 2, 3)   // Mutable
mutableList.add(4)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Lambda Expressions: Simplifying Code with Function Literals
&lt;/h4&gt;

&lt;p&gt;Kotlin makes working with functional programming easy with lambda expressions. Java developers will find lambdas in Kotlin very similar to Java 8's lambda expressions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;val add = { x: Int, y: Int -&amp;gt; x + y }
println(add(2, 3))  // Outputs 5

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;em&gt;Call to Action&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Invite readers to share their experience with Kotlin or ask any questions in the comments. You could also suggest they try out Kotlin in their Java projects or explore resources like the official Kotlin documentation.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
