Solidity – Ethereum’s Programming Language for Smart Contraction
Solidity Programming Language - Advantages and Disadvantages

The rise of digital dependency within business environments has brought upon the need for safer and more robust technologies for handling digital transactions. In the past half-decade, many technological updates have enabled business processes to be faster, more streamlined, safer, and better understood by stakeholders. The introduction of smart contracts, for example, has gone a long way in revolutionizing how companies enter into business agreements. Businesses now have a clearer way of working together through tools that have been built by emerging contract-oriented programming languages like Solidity.

A fairly new language, Solidity was created to run on the Ethereum Virtual Machine (EVM) and allow users who use the Ethereum digital transaction ledger to generate smart contracts. For the most part, contract-oriented programming languages like Solidity borrow heavily from its predecessor, object-oriented programming (OOP). It has been argued before those languages like Solidity were not required since languages like C# and C++ were able to handle smart contraction. However, with COP languages, there are additional functionalities which optimize these contracts to a higher level.

Introduction of interface specifications such as preconditions, post-conditions, and invariants within smart contract languages make the process easier and more understandable for the users and the developers. In fact, it is these interface specifications that are referred to as the “contracts” of contract-oriented programming as they form the basis for smart contract generation.

Ethereum also wanted a language that would run on its already created EVM rather than have to generate compilers for already existing languages, so Solidity was generated. Like any other programming language, Solidity came with its advantages and disadvantages.

THE ADVANTAGES

Inheritance Support

One advantage which Solidity borrows from OOP languages is the support for inheritance properties within its constructs. Through inheritance, developers can create abstract classes with shared definitions and find out how to implement them differently from within the classes. Through inheritance, there is support for hierarchical mapping. An added advantage of inheritance is the ability to utilize member variables within objects and classes. Pre-defined variables can be applied to various functions to come up with the desired result, which reduces a load of code within the contracts.

Application Binary Interface (ABI)

ABI is an interface which facilitates interactions between two binary programs or applications. It determines factors such as the binary formats through which information is passed between the applications, as well as the functions which will be called to perform the tasks of passing this data. ABIs allow its users to determine whether or not the data returned from a function is the right one and of the right type. This is essential for smart contractions as it facilitates type-safe functions within a contract and ensures the right datatype is returned as validated by the compiler.

THE DISADVANTAGES

New Language

The biggest disadvantage which can be seen from Solidity is that which all programming languages have faced at some point – it is a young language. For developers, this means that there may be very few libraries and reference materials which may also not contain as much information concerning its structures and various components. This will make learning the language a difficult task for those who will embark on learning it.

Another disadvantage that can be seen from the language being young is the possibility of anti-patterns within the code structures. Anti-patterns are practices which are generally discouraged in programming practices. Usually, they are code patterns which make code less readable or those which slow down an application during its use. The lack of documentation on best practices when it comes to using Solidity may result in anti-patterns which may be unrecognizable until later in the future.

Transactional Operation

Because Ethereum runs on Blockchain technology, it is impossible to acquire data into the systems except through transactional operations. This can be a major problem when it comes to factors such as volatile data. Stock exchange prices and the prices of valuables such as gold are usually changing every now and then. The demand for regular goods and services also changes seasonally and this has an impact on their prices. Ethereum, through Solidity, cannot acquire and update this information on the fly. It will have to depend on transactions to be updating such trivial changes in various forms of data.

Limited expressiveness

A derivative of the first problem mentioned, Solidity has the task of convincing developers and users into shifting to its libraries from already established programming languages such as JavaScript and Python. The language has a limited scope of expressiveness and developer capabilities thanks to its library which is only just growing, so it may be difficult for developers to undertake and explore some of the ideas they may have by using the language.

Ethereum is an already established technology which has managed to stay at par with most of its competitors. While innovations such as the EVM and Solidity give it an upper hand in terms of use, it may be difficult to bring everyone else on board with the idea for now. Perhaps developers may show greater interests when the language will have grown a lot more than it is now.

