the world needs more recreational programming.
like, was this the most optimal or elegant way to code this?
no, but it was the most fun to write.
This is me when I get to manipulate the DOM with vanilla JS.
document.getElementbyId()?
element.classList.add()?
element.addEventListener("click", doThing)?
Yes pls let me chew on this juicy, logical, non obfuscated code! 🤤
cause like, yeah, it's good to know how to write optimal code and how to make it elegant and easy to maintain, sure!
but one thing you have to maintain is your brain. If you're constantly driving your programming brain at maximum speed, maximum awareness of all possible caveats and vulnerabilities, always considering "how will I maintain this code in ten years time?" you're going to burn yourself out.
You're associating programming with a high-stress high-attention activity. That's going to make programming something that's categorized in your brain as no fun, never relaxing, never something you do just cause it would be interesting... you're going to start dreading it, even just a little. "oh well, let's get this over with."
That's not a good way to think about it in the long run.
we often say that programming is more an art than a science, but we need to treat it like one too.
Sometimes you need to paint a sunset not because someone paid you to paint a sunset, but because it'd be fun to paint a sunset.
i know your whole point is that we shouldn't only ever try to be practical, but as an additional bonus, i genuinely think all the hours of code golf i did for fun have made me a better programmer
not that any "normal" code i ever write looks golfed at all, but you learn so much about a language when you're digging into the weeds looking for ways to save bytes
https://www.youtube.com/playlist?list=PLllZnrEJu89Cpu4tMO8LAg1m6gWYWLSGJTip on Ko-fi: https://ko-fi.com/lgug2zSponsor on GitHub: https://github.com/LGUG2Z/ko...YouTube
I wish I could do this, but I'm no good at "patter", especially while I'm coding.
I also use a font size that I have been told is "insanely small", and I suspect video compression will make it unreadable.
But, I don't mind showing off my ~~mistakes~~ happy little syntax trees and I've (re)started coding for myself several hours each day.
I really should find an PeerTube instance or something and start streaming; I can work on video quality and viewer interaction later, I guess.
Watching Andreas Kling work on SerenityOS in his FIXME Roulette or Browser/OS/Language/Etc Hacking series is giving me the same vibe.
https://youtube.com/@awesomekling
Hello friends! I'm working on SerenityOS and Ladybird, an operating system and a web browser!YouTube
Hello friends! I'm working on SerenityOS and Ladybird, an operating system and a web browser!YouTube
Come now.
Programming is an engineering discipline! There are very few happy little accidents. You want code that does exactly what you intended it to.
Everyone understandably loves Bob Ross, I do too, but he isn't a good example for programmers, engineers, surgeons, or airplane pilots to follow.
@pippin Even in the demo scene, 98% of the accidents are errors that need to be corrected or else nothing will happen (I did write "very few happy accidents", not "no".)
And hacking on old machines is even more exacting. When people get unexpected results out of old gear, it's the result of a huge amount of systematic, exploratory trial and error, much closer to science than art.
1/
@pippin I play jazz on occasion. In an improvised solo, no individual note is "wrong", even if it was unintended or in the "wrong key". You often play a couple of "random" notes, just to see where it will lead you.
In programming, you might have 100 possible keystrokes you could make at any point, of which 95 won't generate anything useful.
No discipline is all or nothing on this: but programming is very heavily biased toward pre-planning and systematic experimentation over chance.
@pippin
If a typical drawing is made up of 200 strokes, and each stroke has a 98% chance of being "wrong" and spoiling the drawing, then that would mean that 99.99999...% of drawings would be wrong.
(Nearly all drawings or paintings are built up of a large number of small gestures, and an error in any one of them isn't usually significant.)
I live with someone who's a trained draftsperson for art: this is a skill only peripherally related to what Bob Ross does.
All aboard! The Coding Train is on its way with creative coding video tutorials on subjects ranging from the basics of programming languages like JavaScript to algorithmic art, machine learning, simulation, generative poetry, and more. Choo choo!YouTube
Volunteer-driven episode guide for The Joy of CodingThe Joy of Coding: Episode Guide
His name is Thor.
https://youtube.com/shorts/SauckmAA2oI
Watch the stream here:https://piratesoftware.live#Shorts #Twitch #PirateSoftwareYouTube
Hello, on this channel I explore how to create stuff out of code. I hope you find some of it interesting!YouTube
a litte bit of a loop here and a new Variable there
Look at this beautiful code
Now we need a new class here *now is code ugly*
Welcome aboard! This is the introductory video to start programming JavaScript with p5.js for total beginners. Code: https://thecodingtrain.com/tracks/code-p...YouTube
there is a practical side to this as well. "Happy trees" code is almost guaranteed to be easily maintained code. Most 'optimised' code I see is optimised to feed the programmer's ego and little else.
But I'm left with a big question: what is the equivalent of beating the devil out of your brush? Should I bash my keyboard against the leg of my desk?
Today we are painting a landscape using mathematics.Support this channel: https://www.patreon.com/inigoquilezBuy this painting in a metal, canvas or photogra...YouTube
I've made a Ray Tracer in x86 assembler code based on the amazing Ray Tracer for Atari 8-bit BASIC developed by D. Scott Williamson.It fits on a boot sector,...YouTube
however, we recommend against making a physically accurate raytracer for sunsets
we tried to do that one weekend
the primary thing we learned was not to try to make a physically accurate raytracer for sunsets
The demoscene is an international, decentralised and non-commercial subculture focused on the production of digital audiovisual works.German Commission for UNESCO
“…never something you do just cause it would be interesting…”
This is exactly the reason I set aside time every year to do Advent of Code. Fun little daily projects that ultimately don’t matter in the grand scheme of things, yet I do end up learning one of two new techniques or algorithms every year from it. I know I will never see the global leaderboard, but I challenge myself to complete each day before looking up other solutions. #AlwaysLearning
This is one reason I started a creative coding meetup a few years ago.
No expectations, no unit testing, no code reviews, no bugs, just pure fun and some luck.
Some called it the antidote to their day job.
Others said it felt like their first steps at coding as a child.
By the same argument, you burn your brain out if you use good grammar.
What actually goes on is this: you learn how to write clear, maintainable code through practice and self-examination, and then it becomes a habit, so it takes no effort at all.
For example, I use assertions quite a lot when I initially write code, just so they go off if something goes wrong. I don't even think about it as I do it. Later, I remove most of them because they're clearly redundant.
* If you have the time, defer things with TODOs. Yes, that's the path to tech debt, that's why I started with "if...".
* Write tests, positive and negative, before (TDD), meanwhile and after. As many as you can think of without straining. Real life will provide you with more. Integration tests, for each layers if possible.
* Start writing with comments and or pseudocode. If the latter and your programming language is #Python, you're halfway there.
I wish it was that easy on the Ops side.
I've been kinda doing that with my python dice rolling script, but with the added fun challenge of also being able to provide an optional statistics report including the polynomial generating function that gets all the useful probability stats if --verbose is set.
It's more meant to be a fun trip into the math of dice probability than being a useful dice rolling script, but I get a useful dice rolling script out of it as a bonus so hey presto.
@dragonarchitect yeah that's the kind of feature you used to see a lot more of in games and such back in the day.
I think Kris Asick of Ancient DOS Games talked about this once, saying some feature feels like it's just there because the programmer thought it would be fun to add.
Like, is the script complete enough without this? Yeah. Does it really need this? Nope. Did it scratch a fun itch to add it? You bet!
"Like, is the script complete enough without this? Yeah. Does it really need this? Nope. Did it scratch a fun itch to add it? You bet!"
Hell yeah! 😄
I just haven't touched the script in a long, long while, because I've also wanted to have a little fun diving into the wonderful world of OOP in Python, but hoo boy that's an extra level of complexity that fucks with my head a bit. 😵💫
I've recently gotten into writing a couple of mods for Stardew Valley, the main one being a web service that gives other apps realtime info about the game.
Is it elegant? Hell no.
Are there better solutions? Probably.
Am I needlessly reinventing bits of ASP.NET Core for my own amusement and just to say that I can? You bet.
And I doubt anyone other than me will ever find this useful. But it sure has been a fun way to spend the last 2 weeks & I'm learning stuff/refreshing old knowledge.
Not sure if this it what you had in mind with recreational programming, but I enjoy the Tsoding streams/videos a lot.
I miss _why :(
But I also liked watching interview with Joe Armstrong. He seemed like the friendly uncle of programming languages.
i started an Algorithmic Art meet-up in London and I found it was wildly popular - it grew from zero to over 4700 members in 2 years!
people did it for many reasons but a common theme was an antidote to the developer day job
I have always had a habit of having big ideas for programs and working on them in my spare time and then getting bored of them when it starts to get tedious. I used to regard these as failures, but recently, I've started to see it in this light.
Sometimes, people have art books and they just draw in there. Not because they're going to publish a comic or anything, but because they like drawing.
That's what I'm doing with my recreational programming.
20 GOTO 10