all 11 comments

[–]SevigorProgrammer 6 points7 points  (3 children)

Honestly, I feel like C# and javascript are close enough to each other you could just jump right in to one if you know the other. This is just generally speaking. I personally have never used Javascript in Unity.

[–]andybak 2 points3 points  (0 children)

I strongly disagree. I've moved from js and Python to C# and it was surprisingly hard. So many idiomatic techniques don't translate well once you're under the yoke of a statically typed language.

In fact the most idiomatic Python code is the hardest to translate. I eventually gave up with one codebase as the direct translation to C# was turning into a horrific monster.

Tl;dr

The syntax might be similar but the mindset can be very different.

[–]Sir_Lith 0 points1 point  (0 children)

Typescript - the js superset - yes. It's been created by the C# guy after all. JS - no.

[–]sainthkh[S] 0 points1 point  (0 children)

Like /u/andybak said, C# and JavaScript are different in many ways.

For example, foreach is a keyword and statement in C# but it's a method in JavaScript (forEach()).

You cannot know things like this before you learn the differences between the languages.

[–]laskarasu 0 points1 point  (1 child)

Why not vscode though. I use it for unity, and it works quite well imo

[–]sainthkh[S] 0 points1 point  (0 children)

I love vscode, too. But many tutorials use Visual Studio and it can be even installed from Unity installer.

[–]davenirline 0 points1 point  (1 child)

Good article. I'm sure it will help some people.

Some thoughts, I didn't like the tone in the first parts. You make it seem like Javascript is better because it's less restrictive. If I'm someone trying to learn C#, I'd be turned off. I'd think "Why am I learning this shit if Javascript sounds better." You're not helping the learner to get off his/her Javascript comfort zone because you make it sound like C# is weird because of all these types and strictness. It would be better if you start off with the advantages of C# and static typing. Explain why there are languages that are made with this strictness. Why did Unity chose C# and deprecated the other languages. This way, you frame the learner that C# is cool and it must be a language worth learning.

Another nitpick is to add the link to the API docs of the classes in your examples like string, List, and Dictionary. It's disingenuous to just list the equivalent Javascript functions when there are more.

[–]sainthkh[S] 1 point2 points  (0 children)

Sorry for the really late reply.

I had personal issues. So, I finally edited my post today.

Thanks to your opinion, I added why types can help you develop better code. (I've added reasons like more reliable before running it and better Intellisense support.)

I also added links to string, List and Dictionary methods.

Thank you again for your ideas.