Best language?

best language?

Attached: 1200px-C_Sharp_wordmark.svg.png (1200x1200, 67K)

Other urls found in this thread:

sharplab.io/#v2:EYLgtghgzgLgpgJwDQxASwDYB8ACAmAAgGEBvHAFgIFkAKAShIFgAoAMwHsE4IBjACxpoAdjAIA3CBgLCCQuAHdpIgNoBdEgEYkeJAGYAvg30sJUgLwFyugNwt9 oA==
twitter.com/AnonBabble

fuck no.
/thread

Attached: trash.png (559x556, 154K)

for the insecure incels larping as a sophisticated programmer but have to stay in their unoptimizable safe space all the time, yes

Attached: 1567248337644.jpg (3240x3240, 881K)

{
int x = 1;
}
int x = 1;
>compiler error

what why?
That seems stupid

C++
Fuck C#, it runs in a fucking VM

yes
>MSIL
>VM
first year student detected

Attached: comment_pHjYY7fTL02vjXffXtmQAXyuRc8jNJVI.jpg (600x800, 229K)

>comment_pHjYY7fTL02vjXffX(...).jpg
neck yourself

suck my dick yoju autist

Attached: comment_OddDLjcWrHPyqAwvmuLbFO72jTJiBSJ9.jpg (847x321, 280K)

Based

Does it work well on linux?

yes, with net core

>MS Java
no

the one best suited for the project

Yes.

The CLR is a VM of sorts.

No way it hoists variable declarations

It's a VM until you start using CoreRT for native AOT compilation. That output is a platform native binary with GC tacked on.

>/threading your own post
at least samefag and make 2 posts, you absolute retard

It's because the 1 is determined at compile time to a constant value so x is already there when it would try to create a new one.

Awesome

