Scopes make your code more readable? think again

You are going to encounter these scope functions namely let, run, apply, also, within every Kotlin codebase, along with all the mischievous ways developers exploit their usage from the way they were intended for. Let see how popular opinion on those ends up just as a code noise.

Featured On

Let me out! ⛓

Popular opinion → let is treated as a native way to do null checks on the variables.

Please don’t do that because using let feels functionally beautiful but

  • You will end up creating another reference called it in the same scope which is…


I have a secret code for you to crack detective! 🕵️‍♀️

originally published on https://chetangupta.net/bbk-main/

Don’t be a Java-ish dev in Kotlin-ish world, improve your knowledge about Koltin Standard Library and write better Kotlin code. ✌🏻 If your Java dev migrating to Kotlin this will help you learn alot!

checkout big-brain-series

This quiz was suggested by Rohan Singh on Twitter, sorry for the delay mate!

Question: You have received a secret message! unfortunately, you can’t just read it, it is encoded in Morse code. Your task is to implement a function that would take the morse code as input and return a…


👨🏻‍💻 How to create base-class of Activities and Fragment

Note this post is just one fraction of the ViewBinding Deep Dive I did on my personal blog. If you find it useful do consider checking-out the full In-depth article.

Creating BaseActivity

https://chetangupta.net/viewbinding/

Usage

https://chetangupta.net/viewbinding/

Creating BaseFragment

Usage

https://chetangupta.net/viewbinding/

That’s it! copy these snippets and you will have ready-to-use ViewBinding Classes in your codebase.

It’s not just Another ViewBinding Article 👇🏻

TLDR: You will Learn

There are many view binding articles out now, what values does it add? after completing this one you would be familiar with these points

  • View-binding not working in all the modules? …


Curious how Kotlin resolve the Java platform’s map?

Most of the Kotlin developers are migrated from the Java environment, they are pretty well versed with uses-cases and application of Collection Framework in the Java platform, but applying the same knowledge in a Kotlin codebase isn’t guaranteed to work always. You could end up with a spaghetti codebase base having a long trailing function and making hacks to achieve a functionality that could easily be solved using Kotlin’s standard functions easily. Kotlin stdlib which offers generic interfaces, classes, and functions for creating, populating, and managing Collections of any type.

In Today’s…


Learn Pure Native Kotlin DI, which can be migrated to HILT or Dagger in few steps.

Featured on :

Sample project completely demonstrating Manual DI

Dagger is one of the popular frameworks that has been known for Dependency Injection (DI) for Java and Android platforms. It’s in most of the Android projects whether small or large, developers tend to start off with the basic scaffold of Dagger just not to deal with the huge boilerplate or to avoid huge migration of adding it later to the project. …


List to String is very crucial operation that you need to know if you’re into competitive programming.

Kotlin | Join to String

to learn more advance operations such as truncating string, performing transformations, adding a prefix and suffix, and much more that can be done on the `joinToString()` follow up the companion article.


Even been confused or keep forgetting which is called first init blocks or constructors? Never again keep reading…

Hi #androidDevs, This is Androidbites where I try to break down a small concept into an understandable code snippet and share my learning experience with it.

Today we are discussing init blocks, here is a little challenge for you guys, let's see if you could guess the correct out! if you can guess the right output you get a Candy,

if you don’t know then, don’t worry grab your headphones and put on lofi music and read thought my article from below…👇💻

See you on the other side 😈
Happy #Hacking!💻


safely handling position even when data members are re-positioned!

Hi #androidDevs, This is Androidbites where I try to break down a small concept into an understandable code snippet and share my learning experience with it.

As per my previous article, I discussed how destructuring is limited in kotlin in case you missed it go through the following link.

Today snippet tells about the place where you should never use destructuring. 👁 on the code 💻👇

kotlin | destructing limitation

You must be wondering then what should be the ideal place when we should be using it or even to use for not, to figure…


lateinit vs nullable type, is lateinit actually the answer to your nullable type issues.

Hi #androidDevs, This is Androidbites where I try to break down a small concept into an understandable code snippet and share my learning experience with it.

Today’s topic is related to handling nullability using lateinit modifier, I absolutely agree `null` is the Billion dollar problem in a programming language, and for you, as a developer, it’s your responsibility that your app doesn't fall in as a victim of it and not crash your app due to that, In kotlin there are many languages functionalists build in…


Hi developer, Welcome to AndroidBites, here I take a small snippet of code and try to showcase an example to cover a concept.

Today we are touching Kotlin Destructuring, a way to unpack parameters and members. a neat example is in the snippet!

Chetan Gupta

Coding enthusiast! love Android #kotlinAlltheWay, want to explore all opportunity around it! CodingMantra: #cleanCoder #TDD #SOLID #designpatterns

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store