❔ No path
Hi, im learning some C# code from yt channel Brackeys and when he has openned vs studio, u can see the path like "Using System"(i will send ss)
but i dont have that on my file, what should i do, cause i dont know how im gonna use methods without it. Dont mind the text on mine ss, just wanna remember these things 😄
15 Replies
You can pretty much copy+paste the code from the tutorial and it'll be fine.
This is a feature called "implicit usings" which just entails that you don't have to write
using System;
at the top of your files because it's added automatically in the background.top level statement checkbox was probably on when u created the project
that too
Top-level statements are a feature which allows you to not have to have the
class Program
and static void Main(string[] args)
stuff.
But again, you can just use the code from the tutorial.oh thanks, i just propably missed type somewhere in the code
cause it was showing some error before
Oh god do not learn c# from brackys xD
why not
the c# vids are absolute dumpster fire and bad coding practices.
format your code + you cannot put methods in a top-level statements file
better stop concatenating 2 strings with
+
and start learning string interpolation
the dollar sign has to be inserted before the first quotation so that {age}
transforms into it's valueWow I didn't know about this, will do
?
there is bad indentation and you should move all this code to a Main method in a class
you can absolutely have methods in top-level statement files
they just have to come after all statements
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.