If c++ didnt carry the unholy mess that is the preprocessor directive hell from c (#ifdef everywhere, #define instead of const, etc), I would prefer it over c#.

c# wins for me

Is it easy to learn C# if you know C++?

Stop talking out of your ass. C# hoists variable declaration and it pollutes namespaces.

foreach(var val in arr){}
Now `val` is in your scope. If you say
int val = 33; it cannot compile. Because what you write is:
{
int x = 3;
}
int x = 23;
What Microsoft thinks you need to write:
int x;
{
int x = 3;
}
int x = 23;

C# is utter garbage.


Oh there's another one:
String.Format("index {43}", "crash");
// 0 warnings, 0 errors, runtime crash

Attached: 1538143303183.png (1578x1668, 187K)

haahahhahahahahah no
bloated shit use c and make

>best language
>C hashtag
pick one

>CoreRT
Nobody uses that experimental shit

C# is more like Java than C++.

What's your point with the string.Format method? How would the compiler know beforehand what each and every method does with random string arguments and when to prevent you from compiling it? It is syntactically and semantically correct code after all. And for what it's worth it DOES generate a compiler warning.

Besides, printf in C/C++ is also not particularly safe in that regard.

C# has #ifdef
Why are c shart shills so desperate?

C#'s #if is strictly for conditional compilation. It does not allow you to create macro hell since you can only do things like "#if DEBUG".

>using string.Format instead of interpolation $"x = {x}"

>It is syntactically and semantically correct code after all.
>index 43
>semantically correct code
>43
>correct code

This is your brain on C shart

>it generates warning
It doesn't. Stop lying,


>n-no it doesn't count
HAHAHAHA
>>using string.Format instead of interpolation $"x = {x}"
That doesn't help the fact that C shart fails to even check index

It works really well if you develop your project from the beginning with AOT in mind (e.g. avoid reflection and dynamic types)

fuck yes
fuck yes, on my first job they told me to learn C# and come next week
C++ was the only thing a knew at that time, and it took me about 6 hours to read 1 book and start using C# with confidence

it seems you're a bit retarded, mate

Attached: 20190911233212.png (442x308, 9K)

>(e.g. avoid reflection and dynamic types)
So basically it has no support for the vast majority of the libraries.

See pic

Attached: Screenshot from 2019-09-12 07-37-56.png (1444x962, 158K)

Async/Await is an abomination

if only C# had monads!

The semantics of a language have nothing to do with whether a method throws an exception for certain inputs you idiot. Besides, String.Format is not part of "C#", it's just one of millions of methods of the .NET framework which is often used with C#, but has nothing to do with the language or the compiler itself. Nothing is preventing you from e.g. changing the .NET Core implementation of String.Format and commenting out the exception for your wrong index. Why would it be the job of the compiler to tell you how certain methods are intended to be used, and how would it even know?

This

I'll give it a go then, I waant to approach java in some way and cpp is the only thing I know.

It's funny you EXPLICITLY said C shart is better because it has no ifdef, which is demonstrably false.

Stop your mental gymnastics, you are not smart, you are catching on the straw at this point. There's not ONE implementation of .NEET that prevents indexing error in compile time.

I'm not even the person that said no ifdefs make C# better, but do you seriously believe C/C++'s macro bullshit is good language design? Not even C#'s very limited preprocessor directives are good design.

>There's not ONE implementation of .NEET that prevents indexing error in compile time.
I don't think you understand the difference between a compiler and a runtime. Again, why and how would a compiler know what inputs are valid for random methods of the framework? Do you suggest that a compiler should somehow contain information about every method ever written so retarded people like you can't pass in invalid strings? What language in the history of mankind has ever done this to such an extent?
Or is it just about this one method? Why would they somehow add verification for this one method which is not even really used anymore since string interpolations have existed for years by now? What if I wrap string.format in my own method and pass in the wrong index to my method? How would that even work? Or what if you construct the format string at runtime?

Modern C++ avoids macro at all costs. I don't see what's the issue here.

> I don't think you understand the difference between a compiler and a runtime..... [ COMPLETE RUBBISH WALL OF TEXT ].... format string at runtime?
Just stop your gymnastics, it's pathetic and it's giving me the second hand cringe.
String's Format method is broken, buggy and error prone in all the available .NEET implementation, admit it. Cope with it.

>Just stop your gymnastics, it's pathetic and it's giving me the second hand cringe.
Good argument, you adressed all my questions.

That's what low-skill programmers say. Once you learn how to properly do it, you will change your tune. I bet you currently use return await antipatterns and then proceed to wonder why performance sucks ass.

There was no question. You were bitching about the implementation error to which I said already that all the implementation of String's Format method are runtime crash prone. Your gymnastics end here.

Attached: 1480652820697.jpg (248x247, 6K)

>That's what low-skill programmers say.
Literally the opposite. Async/await is for morons who want to multithread with an imperative style. Unironically for brainlets who can't into functional programming.

Is this your coping mechanism? Sad.
Why were you so desperate, is someone monitoring your online activity and how well you defend m$?

Attached: 1537716318835.jpg (1200x1200, 217K)

>C# is shit because if you try to write code as if you were trying to win an obfuscation contest, the compiler tells you to stop being retarded.
The compiler does NOT hoist variables, and it requires you to be explicit.
{
int i = 0;
}
{
int i = 1;
}

This works just fine because the scopes are unambiguously isolated. Stopping your example was a conscious design decision, made to force devs to be more careful.

async/await is the kind of thing you can only appreciate after fixing lots of tricky concurrency bugs. All I have to worry about now is making sure I don't forget to await something, causing to spin off into background-land. I still need to use raw tasks and threads sometimes, but I can keep that to small, rigorously tested things.

The functional paradigm doesn't map well to all problems, and it comes with performance issues in many cases. Don't fall for the silver-bullet-paradigm meme. Both imperative and declarative have their use cases.

Attached: 2AE33FA12B6C4565B71B4746337BF98B.png (640x524, 60K)

>The compiler does NOT hoist variables,
it does, I just showed you. Ever wondered why this happens?
foreach(int val in arr){}
val = 43; // actually works because c shart pollutes namespaces by hoisting
// here's what C shart compiles behind your back,
int val;
foraech(val in arr){}
val = 43;

Same goes for `is`. Because the language semantics requires the compiler to do so. You fucking retard.

Attached: 1537975511081.png (211x239, 5K)

brainlet here. How would you do something like, say, async web-requests in functional programming without something like async/await? I thought the idea of async/await was to get rid of callback hells, often seen in older JS code and the like. Something like request(url, result => { request(url2, result2 => ... ); });
With async/await you can just write it linearly:
result = await request(url);
result2 = await request(url2);

also
>win an obfuscation contest,
Learn basic lexical scoping, brainlet.

literally every thread someone tries to shit on C# is showing how you can't go full retard and write dumbest code possible, if you dare to call them out on their bullshit they will say 'cope', fucking fews i swear

>I don't understand lexical scoping so you must be wrong

Attached: 1537379077871.jpg (480x480, 28K)

???

Attached: d.png (665x150, 6K)

>actually works because c shart pollutes namespaces by hoisting
sharplab.io/#v2:EYLgtghgzgLgpgJwDQxASwDYB8ACAmAAgGEBvHAFgIFkAKAShIFgAoAMwHsE4IBjACxpoAdjAIA3CBgLCCQuAHdpIgNoBdEgEYkeJAGYAvg30sJUgLwFyugNwt9 oA==
hmmmmmmmmm

Attached: 1519304834633.jpg (645x729, 81K)

beat me to it. also nice font :^)

