Similar Posts

Subscribe
Notify of
32 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
MrAmazing2
1 year ago

I love JavaScript because I can translate algorithms in JavaScript with significantly less code than in C#.

FaTech
1 year ago
Reply to  MrAmazing2

Can you specify that? I don’t know an example where this applies 🤔😅

MrAmazing2
1 year ago
Reply to  FaTech

So I don’t know where the NOT applies 🤔

Let’s say you have data that are deeply nested.

This is how the code for this structure looks in C#:

private Dictionary>> myDict =
     new Dictionary>>();

This is what he looks like in JavaScript:

const myDict = {};

A huge difference both in time and writing.

Not to mention that you always have to cast the type when reading C#.
And that on the first two levels only dictionaries can be in the dictionary, and no other values.

If the structure of the data is solid and known in advance, one can naturally create a corresponding class for it, but then the code NOCHMAL becomes longer/time-consuming than it has already been.

Type security eats much more time than you think.

LUCKY1ONE
1 year ago
Reply to  MrAmazing2

Bullshit.

MrAmazing2
1 year ago
Reply to  LUCKY1ONE

What bullshit?

In JS, you do not have to specify a data type which significantly shortens the code and the required programming time. Especially with more complex data, this makes a big difference, in C# you would have to create a class where you specify how exactly these data look, what is nested etc., in JS you just have your object and finished. JS is very uncertain, but the code is a little shorter, so I don’t see where the bullshit should be.

LUCKY1ONE
1 year ago

Jepp, everyone the Seine. C# many like to use as JS “replacement” in Blazor.

MrAmazing2
1 year ago

👍🏼 If you use it for more, then you should use TypeScript, finished.

Could you take Python or C# in front, do you think people would prefer it to JS?
I doubt it. I find JS (and on larger websites TS) a beautiful language. But no matter his.

FaTech
1 year ago

It shouldn’t be insulting (if it got over, I’m sorry). I work in a bigger company. I couldn’t afford such a way of thinking. That’s why I think differently. In a private context you can say ok, but I still find it difficult.

I think we can leave the discussion too. This leads to nothing and does not help the questioner 😅

MrAmazing2
1 year ago

So you could have saved the insult honestly.

I am aware that type safety is important in the company or in large projects.

But with your own small projects, or if you want to briefly design an algorithm for a problem (Coding Challenges) type security is just waste of time and extends the code unnecessary.

Why put value on security if you don’t need one? It’s stupid.

LUCKY1ONE
1 year ago

To complete this. I understand your points. However, it is necessary to say that JS is used today for far more than for small scripts.

