02-19-2025 08:14 PM - edited 02-20-2025 10:13 AM
You may have come to love using CodeBlocks to create interactivity in your Horizon Worlds, but now there's a new way using Typescript, a programming language already used by millions of developers around the world!
Typescript is a more robustly typed version of Javascript, and has a ton of common language features you may know from other languages like C#, Python, Perl and others. Things like compound data types, classes, function calls, a variety of looping constructs _other_ than 'while', and more!
With this power, though, comes responsibility to use the language wisely. Typescript has a number of 'dark corners' and 'foot guns' that ensnare the unwary new developer. To aid creators, we have put together a "Typescript Conventions and Best Practices" document (linked below), with specific emphasis on Horizon Worlds, to help guide you through using the language in the safest and most productive way.
In this document you will find a minimal set of recommendations we encourage everyone to adopt, as well as a more 'extended' set of recommendations that are strongly advised. Each recommendation comes with some reasoning and examples of DOs and DON'Ts.
Finally, there is a section at the end with some VSCode plugin recommendations that may make your coding in Typescript more care-free by putting the editor in charge of properly formatting and identifying problematic bits of your code.
If you have any questions about conventions or best practices in typescript follow up to this post with your thoughts!
PDF attached below.
Link to web version: Meta Developers Website Documentation
02-22-2025 04:16 AM
Thank you! 😊