wtaysom
03/30/2024, 10:10 AMTranslating the same Scratch program to C# requires a different approach because C# is often used in desktop applications, and there's no direct equivalent of the Canvas API like in web technologies. However, you can use Windows Forms or WPF (Windows Presentation Foundation) for graphical applications in C#. Here, I'll provide an example using Windows Forms to create a simple drawing application that mimics the Scratch program's behavior.If you check my conversation, you'll see I start asking what a "partial class" is having never heard the term. Chat parroted:
Using partial classes in this way provides flexibility. You can start with all your code in one file for simplicity. Then, if the class grows or you decide to use the designer, you can easily refactor the designer-generated code into its own file without changing the class's functionality. This approach keeps your custom code separate from the auto-generated code, making it easier to read and maintain.I explained that every language, every tool has many such conventions. You learn the ones reverent to whatever you're doing right now, but learning them all is impossible. Instead the real skill is knowing that you don't know and being able to find out quickly. We're lucky that a these things are obscure, come up often, and are discussed on the Web. Thus LLMs are especially good at helping with dumb programming problems. So why use the established languages besides Chat knowing them well? I thought of three reasons: • Expressivity — Blocks will get a beginner pretty far, but you'll find the others have constructs that helpful for saying things that would be very hard with blocks. You won't appreciate scratch until you feel the itch. • Causal Powers — The block system will let you do things in class you'll learn core ideas, but the blocks themselves won't work everywhere. JavaScript, on the other hand, works all over on the web, and C# has its own ecosystem. Often there's bridging, but also one or other language will be the most natural one for certain kinds of work. • Scale — With big and medium sized programs being done with text, editors for wrangling it, and version control for keeping track of it exist. They can we weirdly powerful and janky. But you're liable to start having a hard time keeping track of blocks when it takes a dozen or more screens to fit them all.
Christopher Shank
03/31/2024, 5:14 PMArvind Thyagarajan
04/02/2024, 7:22 PMDeclan Naughton
04/26/2024, 9:34 PM