image made with Stable Diffusion
Hey Hivians!
So I learned coding (specifically full-stack web development focused on self-hosting) through a less formal route than getting a CS degree and so I feel I can provide a good bridge to people who want to learn in a more self-taught format. My entry-point was through engineering/physics where we did cool simulations like 🔥 heat transfer, 🌉 Finite Element Analysis, 🐰🦊 system stability analysis, and other fun mathematical stuff. I thought Web Development? No problem 😆 Since then I've been on quite a journey, which I think below summarizes.
A bit of statistical fun
This is just a fun way to demonstrate why programming (and technology in general) is statistically difficult because it really is like engineering the digital space. A program boils down to 1's and 0's and even a 1MB binary (compiled code) is comprised of a 8 million of these "bits" which I like to think of as building blocks and they all have to be in the right order! Without a stable foundation the structure will spaghetti into chaos.
Python Hello World Program
Let's take a higher level "simple" python Hello World script:
print("Hello World")
In that script, there are 20 characters (count them yourself!).
Each of those 20 characters can comprise of on of the following:
Characters to choose from
Lower-case letters
abcdefghijklmnopqrstuvwxyz
Upper-case letters
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Numbers
0123456789
Characters
` ~ ! @ # $ % ^ & * ( ) - _ = + [ ] { } \ | ; : ' " , < . > / ?
These amount to 94 different possibilities. Mind you, this is only taking into account common letters on a US keyboard (i.e., the ones that typical code recognizes) and not unicode, math symbols like Σ, emojis, which languages like Julia can use, and plenty more.
So, if we do a little statistical calculation (using python of course), let's just for fun see how many ways there are to type 20 characters using this simple set of possibilities. These are permutations, mind you, because order matters 011 is different than 110.
# Define the number of possible characters and the length of the sequence
num_options = 94 # Possible typical characters from a US keyboard
sequence_length = 20 # Length of the sequence "print('Hello World')"
# Calculate the total number of possible combinations
total_permutations = num_options ** sequence_length # note ** is
# Display the result
total_permutations
source: permutations formula
Result
The total number of possible permutations that one could create using 20 characters, where each character has 94 possible options, is approximately:
2.90 × 10³⁹ (or 2.9 undecillion)
Okay, so if you were to just jumble a bunch of of 20 letters with equal probability of each possible character, you would have a 1 in 2.9 undecillion chance of getting the correct script for print("hello world") if you were to try and reach it by randomly generating letters and this is the difficulty with programming! Obviously, this is extreme and no one is going to mess up so badly as most of those cases, but the point stands... statistically speaking, there are many "wrong" answers versus the few "right".
If you change on character in the code base, the entire thing breaks. Take it another level and consider that there are many ways to solve the same problem, but some play better with the overall structure of your code base using patterns that incredibly smart people have come up with over decades of iterations.
Open-source and AI
Enter the open-source world and AI. There are many tools that are available at one's fingertips to "build on the shoulders of giants" as they say. Some are good, some are not. Some are not only good but they're actually fun, like addictively fun (seriously, I recently disappeared from the social sphere for two weeks cause I got addicted to a problem, so a balanced lifestyle is super important 😄). I figure if people are interested, I could start posting some content on the tools that I have used that have saved me crazy amounts of time.
Conclusion
So anyway, if you've made it this far, thanks for reading. I'm new to this social media stuff, so I just want to get something out instead of nothing. This is quite long format, and I know my attention span would probably brush it off 😂
"The BUTT" 🍑 has informed me that vimm is like a Twitch for Hivians so maybe I'd start hosting some live streams showing the developer setup I've converged on over the years with some live coding sessions, environment setup, etc for any people who are learning to code.
Suffering is inevitable for all (coders) and probably the best have suffered the most. At the very least we can suffer less and do it together 🤗
PS I think my statistical analysis is correct, but I'd be lying if I said permutations and combinations still don't throw me for a loop sometimes 😵💫
Congratulations @padreug! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)
Your next payout target is 50 HP.
The unit is Hive Power equivalent because post and comment rewards can be split into HP and HBD
You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
Check out our last posts: