r/csharp • • 24d ago

Help Are there any extensions that can replace the code blocks( {} )

Ive been using Lua( Roblox Studio) for most of my developing learning and i expected Unity to be similar with its coding language but i have been having a lot of difficulties coding often having an issue with finding the errors with the code.

I just want to know if they are any extensions for Unity that can help me with this problem

0 Upvotes

10 comments sorted by

4

u/trampolinebears 24d ago

What kind of errors are you running into? Could you give a specific example?

-1

u/larparby 24d ago

not very specific but mainly when I write down code and run it the error is there but even when i fix it more seem to come which should be expected from someone who is very new to unity

4

u/snipercar123 24d ago

Did you use an ide like Visual Studio? It will tell you about syntax errors like you mentioned and other compilation errors too

2

u/larparby 24d ago

yes i use Visual Studio when developing C#

2

u/Thorarin 24d ago

If you want to avoid code blocks somehow, that's not really feasible. However, there are code blocks in Lua and Luau as well, just with wordier syntax. Explain your issue more clearly 🙂

-1

u/larparby 24d ago

I dont want to avoid code blocks i want an extension that can make the code blocks similar to Lua( Roblox Studio). and yes i do want a more wordier syntax

3

u/Atulin 24d ago

Well, tough. You're writing C#, not Lua. Different languages are different. You can't make C# look like Lua any more than you can make Erlang look like Java.

1

u/Atulin 24d ago

What is your issue with code blocks, exactly? It always seemed like a very simple concept to me.

1

u/SoerenNissen 23d ago edited 23d ago

If you want

                           ┌─>  function name (params)
keywords "function"/"end" ─┤        function body
                           └─>  end

                                name (params)
                           ┌─>  {
instead of these 2 braces ─┤        function body
                           └─>  }

then unfortunately no.

1

u/Slypenslyde 23d ago

Give it 2 weeks. Moving between languages always causes a lot of cognitive dissonance. You're used to a lot of things that aren't true anymore.

Having an extension render the code differently won't help because you still need to read other people's C# code and it's going to use syntax that doesn't look like Lua.

The only thing that will help is writing and rewriting programs until you get to the point that seeing a set of braces doesn't confuse you. Trust me. The order of languages I've used was:

  • TI-BASIC
  • Turbo Pascal
  • C++
  • HTML before CSS
  • Java
  • HTML/JS/CSS
  • PHP
  • C#
  • Python
  • Perl
  • Ruby
  • Z80 Assembly (TI-83, Atari 2600, NES)
  • Lua
  • Objective-C
  • Swift

Most of those languages have dramatically different syntax. You have to get used to telling your brain you don't care if it's not comfortable.