This is the second time you've just flat made shit up. Your code does not compile.
C# is well known for not hoisting. Sometimes javascript kiddos get pissy about it because they want their clown language anti-features everywhere.

itt autism

It does hoist variable, but not consistently. What a shitlang, can't even do anti feature correctly

Attached: Screenshot from 2019-09-12 08-39-58.png (1920x2106, 184K)

????

Attached: Screenshot from 2019-09-12 08-42-03.png (1920x2106, 250K)

LOL C shart:
>using System;

public class Program
{
public static void Main()
{
var evens = new int[]{2, 4, 6};
foreach(var i in evens){

}
var i = 22;
}
}

NOOOOOO, i has already been declared

using System;

public class Program
{
public static void Main()
{
var evens = new int[]{2, 4, 6};
foreach(var i in evens){

}
i = 22;
}
}
using System;

public class Program
{
public static void Main()
{
var evens = new int[]{2, 4, 6};
foreach(var i in evens){

}
i = 22;
}
}
NOOOOOOOO YOU CAN'T JUST... USE i EVEN THOUGH I PREVIOUSLY CRIED ABOUT IT NOT BEING IN THE SCOPE

Only reason I learned C# was games (Unity), work (banks use .NET). I'll always have a job because of it but its not that great. Not even that great for Desktop (on Windows) apps. A lot of JS'ers use Electron or just ya know... use Qt

Maybe don't write shit code if you want it to complete, that's pajeet level variable declaration

Learn Lexical Scoping, poojet

js has const and let now, only var gets hoisted

C# inconsistently hoists declarations

Attached: 1568242520676.png (1822x1232, 177K)

sorry, but pajeet's write in java

Learn what scope is and how to properly name variables

Attached: 9mh2yda59kd21.jpg (640x757, 108K)

This is not hoisting. The condition component of an if statement does not provide a scope. The same thing happens if you call a function with an out parameter in an if condition. The out variable is available outside the statement even if it was declared inline.

This is just what was described in .
The compiler keeps tracking i to prevent using it. As a consequence, you can't use it. This is to prevent confusion. Pick a new variable name.

I know full well what scoping is. C# doesn't.
{
int x = 34;
} // x dies HERE
int x = 34; // Completely valid

Valid code in decent languages, like C, C++, D, Rust, Go etc.

C shart hoists declarations.

...

x is declared in both scopes, no matter at what line, it's still the same two scopes. not a very hard concept to understand. other languages might do it differently but i see no inconsistency here. the rule is simply that you can't define a variable if it's already declared in an outer scope, the line at which it is declared doesn't matter.

Attached: 1522432155152.jpg (703x911, 158K)