Latest Articles

VisionPro_Apple
June 14, 2023
VisionPro on the Horizon: Why MR App Development Doesn’t Sleep

Imagine you’re standing at the threshold of Apple’s new XR headset release, eyes keenly following the stock market reactions and your inbox buzzing with LinkedIn updates about Unity’s burgeoning open positions. The anticipation is almost tangible – it’s like the tech industry’s equivalent of awaiting the final season of a blockbuster TV series. But alas, the actual release isn’t due until next year. Does this mean we press pause on developments? Absolutely not! You might wonder, “Why not take a breather?” The reason is straightforward: MR (Mixed Reality) app development waits for no one. If the groundwork is laid properly now, adapting our apps for the VisionPro release later will be as easy as swapping out smartphone cases. The secret weapon here is experience with the Unity engine. Companies fluent in this technology will navigate VisionPro development with an ease and agility akin to a seasoned marathon runner approaching the home stretch. Having experience with ARKit? That’s a bonus akin to having an extra energy gel in that marathon. And there’s more! Early access to VisionOS SDK is like getting the keys to a treasure chest. It offers an exclusive chance to study, tinker, and try out the first elements of emulation. It’s an opportunity to dive in and get your hands on the technology of tomorrow, today. Previous encounters with MR devices like Magic Leap, HTC Vive, Pico 4, and HoloLens 2 also offer invaluable insights. These devices, with their distinct programming languages, offer lessons in MR app development that are as comprehensive as they are diverse. They serve as a practical guide to the symphony of MR tech. When it comes to eye-tracking, gesture control, and voice control, it’s like we’re in a familiar neighborhood. Experience from working on platforms like Meta Oculus and HoloLens 2 instills confidence, despite the anticipation of some subtle differences with the upcoming VisionPro. However, the fundamentals will likely stay the same. So, to all XR enthusiasts out there, keep those VR goggles firmly in place and maintain the momentum of your MR app developments. While Apple’s new XR headset is an enticing frontier, there’s a lot to be accomplished in the meantime. And when VisionPro does eventually launch, you’ll be primed to embrace it with open arms and innovative apps. Image: Apple

How Game Developers Can Utilize ChatGPT in Practical Ways
April 20, 2023
From Idea to Implementation: How Game Developers Can Utilize ChatGPT in Practical Ways