I also agree that such scripts (in C#) can be written with the same workload.

And ne. JS is popular because there are no alternatives. WebAssembly is by far not so widespread and client side there are now only JS and WASM.

MrAmazing2
1 year ago

Fact, for large programs, JS is definitely Bad Practice. But in the case of small programs, for which JS is meant, type security doesn’t matter.

No, I think more JS is popular because it allows everything with the most simple building blocks. Object, list, primitive data types, finished. You don’t have to learn thousands of different array types by heart, which one can get better in what case, but can just start on it. And I also find JSON objects wonderful, especially compared to dictionary on dictionaries etc. And the absence of type security makes the code quite short, that may also be some (e.g. me). JS in popularity to compare with languages that have a completely different meaning but is also unlucky. If I find it, you should compare it with other script languages like Python. And here I personally prefer JS, but everyone has their personal preference.

TypeScript is available for larger programs. Not necessarily because JavaScript is bad in itself, but because it’s just a completely different application, whether I’m a 5-minute website bastle, where a bug can be inside, or an enterprise level thing.

And yes, faster is an interpreted language of course never, but I didn’t say so.

FaTech
1 year ago

In my comment it was not about the question, but about your answer. You said it was shorter in JavaScript than in C#. It’s not really like that. In C# it is now time to use good practice types to keep the security. Not in JavaScript. This is bad and bad code can NOT be considered good. Anyone who thinks so should not work as a developer (sorry). And guys are anything but cumbersome. If you can’t, you have to learn. In C# there are now more and more abbreviations, such as [] without new or new without Ctor indication or var. These are still type-safe, but make it easier. In addition, a program is rarely developed alone (from a company perspective). Write const myDict = {}; so, it will fly sooner or later on to the fre**e. This is fact. A strange developer does not know what you initially wanted to do with it. He would have to read a docue in a complicated way, where you have to explain it or search your code far enough to find out how you used it, and even then there is no guarantee that he uses it properly. Guys are important. const myDict = {}; is not an abbreviation. It’s always a curse

LUCKY1ONE
1 year ago

Quite JavaScript is sometimes noted “bad practice” when you take it that way. I don’t see any advantage over dynamics at JS.

JS is, to be honest, just as popular as there are no real alternatives. It’s not in vain that you built a Transpiler for JS.

I wouldn’t mind anything that would be implemented algorithmically faster in JS than in C#, for example. At JS, you also have more benefits.

MrAmazing2
1 year ago

Clearly, security is important, but in the question it was about what you like more personally, and I personally prefer to write a “unsafe” program briefly and crisply than a long and cumbersome one.

At least in terms of simple tasks, you should not use JavaScript for larger projects.

But if, for example, I program on LeetCode or CodeWars algorithms, which is vague. 20 lines code that I feel overworked 100 times, then type security is an absolute Pain. I’d never take C# or A. I’ll say it again: Script languages there is not for fun, but exactly for this purpose. To meet requirements as quickly and with as little code as possible.

MrAmazing2
1 year ago

Yes well you can naturally take dynamic, then you don’t need a cast, right…

But nobody does. Absolute bad practice. This is like when I take TypeScript and then donate everything as “any”.

In a NORMAL program you write in C# types that can often be very complex and not in JS, so JS programs are usually a little shorter.

Script languages like JS and Python, there is not for fun, but just for this reason.

LUCKY1ONE
1 year ago

No, you don’t. Please just inform yourself about this, instead of telling you the whole time.

MrAmazing2
1 year ago

Yes super but then had to cast a thousand times if you want to read the data…

That’s what I meant with “in JS you need much less code,” that’s nothing stupid, but just fact.
It is a trade-off: You do not need type security, but you have to write significantly less code.
For scripting (for which JavaSCRIPT) was absolutely thought, as created.

FaTech
1 year ago

Well, well, but I wouldn’t call that a good example, because type of safety is important. In JavaScript you can easily break something because it doesn’t matter the JavaScript super. Security should always proceed.

LUCKY1ONE
1 year ago

Then you can’t just write that without type, can you?

And what if the data are still several levels deep?

Yes. On the one hand, this goes through the keyword var, as well as over objects and dynamics. This is naturally accompanied by a certain type of uncertainty, which is why it is preferable to use classes or more compact structs in this context.

MrAmazing2
1 year ago

Yes, if you already have the data in the code, it’s easy to specify this so that you don’t need a type indication, then C# can determine the type directly itself …

But what if they come from where different, for example from a database/API/file/… and you want to pack them into a variable?

Then you can’t just write that without type, can you?

And what if the data are still several levels deep?

LUCKY1ONE
1 year ago

In C#, you do not have to specify data types.

What looks like in JS:

x = 5; 

looks like this in C#:

var x = 5;

I don’t recognize any significant code savings.

in C# you would have to create a class where you specify exactly this data, what is nested etc., in JS you simply have your object and finished.

Really?

var v = new { Amount = 108, Message = "Hello" };

Console.WriteLine(v.Amount + v.Message);

Why don’t you just take C# apart before you judge it?

Scubapro38
1 year ago

For years I have been using C#. Also for my Windows computer. At first something with C++. It’s enough for me to master the basic. With Java and Python, etc, I don’t get that good at all. So if I program something useful in the form of an app a small mini game, then I use this from Microsoft this arcade coding. Because that makes learning really fun. This is such a kind of clamping component programming in German. Because there I get great trainings, tutorials and more. For free. But nobody’s perfect. Error is human.

Lamanini
1 year ago

I think JS is too chewing-like. C# is simply beautiful, neat and stable but also flexible.

GuteFrageUse795
1 year ago
Reply to  Lamanini

typescript solves ; )

Lamanini
1 year ago

Jaa, that’s true. I always use it at work. But I annoy myself much too much about it than I could like more than C#😂

Lamanini
1 year ago

This goes without problems with Blazor, both serverside rendered, as well as hybrid or completely separated.

Web assembly is thanks.

GuteFrageUse795
1 year ago

Will only be difficult to implement frontend without Js; ) in the browser. Was under C# once big fan of WPF.

Ireeb
1 year ago

Write SPA Web apps with C# is more difficult.

However, I prefer TypeScript to JavaScript for this purpose.

TeamStoffcouch
1 year ago

You just need an editor and a browser to start!

FlockeFindet
1 year ago

Just because I can handle it better I’m a web developer.

ntechde
1 year ago

Perl and PHP

Swiss Pocket Chainsaw

SusgUY446
1 year ago

python and php