Slapping the finishing touches on the New / rewrite of the Witness script.

in #steemegglast year (edited)

It took a little bit of time to get into the groove, however I shifted from Javascript over to Typescript .

The two are the same except one key difference... as you can assume Types.

In javascript your free to do as you wish , typescript allows you to set rules around What each piece of data in the system is supposed to be.

For instance in javascript I might say

ProcessVote(author permlink weight)
its up to me to make sure the value stored in the upvote variable to be correct.

in typescript it would look something like this

ProcessVote(author: string, permlink: string, weight: number)
this is gibberish but the key takeaway is those little identifieers to the right of the variables.

in javascript it will allow me to pass those numbers backwards... Only revealing the error once the program breaks.
Typescript start the program if any variables are passed incorrectly anywhere in the program so its very helpful longerm.

This is very stressful when theres hundreds even thousands of little functions to check this person see if that person got voted yet, or if the post is old enough so on so forth...

It esentially forces you to write cleaner code, as the computer is able to run validation when im writing the code to ensure everything is recieving the right dataTypes etc.

Long story short, I will be switching this on shortly, and hooking the website back up to it... that way no loose ends are still hanging... Once thats complete I will make the edits i had planned for Paid voting ... in Typescript... And the rest will be history!!!


Heres a free vote on behalf of @se-witness.

@steemegg hope you are doing good in life, I am the founder and owner of nftmc community on steemit. I need Little help and time of your to discuss regarding a project. Do you have discord/email, Or were can I contact you. Thankyou. 🙏

Coin Marketplace

STEEM 0.28
TRX 0.11
JST 0.031
BTC 69081.27
ETH 3757.89
USDT 1.00
SBD 3.68