Author: Ankit Mogha

What is Lambda Expression in java? How to Use it?

Reading Time: 3 minutes Lambda Expressions get add-in Java 8. Java lambda expressions are Java’s first step into functional programming. Its main objective is to increase the expressive power of the language. The syntax of a basic lambda expression is: The expression use as the code body for the abstract method within the paired functional interface. lambda expressions exist outside of any object’s scope. This means they are callable anywhere in Continue Reading

What are Streams API in Java 8 ? How its unique

Reading Time: 3 minutes First of all, Java 8 Streams should not be confuses with Java I/O streams. The Stream API is use to process collections of objects. Java provides a new additional package in Java 8 called In stream one or more operations can be perform. The Streams operations are either intermediate or terminal. Stream provides following features: The stream does not store elements. A stream is not Continue Reading

Contracts in Ethereum using Solidity

Reading Time: 2 minutes The Contracts in the sense of Solidity is a collection of code and data. That resides at a specific address on the Ethereum blockchain. Contracts in Solidity are similar to classes in object-oriented languages. They contain persistent data in state variables, and functions that can modify these variables. Creating Contracts Contracts can be create from outside via Ethereum transactions or from within Solidity contracts. Lets Continue Reading

Design Patterns in Rust Programming

Reading Time: 3 minutes The Design Patterns are programming language independent strategies for solving a common problem. By using design patterns, you can make your code more flexible, reusable, and maintainable. These solutions were obtained by trial and error by numerous software developers. Types of Design Patterns There are following types of design Patterns in Rust for solving our problems : Behavioural Creational Behavioural Patterns Behavioural design pattern are design patterns that Continue Reading

How to Tackle Error in Rust Programming

Reading Time: 3 minutes An Error is basically an unexpected behaviour that may lead a program to produce undesired output or terminate abruptly. Error handling is the process of handling the possibility of failure. In Rust, errors can be classified into two major categories. Recoverable UnRecoverable Recoverable Error Recoverable errors are those that do not cause the program to terminate abruptly. Such as a file not found error . Continue Reading

How to use Pattern Matching in Rust

Reading Time: 3 minutes Rust has an extremely powerful control flow operator called Match. Pattern matching in Rust works by checking if a place in memory matches a certain pattern. Patterns can be : literal values variable names wildcards, and many other things Destructuring using Pattern Matching Pattern matching can use to destruct following items : Structures Enums Tuples  Destructuring breaks up a value into its component pieces. The syntax used is Continue Reading

Generics : How to use them and Implement them in Rust

Reading Time: 4 minutes When we want to write code for multiple contexts we use Generics. It give us primitives to declare placeholder that allow us to focus less on the specific types. It allows us writing a more concise and clean code by reducing code-duplication and providing type-safety.  Generic Functions In a generic definition, we write the type parameter between open and close angle brackets after the name. In Rust, generic also describes anything that accepts one or more generic type Continue Reading

What are the different types of collection in Rust

Reading Time: 4 minutes Rust’s standard library includes a number of very useful data structures called collections. A collection is something that holds zero or more elements in some fashion that allows you to enumerate those elements, add or remove elements, find them and so forth. Rust’s collections can be grouped into four major categories: Sequences Maps Sets Misc Sequences Collection Sequences are supported in many forms in Rust. Vec Continue Reading

How Substrate Frame v2 different from Frame v1

Reading Time: 3 minutes Blockchain is a specific type of database. It differs from a typical database in the way it stores information. Blockchains store data in blocks that are then chained together. Blockchain has changed how we perceive problems. It has brought tons of benefits. Blockchain technology solves key issues like trust in a network. Blockchain technology utilizes advanced security compared to other platforms or record-keeping systems. By using Continue Reading

Let us Build Checkers, the Board Game in Rust

Reading Time: 4 minutes In my previous blog, you have seen how to build checkers game and implements its basic rules using WebAssembly. In this blog, we build Checkers game using Rust programming language. Let’s get started To get started, type the following in the terminal: Now rustycheckers the library project is created. Setting Up the Checkers Board To start writing the code to manage the game board, the Continue Reading

Let us Build Checkers, the Board Game in WebAssembly

Reading Time: 4 minutes Checkers is a fairly simple game played on an 8×8 game board. The board’s squares are typically alternating colours. Each player then places 12 pieces on the board in fixed squares spaced evenly one square apart from each other. So one Player controls black pieces another player controls white pieces. Lets us see what are some basic rules of the game :- The opponent with Continue Reading

Object Oriented Programming Concepts in Rust

Reading Time: 4 minutes Object Oriented Programming (OOPs) Concept Object Orientated programming is a methodology or paradigm to design a program using classes and objects. OOPs provides the following concepts: – Class and Objects Inheritance Encapsulation Polymorphism Abstraction There is a big debate about how many of these concepts a language needs to implement to be considered object-oriented. Today we gonna see how Rust implements these concepts to be Continue Reading