# 🦾 Weekly Topic: Most Challenging Coding Task or Concept

**URL:** <https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290>\
**Category:** Arcade\
**Created:** [October 21, 2024, 5:28pm UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290 "2024-10-21T17:28:43Z")\
**Posts on this page:** 15\
**Page:** 2

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [October 21, 2024, 11:21pm UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290/21 "2024-10-21T23:21:26Z")

</div>

@WoofWoof it is not possible to get a list of the functions/variables exported from a namespace at runtime in MakeCode.

The JavaScript language that MakeCode uses is something we like to call “Static TypeScript”. It’s based off of the [TypeScript](https://en.wikipedia.org/wiki/TypeScript) programming language but has a few restrictions/differences to make it possible for us to compile down to something that can run on extremely low-end hardware (like a micro:bit). You can find out more info on the differences between Static TypeScript and vanilla TypeScript [here](https://makecode.com/language).

Normal TypeScript gets converted into JavaScript, which is interpreted in your browser or in a runtime like Node.js. I won’t get into how code interpretation works here, but suffice to say it requires hardware with more RAM and CPU power than devices like the micro:bit have. To get around this, we actually compile Static TypeScript from text to binary code much like how a compiler for a language like C++ would. This lets us create code that is much more efficient and can run on inexpensive hardware.

Anyways, back to your original question: in regular TypeScript, you can iterate over the exported functions/variables in a namespace [like this](https://www.typescriptlang.org/play/?#code/HYQwtgpgzgDiDGEAEAXaKkG8BQSkQA8YB7AJwwDMBXYeFAS2OCQHcALENANwlIAoAlFmy4kAXxF5CJckgA2EDGACeANRCl6IAEYKkAXiQAmAAzYJ2CmSR94TKBi4g5VZMQpIA8toBWEOgB0ANYQylB8aA4CQjh4dsBQxAoBcsQA5nxOLhAC5thAA). That’s because regular TypeScript implements namespaces as JavaScript objects, which work with `Object.keys()`.

That same code is [an error](https://makecode.com/_6c20twg9giMw) in MakeCode, because we implement namespaces differently.

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [October 21, 2024, 11:27pm UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290/22 "2024-10-21T23:27:25Z")

</div>

Another common point of confusion is the difference between Java and JavaScript. Java actually has absolutely nothing to do with JavaScript! The languages are very, very, different and they are used for very different purposes.

The reason JavaScript is called JavaScript is because the creator thought it would be a good marketing move to give it a name that referenced an already popular programming language. IMO this was a terrible decision, because now everyone gets super confused whenever the two are brought up.

It’s like if I decided to make a programming language and name it C+++ just for name recognition.

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [October 22, 2024, 2:40am UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290/23 "2024-10-22T02:40:24Z")

</div>

I would 100% use c+++ if I could use it to get a list of all variables in a namespace. I suppose I would also like to declare variables in this language too, but that’s a want, not a need.

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [October 22, 2024, 2:41am UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290/24 "2024-10-22T02:41:05Z")

</div>

the most annoying thing i’ve tried to code is defo procedural generation, especially my [Random Map Event Generation 🗺](https://forum.makecode.com/t/random-map-event-generation-like-slay-the-spire/29739) just because how complicated it was to

1. randomly generate something with enough variation to be unique yet consistency so it’s actually playable
2. store that data with nested arrays (store map data)
3. track player position on the map as an array
4. draw the map and player location data to a sprite that works the same way each time it’s opened

and in blocks 🫠

* * *

When it comes to extensions like block objects, sprite data and mini menu, what I found useful was to look at the code of existing projects and figure out my own code using that as a template  
That can be very difficult for starting right out so tutorials like this: [[Tutorial] What are block objects, and how to use them](https://forum.makecode.com/t/tutorial-what-are-block-objects-and-how-to-use-them/24274) are super helpful. ty @Sarge : D

* * *

Finally, scope creep, the death knoll of all my projects lol  
How it usually goes is like such:

- make some cool code
- get inspired and massively overplan game to become unreasonably large, complex and difficult to code
- burn out halfway and never finish the game

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [October 22, 2024, 2:41am UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290/25 "2024-10-22T02:41:18Z")

</div>

Thanks a lot for this explanation! My disappointment is quite measurable and my day is most definitely not ruined. That Java / JavaScript thing is definitely why I couldn’t find solutions online, though I suppose I would have been even more confused upon finding a working method and it not working in Makecode.

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [October 22, 2024, 2:41am UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290/26 "2024-10-22T02:41:26Z")

</div>

> [@richard](#):
>
> C+++

“C makes it easy to shoot yourself in the foot. C++ makes it harder, but it blows your whole leg off when it does.” What would C+++ do? 🤔 🤪 🤣

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [October 22, 2024, 3:38pm UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290/27 "2024-10-22T15:38:37Z")

</div>

instant death.

---

<div class="post-metadata">

**Author:** ![CreativeUsername](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/creativeusername/32/9601_2.png) [@CreativeUsername](https://forum.makecode.com/u/CreativeUsername)\
**Post date:** [October 22, 2024, 3:41pm UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290/28 "2024-10-22T15:41:51Z")

</div>

Cutscenes, music, level design, and looking at past code

---

<div class="post-metadata">

**Author:** ![49dev](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/49dev/32/8577_2.png) [@49dev](https://forum.makecode.com/u/49dev)\
**Post date:** [October 22, 2024, 4:34pm UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290/29 "2024-10-22T16:34:27Z")

</div>

My problems mostly stem from what little time I have to work on my games. I’m also a bit too imaginative and strive for a game that’s a lot better than what I can actually produce. (i.e, my imagination is overactive.)

---

<div class="post-metadata">

**Author:** ![Gl125371](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gl125371/32/29131_2.png) [@Gl125371](https://forum.makecode.com/u/Gl125371)\
**Post date:** [October 22, 2024, 8:09pm UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290/30 "2024-10-22T20:09:17Z")

</div>

Raycasting.

---

<div class="post-metadata">

**Author:** ![PixelDoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/pixeldoodle/32/24129_2.png) [@PixelDoodle](https://forum.makecode.com/u/PixelDoodle)\
**Post date:** [October 22, 2024, 8:09pm UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290/31 "2024-10-22T20:09:48Z")

</div>

Motivation 😔

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [October 22, 2024, 8:10pm UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290/32 "2024-10-22T20:10:30Z")

</div>

Oof. Looking at past code hurts. I always avoid looking at it because I know it will be untraceable spaghetti. Then again, it’s a nice way to see how far I’ve come!

---

<div class="post-metadata">

**Author:** ![ChimbroDaPro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/chimbrodapro/32/15852_2.png) [@ChimbroDaPro](https://forum.makecode.com/u/ChimbroDaPro)\
**Post date:** [October 22, 2024, 9:08pm UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290/33 "2024-10-22T21:08:31Z")

</div>

> [@CreativeUsername](#):
>
> looking at past code

ABSOLUTE TORTURE…

Those days where you’d set a variable to false, and instead of saying “if NOT(variable)”, you say “if (variable)=false” LIKE BRO YOU HAD ONE JOB! ONE! JOB!

---

<div class="post-metadata">

**Author:** ![Vegz78](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/vegz78/32/1201_2.png) [@Vegz78](https://forum.makecode.com/u/Vegz78)\
**Post date:** [October 28, 2024, 10:02pm UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290/34 "2024-10-28T22:02:44Z")

</div>

> [@UnsignedArduino](#):
>
> > [@richard](#):
> >
> > …make a programming language and name it C+++ just for name recognition.
> 
> “C makes it easy to shoot yourself in the foot. C++ makes it harder, but it blows your whole leg off when it does.” What would C+++ do? 🤔 🤪 🤣

Hahaha!

@richard and @UnsignedArduino: You mean like the 4 plusses in C# and the added amplification of pain for each new plus, respectively? 😉

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [October 28, 2024, 10:03pm UTC](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290/35 "2024-10-28T22:03:56Z")

</div>

i would much rather code in C# than C++!

heck i’d rather code in C than C++ too

[Previous page](https://forum.makecode.com/t/weekly-topic-most-challenging-coding-task-or-concept/31290.md?page=1)