Brief overview of ChatGPT and its potential uses in game development ChatGPT (Generative Pre-trained Transformer) is an artificial intelligence language model that has been pre-trained on a massive amount of text data. It is capable of generating human-like language and can be used for a variety of natural language processing tasks, including text completion, summarization, and translation. In game development, ChatGPT can be a valuable tool for generating code and providing suggestions or prompts for developers. By inputting a description of a desired game feature or behavior, ChatGPT can generate code that can help developers save time and improve the quality of their work. For example, ChatGPT could be used to generate code for complex AI behaviors, physics simulations, or other game mechanics. It can also be used to suggest improvements or optimizations to existing code. While ChatGPT is not a replacement for skilled game developers, it can be a valuable tool to help streamline the development process and allow developers to focus on the creative aspects of game development. As AI and machine learning continue to advance, it’s likely that ChatGPT and other similar tools will become increasingly important in game development and other fields. Introduction to the specific task of creating floating stones that change speed based on the player’s distance In an existing game, I was tasked with implementing a group of floating stones that would change behavior as the player moved closer to them. In their idle state, the stones should float smoothly and slowly, but as the player approaches, they should start to jitter more and more. This required creating a class, implementing dependencies, and other code that couldn’t be achieved through animator controllers or libraries. While this wasn’t a “nightmare” level task, it was still time-consuming. ChatGPT proved to be a useful tool for generating code snippets and saving time in the development process. Explanation of how ChatGPT can be used to generate code for game development tasks When working with ChatGPT, it’s important to start with the right context. In my case, I began with a promo message about the technology I planned to use. It’s important to keep in mind that ChatGPT is just a tool and won’t generate ideas or code on its own. You need to provide clear and detailed input for the best results. That said, ChatGPT can be a real-time-saver. When using the tool, it’s essential to provide a detailed description of what you’re trying to achieve. The more information you provide, the better the output will be. It’s important to note that using ChatGPT should take less time than achieving the same result without it. So, don’t be afraid to put in the effort to provide a detailed description. With ChatGPT, you can streamline your development process and focus on other aspects of your project. Example prompts and code snippets used to generate the necessary code for this task Let’s dive into the practical use of ChatGPT. As I mentioned earlier, I started by providing context about my game engine and coding language. I want to ask you to help us create some code for my game based on Unity SDK, C# code language. ChatGPT responded kindly, and I moved on to the next step — providing a detailed description of the task and its conditions. A few words about the context of the task. In the game, players can find floating stones. These stones have random directions of jittering, but this jittering is very smooth. If the player appears within around 10 meters of the stone, the jittering speed becomes faster and the speed depends on the player’s distance to the stone (more if closer). As a result, ChatGPT provided me with a basic realization of the class I needed to implement. While the code wasn’t perfect, it covered around 80% of what I needed to do. using UnityEngine; public class FloatingStone : MonoBehaviour { public float maxSpeed = 1f; public float minDistance = 10f; private Vector3 initialPosition; private float initialSpeed; private bool isPlayerNearby; private void Start() { initialPosition = transform.position; initialSpeed = Random.Range(0.2f, 0.5f); } private void Update() { float speed = isPlayerNearby ? CalculateJitteringSpeed() : initialSpeed; transform.position = initialPosition + new Vector3( Mathf.PerlinNoise(Time.time * speed, 0) – 0.5f, Mathf.PerlinNoise(0, Time.time * speed) – 0.5f, Mathf.PerlinNoise(Time.time * speed, Time.time * speed) – 0.5f ); } private float CalculateJitteringSpeed() { float distanceToPlayer = Vector3.Distance(transform.position, PlayerController.instance.transform.position); float speed = Mathf.Lerp(initialSpeed, maxSpeed, (minDistance – distanceToPlayer) / minDistance); return Mathf.Clamp(speed, initialSpeed, maxSpeed); } private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { isPlayerNearby = true; } } private void OnTriggerExit(Collider other) { if (other.CompareTag("Player")) { isPlayerNearby = false; } } } Next, I made some corrections — I added context about using Zenject for player injection and refactored the class to align with project conventions. I then asked ChatGPT to use my updated code version and add jittering rotation to the object based on the same conditions. After this step, I received the final version of the code that I could use in my project. I made some minor changes on my end, and in the last step, I asked ChatGPT to add XML comments to the final class and received the desired result. The final result of the code public class FloatingStone : MonoBehaviour { [SerializeField] private SpeedSettings speedSettings; [SerializeField] private float minDistance = 10f; [SerializeField] private float amplitude = 0.5f; [SerializeField] private float rotationAmplitude = 1f; [SerializeField] private new SphereCollider collider; private Vector3 initialPosition; private Quaternion initialRotation; private float initialSpeed; private bool isPlayerNearby; private Transform player; [Inject] private void Constructor(IPlayer player) { this.player = player.Transform; } private void Awake() { initialPosition = transform.position; initialRotation = transform.rotation; initialSpeed = speedSettings.GetRandomSpeed(); collider.radius = minDistance; } private void Update() { float speed = isPlayerNearby ? CalculateJitteringSpeed() : initialSpeed; Vector3 newPosition = initialPosition + new Vector3( Mathf.PerlinNoise(Time.time * speed, 0) – amplitude, Mathf.PerlinNoise(0, Time.time * speed) – amplitude, Mathf.PerlinNoise(Time.time * speed, Time.time * speed) – amplitude ); Quaternion newRotation = initialRotation * Quaternion.Euler( Mathf.PerlinNoise(Time.time * speed, 0) * rotationAmplitude – rotationAmplitude…