I swear, every time C# gets mentioned here, only shadowing is discussed. Is that really the only problem with the language?

>x is declared in both scopes, no matter at what line, it's still the same two scopes.
No. the x was declared in the scope enclosed by braces before. That's why x dies in within that braces.

>i-it doesn't matter
>our shitlang doesn't understand scoping that's how we do it
COPE

String.Format() is broken

>string.format is a feature of C#
lul

Again, you're missing the point. What you're talking about was a dumb source of bugs that Andy&co wanted to eliminate. Pick another variable name. Do it even in languages which allow reuse of variable names between the function and statement scope. Maintainers will thank you. Complaining about this is essentially bike shedding.

Because it's the equivalent of
int x = 1;
{
int x = 1;
}

You can define stuff after you use it. It's useful for classes and function definitions and things. In C++ you have to do header files to make sure everything gets defined before you try to use any of it. C# gets around that. You just have to be a little careful not to re-use variable names which you shouldn't be doing anyways.

>COPE
is that all you ever say when you run out of memes to spew in your shitposts?
it doesn't matter to the compiler error is what I meant, not that it doesn't matter to users or whatever you were implying. the compiler simply sees all scopes and the variables declared within. at which line each variable is declared is of no consequence to a C# compiler, which is not the case for other languages. are you really this dense? this is just a design decision as said, but has nothing to do with hoisting.

A method in standard c shart String. Cope harder.

What you're talking about was a dumb source of bugs that Andy&co wanted to eliminate.
If you really want handholding why not fix String.Foramat? Looks like a really easy hand to hold
using System;

public class Program
{
public static void Main()
{
for (int i = 0; i < 1; ++i) {
var tmp = 34; // something
}

var tmp = 33;


}
}
NOOOO EVIL!!!!! PICK A NEW NAME!

using System;

public class Program
{
public static void Main()
{
for (int i = 0; i < 1; ++i) {
var tmp = 34; // something
}

for (int i = 0; i < 1; ++i) {
var tmp = 34; // something
}


}
}
Is A-okay!!

Failed, inconsistent attempt at handholding.

Everytime you and gotards fail in logic your argument is "it's for handholding our poojets" when the langauge itself is inconsistent

System.String is a class in .NET, the implementation of which is not part of C#.

What does String.Format have to do with any of this all of a sudden, lmao

>.NEET Strings are not C#
lmao imagine the cope. It's like saying `getchar()` is not C. haha

Attached: Screenshot from 2019-09-12 09-25-56.png (844x1576, 168K)

>It's like saying `getchar()` is not C. haha
It literally is not, though. You can use C without stdio.h even existing.

So in order to use a WORKING String you can't use .NEET? lol

That's not inconsistent. In the second example the two tmp variables are in different un-nested scopes.
In the first one the tmp variable in the Main scope also exists in the for loop scope so you're trying to define a variable that already exists.
You're just used to languages where if you do something like this it throws errors.
public static void Main()
{
Print();
}

public static void Print()
{
Log("dumb cunt");
}

what is broken about strings all of a sudden, I thought you were talking about String.Format (which isn't even broken, it just doesn't allow you to use undefined indices, what's wrong about that?)

Whatever your problem is you can always write your own library and use it the way you like.
This simple solution works in any language.

or just use string interpolation which does not have this problem and is the recommended way to formatting strings anyhow.

very baste language
i write stuff in an hour or less thanks to linq and extensive native and third party libraries that takes others a day or more to write in other languages

>what is the C standard library

why would somebody who understand lexical scoping look for easy solution?

>You're just used to languages where if you do something like this it throws errors.
Really?
pub fn main() {
print();
}

pub fn print(){
println!("Really, nigger?");
} // works just fine

Going around a bug is not a "solution"

What's the "bug" here?

Runtime crash due to lack of index checking.

But it does check the index, hence it's telling you that you're stupid and should fix your input string, no?

Sounds pretty descriptive to me, what's there to not understand or how would you improve this?

Attached: error.png (620x104, 13K)