# How I learned to Program

**URL:** <https://forum.electromage.com/t/how-i-learned-to-program/971>\
**Category:** Pixelblaze Academy of Wizardry and Enchantment\
**Created:** [February 8, 2021, 4:02am UTC](https://forum.electromage.com/t/how-i-learned-to-program/971 "2021-02-08T04:02:09Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![zranger1](https://forum.electromage.com/user_avatar/forum.electromage.com/zranger1/32/301_2.png) [@zranger1](https://forum.electromage.com/u/zranger1)\
**Post date:** [February 8, 2021, 4:02am UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/1 "2021-02-08T04:02:09Z")

</div>

I’d just like to encourage everybody to participate whatever your skill level might be at the moment, and not to worry about other people working on their own stuff at different levels in the background. Remember:

EVERY SINGLE PERSON HERE WAS AN ABSOLUTE BEGINNER AT ONE POINT.

People helped us. And the learning never stops. People still help us all the time. We’re more than happy to pass that along. There’s something here for everybody, so dive in, ask many questions, share code and learn with us!

Personally, the two things that helped me the most with programming were:

- Playing with example code (in my case, laboriously typing in and debugging programs from Byte magazine.)
- Asking questions. Super important! I made a great pest of myself in the computer lab, but the established hacker people were helpful and tolerant. Slowly, I learned and improved, 'till one day, people were asking **me** questions, which still seems weird, but that’s pretty much how the wheel turns.

---

<div class="post-metadata">

**Author:** ![Scruffynerf](https://forum.electromage.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@Scruffynerf](https://forum.electromage.com/u/Scruffynerf)\
**Post date:** [February 8, 2021, 9:52am UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/2 "2021-02-08T09:52:40Z")

</div>

Excellent thoughts. I believe the best way to learn is to take on tasks that require stretching. And failing isn’t a bad thing, it’s a way to learn more, as you learn how to do it.

---

<div class="post-metadata">

**Author:** ![JustPete](https://forum.electromage.com/user_avatar/forum.electromage.com/justpete/32/1832_2.png) [@JustPete](https://forum.electromage.com/u/JustPete)\
**Post date:** [February 9, 2021, 3:44am UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/3 "2021-02-09T03:44:40Z")

</div>

I printed out a thing from electromage I hand-titled “An Introduction to Pixelblaze Code” but didn’t not the exact link and cannot now find it on the site. It looks like some interactive format allowing real-time editing…

I’m getting lost with terminology/syntax so I’ve started an Excel sheet with things like “array”…  
what is an array, and what is its basic use?

I still do not really know.

“Slider”… a way of taking a variable out of the bulk code so it can be easily varied?

Still not sure about delta… etc.

Working on it.

---

<div class="post-metadata">

**Author:** ![Scruffynerf](https://forum.electromage.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@Scruffynerf](https://forum.electromage.com/u/Scruffynerf)\
**Post date:** [February 9, 2021, 6:33am UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/4 "2021-02-09T06:33:08Z")

</div>

Introduction is a pattern, I believe.

Array = a group of values, each in a slot, starting at zero.

So samplearray[0] is the first value  
Samplearray[1] is the second. And so on.  
Limitation of PB: you need to set the size of an array ahead of time and can’t change that later.

Slider: add a slider to the interface so you can adjust the value. Look at some examples.

Delta, good discussion recently. Basically it’s how long it took to render one set of pixels.

---

<div class="post-metadata">

**Author:** ![JustPete](https://forum.electromage.com/user_avatar/forum.electromage.com/justpete/32/1832_2.png) [@JustPete](https://forum.electromage.com/u/JustPete)\
**Post date:** [February 9, 2021, 10:43am UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/5 "2021-02-09T10:43:21Z")

</div>

Yes , Intro is a pattern, thank you!

1 OK. So an array is a one dimensional “string” of values… super.

1. Can one “fill” an array with non-math-derived values, say 100, 325, 450, 300 … use them, say, to drive number of LEDs lit?

2. Delta is a dependent variable, correct? That’s where I got stuck, not its definition but its relationship. On my presently somewhat confused state, it seems to be great variable “art” to mess with delta thru code.

3. Your help is brilliant, exemplary. Super.

---

<div class="post-metadata">

**Author:** ![Scruffynerf](https://forum.electromage.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@Scruffynerf](https://forum.electromage.com/u/Scruffynerf)\
**Post date:** [February 9, 2021, 11:13am UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/6 "2021-02-09T11:13:51Z")

</div>

You can fill an array with any values, yes.  
It’s just an ordered set of values.

“Delta” is just a way to measure speed.  
To be clearer:

BeforeRender(howlong)  
Would put that measurement into “howlong”

Delta is just a convention, a standard name.  
It’s what we measured that matters.

---

<div class="post-metadata">

**Author:** ![devoh](https://forum.electromage.com/letter_avatar_proxy/v4/letter/d/c5a1d2/32.png) [@devoh](https://forum.electromage.com/u/devoh)\
**Post date:** [February 9, 2021, 5:12pm UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/7 "2021-02-09T17:12:40Z")

</div>

Many, Many years ago I was in a class where we were working on a raytracing program… and adding different functionality to it. To me the best part of the class was seeing the spectacular imagines that were generated from mistakes in code. There is beauty in chaos.

---

<div class="post-metadata">

**Author:** ![SeaLaVie](https://forum.electromage.com/user_avatar/forum.electromage.com/sealavie/32/666_2.png) [@SeaLaVie](https://forum.electromage.com/u/SeaLaVie)\
**Post date:** [February 9, 2021, 5:49pm UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/8 "2021-02-09T17:49:51Z")

</div>

> [@Coding practice while waiting on V3?](https://forum.electromage.com/t/coding-practice-while-waiting-on-v3/902/15):
>
> @SeaLaVie sure! You can view them all individually by clicking to expand each in [the pattern library](https://electromage.com/patterns/).
> 
> Also, if you just want a big collection of source code files, [this](https://github.com/jvyduna/pb-examples/tree/master/src) works for now (but will eventually be taken down when the next iteration of the pattern library is out, which will be backed by [this repo](https://github.com/simap/pixelblaze_patterns))

I found the links above very helpful as I was able to download the pattern code and see how it was working. I think this is what you are referring to earlier with the introduction pattern.

---

<div class="post-metadata">

**Author:** ![JustPete](https://forum.electromage.com/user_avatar/forum.electromage.com/justpete/32/1832_2.png) [@JustPete](https://forum.electromage.com/u/JustPete)\
**Post date:** [February 10, 2021, 5:10am UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/9 "2021-02-10T05:10:55Z")

</div>

> [@SeaLaVie](#):
>
> I found the links above very helpful as I was able to download the pattern code and see how it was working. I think this is what you are referring to earlier with the introduction pattern.

Can I download patterns while not connected to my PB, so as to edit/view? Not sure how to download patterns anyway…

that Github resource from @Jeff is amazing!  
There’s Kelvin to rgb color conversion, even!  
Now if I only knew what to do with it…! 😆

---

<div class="post-metadata">

**Author:** ![SeaLaVie](https://forum.electromage.com/user_avatar/forum.electromage.com/sealavie/32/666_2.png) [@SeaLaVie](https://forum.electromage.com/u/SeaLaVie)\
**Post date:** [February 10, 2021, 10:07am UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/10 "2021-02-10T10:07:53Z")

</div>

Yep just save the JS files from here  
[https://github.com/jvyduna/pb-examples/tree/master/src](https://github.com/jvyduna/pb-examples/tree/master/src)  
and change the file extension to TXT if you want /need to. Then you can open them with notepad or any cell phone app that reads text files.

---

<div class="post-metadata">

**Author:** ![zranger1](https://forum.electromage.com/user_avatar/forum.electromage.com/zranger1/32/301_2.png) [@zranger1](https://forum.electromage.com/u/zranger1)\
**Post date:** [February 10, 2021, 6:23pm UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/11 "2021-02-10T18:23:20Z")

</div>

If you’re using Windows, I highly recommend [Notepad++](https://notepad-plus-plus.org/) for this job. It’s fast, just as easy to use as Notepad or Wordpad, and has many more useful features, like:

- syntax highlighting for javascript (and other languages). This makes reading pattern code **much** easier.
- bracket/brace/parenthesis matching.
- column mode editing and lots of other tools for cleaning up weirdly formatted code or data.
- it has a plugin that understands markdown, so it’s great for writing readme files.

I use it every single day, even though I have multiple full featured IDEs ready to go. Sometimes you just want a lightweight tool.

(Also, if you’re on Windows, right click and use “Open With” to set the program associated with .js files to the editor you like to use. It saves you from having to rename them, and eliminates one possible way of running random evil code by accidentally clicking on it.)

---

<div class="post-metadata">

**Author:** ![SeaLaVie](https://forum.electromage.com/user_avatar/forum.electromage.com/sealavie/32/666_2.png) [@SeaLaVie](https://forum.electromage.com/u/SeaLaVie)\
**Post date:** [February 10, 2021, 11:42pm UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/12 "2021-02-10T23:42:38Z")

</div>

Great advice, I forgot about that notepad++ program. Anything you could recommend for an Android app to look at JS files?

---

<div class="post-metadata">

**Author:** ![zranger1](https://forum.electromage.com/user_avatar/forum.electromage.com/zranger1/32/301_2.png) [@zranger1](https://forum.electromage.com/u/zranger1)\
**Post date:** [February 11, 2021, 12:46am UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/13 "2021-02-11T00:46:42Z")

</div>

@sealavie, I’d say the paid version of DroidEdit, but it’s been a while – after a couple of incidents while traveling internationally in the before times, I’ve become very much a phone minimalist.

---

<div class="post-metadata">

**Author:** ![JustPete](https://forum.electromage.com/user_avatar/forum.electromage.com/justpete/32/1832_2.png) [@JustPete](https://forum.electromage.com/u/JustPete)\
**Post date:** [February 11, 2021, 4:02pm UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/14 "2021-02-11T16:02:21Z")

</div>

> [@zranger1](#):
>
> f you’re using Windows, I highly recommend [Notepad++](https://notepad-plus-plus.org/) for this job. It’s fast, just as easy to use as Notepad or Wordpad,

Super helpful!! Got it downloaded.

---

<div class="post-metadata">

**Author:** ![JustPete](https://forum.electromage.com/user_avatar/forum.electromage.com/justpete/32/1832_2.png) [@JustPete](https://forum.electromage.com/u/JustPete)\
**Post date:** [February 11, 2021, 4:10pm UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/15 "2021-02-11T16:10:33Z")

</div>

> [@devoh](#):
>
> Many, Many years ago I was in a class where we were working on a raytracing program…

Raytracing must have been amazing. Reflections in 3D and etc, plus refraction in translucent/transparent materials just to start with. All I ever did was some work in capture and light piping of UV in window glass, you know Snell’s Law stuff… in another life long ago.

Indeed, accidental stuff can be the seed of many fun things. That’s partly why we have to like the realtime editor for Pixelblaze. Besides, its just fun to play with.

---

<div class="post-metadata">

**Author:** ![wizard](https://forum.electromage.com/user_avatar/forum.electromage.com/wizard/32/4_2.png) [@wizard](https://forum.electromage.com/u/wizard)\
**Post date:** [February 11, 2021, 5:15pm UTC](https://forum.electromage.com/t/how-i-learned-to-program/971/16 "2021-02-11T17:15:56Z")

</div>

### How I learned to Program

The spark of interest for me was early in school. I think I was 9, and this other kid sat down at the computer, typed some stuff, and made his own text adventure game with _whatever he wanted_ right before my eyes. What sorcery is this? What a power to be weld by a mere mortal. I was enthralled.

For the next few years I spent whatever time and access I had writing beginner software and trading goodies from my lunch to other kids for programming secrets, and reading the code (and barely understanding any of it) for anything I could find. The more I tried and failed, the more small pieces started to click in to place and the secrets of coding were unlocked.

Perhaps to a professional my code was un-clever, redundant, inefficient, and clunky, but none of that mattered or matters as it was and still is pure magic to me.

I’ve taken few programming courses, my primary training has and continues to come from exploration and curiosity.