Colorblind-friendly Solutions For Creating Visual Content
January 25, 2023
Colorblind-friendly Solutions For Creating Visual Content

According to National Eye Institute, in average, every twelfth person in the world has one of types of color blindness. So, there are, at least, 300 million people who live with this deviation.  When you should convey some information, using, for example, colored charts, it can become a problem. Visual content simplifies the perception of information, but, in this case, you may not do colorblind people a favor.  In our article, we selected five other article, that can tell you about the key moments you should consider when creating visual content for people with color blindness. What Is Color Blindness According to Wikipedia, color blindness or color vision deficiency is congential or acquired decreased ability to see some colors or differences in color. People with color blindness have difficulties to recognize the color on traffic lights, puzzles, color-oriented games etc.  There are two types of color blindness:  Partial — when human eye can’t see certain colors. There are most popular types of partial color blindness: protanopia (warped perception of red shades), deuteranopia (human eye can’t see green shades), and tritanopia (warper perception of blue and violet shades). According to Ali Levine, the author of True Colors: Optimizing Charts for Readers with Color Vision Deficiencies article, if a person can’t see, for example, red color, it influences other colors too. “A common misconception among those who are not colorblind is that if someone has red/green color blindness, they only have trouble with the colors red and green. However, these deficiencies can easily affect other colors as well; for instance, maroon and brown can look identical to people with red/green color deficiencies… after all, maroon is just brown with a touch of red. In other words, it is not just the colors red and green themselves, but also those colors within other colors,” wrote Levine.  Full — when human eye can’t see colors at all and perceives the world around monochrome. Basically, a person with deviation like this sees the world as a black-white movie.  How You Can Visualize Data For Colorblind People Here, you can read five interesting articles about the most effective solutions for colorblind-friendly visual content: The Best Charts For Colorblind Viewers This is the article by Ivan Kilin, Visual Data Specialist, that contains detailed information about, how colorblind people see and what color palettes are the most suitable for them. Also, the material  has a lot of examples of colorblind-friendly charts and palettes. The source: https://www.datylon.com/blog/data-visualization-for-colorblind-readers True Colors: Optimizing Charts for Readers with Color Vision Deficiencies Clear and interesting aforementioned article by Ali Levine. The author writes about color blindness and describes effective ways to create data visualizations for colorblind people. Also, Levine mentions special apps and simulators that recreate the vision of people with color blindness. Coblis is the one of examples of these simulators, and you can find the link to the program in the article itself. The source: https://itstraining.wichita.edu/optimize_for_vision_deficiencies/ How to Use Color Blind Friendly Palettes to Make Your Charts Accessible The article by Rachel Gravit describes the ways to make your visual content more inclusive. You can thus make your pie chart more understandable for colorblind people using bright contrasting colors, monochromatic color palette or different ornaments to highlight segments of pie chart.  The source: https://venngage.com/blog/color-blind-friendly-palette/#5 Why Your Data Visualizations Should Be Colorblind-friendly The article by developer Leoni Monigatti tells about the matter of color and the way every person sees colors, depending on type of color blindness. This article in not about pie charts only, there’s some useful information about any other types of data visualization.  The source: https://towardsdatascience.com/is-your-color-palette-stopping-you-from-reaching-your-goals-bf3b32d2ac49 Contrast and Color It’s the article by Maureen A. Duffy from Vision Aware, an online media for those who have vision deviations. The author briefly describes the principles of making right color decisions in design. Duffy recommends paying attention to bright and contrasting colors, because they are suitable for people with color blindness. Colors like blue, yellow, violet, and green are hard to see for colorblind people.  The source: https://visionaware.org/everyday-living/home-modification/contrast-and-color/    We hope this article was useful for you. The approaches to creating colorblind-friendly visuals will make your visual data more inclusive and understandable for customers and colleagues that can’t see and distinguish some colors. 



Let's discuss your ideas

Contact us