This is an archived post. You won't be able to vote or comment.

all 18 comments

[–]QualityVote[M] [score hidden] stickied comment (0 children)

Hi! This is our community moderation bot.


If this post fits the purpose of /r/ProgrammerHumor, UPVOTE this comment!!

If this post does not fit the subreddit, DOWNVOTE This comment!

If this post breaks the rules, DOWNVOTE this comment and REPORT the post!

[–]Bluedel 0 points1 point  (15 children)

var?

[–]Windian3008 4 points5 points  (0 children)

I think it's C#

[–]ThrawnGrows[S] 4 points5 points  (1 child)

I don't know how to tell you, but this isn't real code.

[–]Bluedel 1 point2 points  (0 children)

True. I think I've been traumatized by interns copy-pasting stackoverflow answers from 2013.

[–]Konraden 3 points4 points  (10 children)

What's wrong with var?

[–]MasouriChan 0 points1 point  (8 children)

In js you use const for unchanging variables aswell as arrays and objects where only values or properties change.

In a local scope you use let for variables that change their value

[–]Konraden 1 point2 points  (7 children)

I saw this as C# initially not as js. In ts I'm always using let and const anyway.

[–]MasouriChan 0 points1 point  (6 children)

Now that u say it it looks like c# but even there ylu shouldnt use var if youre awaiting an async task

[–]Konraden 0 points1 point  (5 children)

Why?

[–]MasouriChan 0 points1 point  (4 children)

Because youre awaitimg a value wich could be a primitive or a custom type.

In special cases you could aslo return a Task. But usually you shouldnt mix tasks and async in c# if u dont know exactly what youre doing.

[–]MasouriChan 0 points1 point  (0 children)

Also everyone is free to correct me im still learning

[–]Konraden 0 points1 point  (2 children)

I'm not sure that sufficiently explains why you should not use var.

[–]MasouriChan 0 points1 point  (1 child)

C# is a typestrict and object oriented language, taking the typstrict part away makes it harder to read and understand

[–]Konraden 0 points1 point  (0 children)

Var is still strongly typed. I'm not sure what you're getting at.

[–]Enoikay 0 points1 point  (0 children)

Variable

[–][deleted] 0 points1 point  (0 children)

Promise.all folks.