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.

SOLID Principle in Ruby on Rails

SOLID Stands for:

  • Single responsibility principle
  • Open/closed principle
  • Liskov substitution principle
  • Interface segregation principle
  • Dependency inversion principle

The acronym stands for principles to help software engineers to create / write maintainable source code for long-term that use an OOPS language.

Single responsibility principle: Focus on One thing in a Class Seprately.

Open/closed principle: Class should be open for extension and closed for modification.

 Liskov substitution principle: The derived class must be capable of being substituted by its base class.

Interface Segregation principle:

Interface Segregation Principle (1996)

Dependency Inversion principle (DIP): Now a days used with Docker, Docker composer.

The Dependency Inversion Principle

To upgrade ruby 2.x to ruby 2.7 and rails 4.x to rails 6.0

Ruby on Rails update

It’s very rare to directly update from ruby 1.8.7 or ruby 2.0 to ruby 2.7 and rails 4 to rails 6.0. As I have recently done many upgrade projects from legacy ruby code to new ruby code. So, I thought to help other developers too.

How?

To do so, I have got the advantage of working from Ruby 2.x to the current version of ruby to I know each and everything from legacy plugin development age to gems and then gems to new replaced gems(if depreciated).

What?

For a small project, I would rather suggest installing a fresh project in the latest ruby and latest rails there. Now, I will replace the app folder of the old code into a new project.

also, I will keep adding configurations carefully as it’s mainly updated.

GEMS:

Regarding other gems, go to their GitHub documentation and check if the community is active (check using the last commit), if yes then you can install with their latest version without setting the gem version. i.e. gem install devise and add gem 'devise' in your Gemfile.

Migration:

and most important is the GEMS, from the old file, remove all ruby and rails related gems to transfer as new rails is already installed.

In migrations, you will have to add `[6.0]` in migration.

Webpacker update:

Ideally, we should use webpacker with rails 6, but As most clients don’t give time to re-write the javascript code with webpacker. So, It’s better to use normal javascript as in-app/assets folder.

And

For better projects management, we should follow the process:

  1. Prepare the List of Decreciated gems. Identify all possible new gems which can be used also if required or not.
  2. Prepare the documentation of changes required.
  3. Prepare the timelines accordingly.
  4. Work on ROR update as per your plan.
  5. Always use another branch for any kind of upgrades. and never use the master branch for an upgrade.
  6. Try to write the test cases as well so that you will be sure about the functionality is working properly.
ruby on rails

Feel free to let me know if you face any issue or wish me to work on your ruby on rails update. I will be happy to assist.

Thanks,

Manish S