How Ruby Developer can learn Blockchain development?

Question: I am a 10 year experienced ruby developer, I want to work in blockchain which language will I have to learn

Answer:

As Ruby (widely used for Rails development) is not used directly for Blockchain development. You will have to learn a language which is more compatible with Blockchain development. i.e. Solidity, Golang, C++ Or Node.js


So, you will likely need to learn Solidity for developing smart contracts on the Ethereum blockchain.

Solidity is a high-level programming language that is similar to JavaScript and is designed specifically for writing smart contracts that run on the Ethereum Virtual Machine (EVM) It is a statically typed language that supports inheritance, libraries, and complex user-defined types.

Solidity is not the only language used in blockchain development, but it is the most widely used for smart contract development on the Ethereum platform. Other blockchain platforms may use different languages, such as Golang for the Hyperledger Fabric blockchain, or C++ for the EOS blockchain.

While your experience with Ruby will not directly translate to Solidity or other blockchain languages, your existing programming knowledge and experience should help you learn and adapt quickly. You may want to start by studying Solidity‘s syntax, data types, and control structures, as well as its specific features related to blockchain development such as interacting with the blockchain, managing transactions and handling errors.

Get started Learning BlockChain

Learn Solidity Programming Language: This is designed for developing smart contracts that run on Ethereum. Click here to get started with Solidity.

Learn Flat and Relational DB

Learn Data Structure: i.e. Stack, LinkedList, and Queue.

Learn Terms related with blockchain ie. Mining, Public Distributed Ledger, Hash Encryption, Proof of work etc.


Learn How does Ethereum, HyperLedger, Hashgraph works?

Understand the Economics behind blockchain:

  1. Cryptography and Economics
  2. Cryptography in blockchain invoices hashing, Digital Signatures, and Proof of Work
  3. Hashing uses a cryptography algorithm using (sha256 in bitcoin and ethash in ethereum)
  4. Digital Signature: Private Key and Public Key.
  5. POW requires a miner to solve a mathematical puzzle to be able to add a block to the blockchain

Start Coding and Creating your own smart contract.Create own distributed application in Ethereum.

Simple Bubble Sort Algorithm in Ruby – Explained

Bubble

Can you write a Bubble sort in ruby?

The interviewer usually asks sorting algorithm and mostly the bubble sorting methods in the their interview. As that is one of the most commonly asked questions in sorting algorithm. So, I thought to share that in my blog here.

Bubble Sort

The bubble sort makes the larger elements (“big bubble”) towards the end and the smaller elements (“small bubble”) towards the starting point until all the elements reach in their correct location. i.e in proper sorted order from Small to Big sort.

# A method to define the bubble sort
def bubble_sort(array)
  # condition: When array has more than one element
  if array.count > 1
    swap = true
    # Loop: Run until swap is true
    while swap
      swap = false
      # Loop: Run loop with array counts and swap if 
      (array.length-1).times do |z|
        if array[z] > array[z+1]
          # swap if current number element is greater than next number element.
          array[z], array[z+1] =  array[z+1], array[z]
          # as we we have current number element is greater than next number element
          # so we updated more swap needed.
          swap = true
        end
      end
    end
    # While loop will stop once  array[z] > array[z+1] will be false 
    # then swap will become false line number 8.
  end
  array
end


print "Befor sort - #{[7,9,3,5,4,2,1]}"
print "\n"
print "After sort - #{bubble_sort([7,9,3,5,4,2,1])}"
print "\n"


When you will run the above code( Public Gist here). tath will Result as below:

bubble sorted result

Thank you!