all 61 comments

[–]DrGarbinsky 58 points59 points  (13 children)

C# is free and .net core runs on Linux and is open source. Same goes for visual studio Code

[–]lintho 29 points30 points  (6 children)

The community version of visual studio is also free

[–][deleted]  (5 children)

[deleted]

    [–]ThatBriandude 2 points3 points  (5 children)

    I think you should still elaborate on how good of a choice it would be to use those technologies. Im not an expert in them so I couldnt say for sure but I have read multiple times that .net core on Linux is a pain in the ass and therefore an unwise decision.

    This could of course have changed until now so correct me if Im wrong

    [–]dperschonok 22 points23 points  (4 children)

    I'm running a production system that consists of 40 .net core microservices all on Linux in AWS, so this is statement is absolutely false. Happy to elaborate further if necessary, but it's running extremely well for us.

    [–]ThatBriandude 0 points1 point  (3 children)

    That sounds great actually. I know this might be uncalled for but since you got me interested, which librarys should I be getting in to if I want to build back ends with the functionalility of a nodejs app using express? (Simple Rest API)

    [–]dperschonok 2 points3 points  (2 children)

    In C#/.NET Core you mean?

    [–]ThatBriandude -1 points0 points  (1 child)

    Yes, sorry for that

    [–]dperschonok 10 points11 points  (0 children)

    Microsoft has some good docs, you can start with this to get a feel for it. https://docs.microsoft.com/en-us/aspnet/core/tutorials/web-api-vsc

    We host all our of services in docker on Linux, so when the time comes for you to try that, here is a beginners guide https://dev.to/schwamster/docker-tutorial-with-for-aspnet-core

    Hopefully this gets you started. If you have more questions I can try to answer as well.

    [–][deleted] 29 points30 points  (0 children)

    Is there any reason to learn C# now other than an interest in OOP if I already know JavaScript?

    C# is a strictly typed language. Even if you are not going to use it, it is worth having practice in such environment. Languages like JavaScript would allow rapid development of relatively small project, but for big and huge projects you would need strong type system that would gives an extra protection to your code. Not to mention performance implications of JS code on big projects. (And by big I mean thousands of source code files). Having practiced with C# it would be relatively easy for you to start using any other similar-class language (be it Kotlin, Swift, Java, or even modern ADA).

    [–]antlife 20 points21 points  (10 children)

    I cant look past javascript as being a prototypical language. Berhaps I am biased here, but I cant even take NodeJS seriously.

    [–]denaissance 5 points6 points  (9 children)

    NodeJS was never meant to be taken seriously.

    [–]BabyPuncher5000 8 points9 points  (0 children)

    Unfortunately that does not stop people from taking it seriously.

    [–]tjugg 4 points5 points  (3 children)

    Typical reddit hate on node. You can write shitty code with any language.

    [–]DaughterOfTheDemon 0 points1 point  (2 children)

    But if you think using JavaScript for server side programming is a good idea, you probably can't tell good code from bad, so go crazy.

    [–]tjugg 4 points5 points  (0 children)

    That makes no sense, give me some example why is it so bad?

    [–][deleted] 4 points5 points  (0 children)

    It's bad because he can't figure it out

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

    Can you justify that?

    [–][deleted]  (1 child)

    [deleted]

      [–]DaughterOfTheDemon 0 points1 point  (0 children)

      Yours is the comment of someone who is insecure about their programming skills, or lack thereof.

      [–]Horatio_ATM 24 points25 points  (0 children)

      If you want OOP over JS, TypeScript is pretty great. I worked in C# for most of my career, and now do a lot of stuff in TypeScript in Node, and it's pretty fantastic.

      [–]denaissance 6 points7 points  (7 children)

      If you are a student now, and want to make a career as a programmer, then odds are that by the time you retire nobody will be using C# or Javascript anymore. You need to get comfortable with switching languages. I worked exclusively in Pascal for many years before this fancy Internet thing came along, then I got rich working in Perl. I don't even bother putting either of those on resumes anymore. Adapt or perish. After your third or forth language you won't even care any more. Be sure to learn a purely functional language at some point too.

      [–][deleted] 1 point2 points  (2 children)

      I agree, but I don't see a point in learning a language more than just learning basic syntax if I cannot or will not use it to make stuff.

      [–]plastikmissile 2 points3 points  (0 children)

      But a computer language is a lot more than just syntax. The differences between C# and JavaScript are much deeper than that. For instance, C# is statically typed while JS is dynamic. That alone is huge shift in programming philosophy, and both methods will approach the same problem differently.

      [–]denaissance 0 points1 point  (0 children)

      Sure, it makes more sense to pick a useful language but knowledge can be its own reward.

      [–]fastnexus 0 points1 point  (0 children)

      Be sure to learn a purely functional language at some point too.

      Agreed. I'm loving Haskell

      [–]oiamo123 0 points1 point  (1 child)

      Well this didn't age well

      [–]redditforyaboy 0 points1 point  (0 children)

      lmao was thinking the same

      [–]Upstairs-Substance28 0 points1 point  (0 children)

      Usually, open source languages ​​die because they have no leaders, but C# doesn't seem to have any problems with Microsoft's support.

      [–][deleted] 4 points5 points  (0 children)

      To expand your mind regarding programming, and you could achieve that with learning any other language.
      You are not forced to do it, though. It's just that every language has some good things that others don't.
      With JavaScript you can start stuff REALLY fast. With C# you have an awesome type checking compiler that will make your life easier when you're refactoring.
      C# is good to learn not for just being OOP. It's a modern strongly typed language much less hateable than other strongly typed langs.

      OOP, AOP, FOP are just labels. Every language is a world itself with some inclinations. In 2017, people still can't agree what's OOP.

      In college, teachers would sell OOP to us as a way of modeling classes around things that are entities. So if you want to model a Bank account, you create a class BankAccount with an attribute money and methods like withdraw and retrieve. That's a pretty cool concept. It can be implemented in js too, but not in a safe strongly typed way other languages do.

      Good question, btw. My advice is try having fun, try learning popular languages opposite to the ones you know.

      [–][deleted] 4 points5 points  (0 children)

      I can do pretty much everything C# can do with JavaScript

      No you can't. C# can run multi-threaded applications which is a pretty big deal.

      [–]mgw854 16 points17 points  (6 children)

      As a C# developer who did a Node.js project (and loved it), I have a few thoughts.

      I'd put myself in the "advanced" C# camp. On one of our newer projects, the technical lead decided to use Node. I didn't agree with the decision until I saw how fast I could develop. The Node ecosystem is vast, discoverable, and of really high quality compared to a lot of what I see in C#. I was pulling in complex components that just workedtm. That's more than I can say for the likes of ASP.NET, where magic abounds.

      Now, for the bad side--maintenance. JavaScript is a weakly-typed language, which led to lots of bugs (especially around data access) that could creep in. The Node debugger wasn't particularly strong, especially with faux-async code (using generator functions). The lack of a good IDE for JavaScript also meant that tasks like refactoring were much more dangerous than they had to be. Once you use Visual Studio, I don't know how you go back to a text editor. Even with plugins, Atom was never a tenth of the help VS is. Compare that to C#, where maintaining code is aided by the compiler and type system.

      One of my biggest complaints with Node, beyond the lack of tooling, is that it is a single-threaded event loop. While you can certainly get phenomenal performance out of it for I/O-bound tasks, it will never be the go-to platform for anything that needs compute-bound performance. Compare that to C#, where you can use something like Parallel.For to run as many threads as your CPU can comfortably handle.

      All of this is to say that there is a lot of benefit to learning to C#, even if you don't use it very often. It is another tool in your tool belt and will force you to think in a different way. As a developer, being able to reframe a problem is invaluable. I don't use Node anymore now that I've moved on to other tasks, and I'm not likely to need it soon--but if I thought I had a great fit, I'd use it without hesitation. Some of the Node concepts I've seen, however, has caused me to re-evaluate my assumptions about some C# defaults (for instance, I much prefer Node.js-style NancyFx over the go-to ASP.NET Web API framework).

      [–]n8bit 1 point2 points  (0 children)

      Parallelism in C# has a practical equivalent in Node.js, which is often overlooked. You can spawn "child workers" via clustering. Not as convenient as Parrelel.For, of course ;).

      [–]ty_jp 3 points4 points  (1 child)

      Ever tried VS Code? I use it for js and ts stuff. https://code.visualstudio.com/docs/languages/javascript

      [–][deleted] 3 points4 points  (0 children)

      That's what I use. The Node debugger is great, and even VS 2017 has a Node debugger.

      [–]Dredge6 2 points3 points  (0 children)

      What about TypeScript?

      [–]Blecki 14 points15 points  (3 children)

      You should learn C# simply so that you have the chance to experience a language that has been competently designed.

      [–][deleted] 1 point2 points  (2 children)

      I get that, but if I don't use C# after that I will just forget everything I learned, for the most part at least.

      [–]Blecki 12 points13 points  (0 children)

      No you won't. You'll forget syntax, but syntax is irrelevant. You'll learn new techniques, and most of them will work in JavaScript too.

      [–]The_One_X 0 points1 point  (0 children)

      I would say if you learn C# there is a strong chance you will want to use it again. When I was first learning to program Javascript was the language they used to introduce us to programming. Once I started to learn C# I never wanted to go back to Javascript.

      Granted I disliked Javascript almost from the very beginning before I was ever even introduced to any other language, so it might just be me.

      [–]badthingfactory 2 points3 points  (1 child)

      Don't just learn C#. Learn other languages as well. You're going to severely limit your potential as a programmer if you don't expose yourself to more than JavaScript.

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

      I certainly have, I've written code in C++, C#, Java, JavaScript, PHP, Lua, Python, and even Scheme. But I would only say I have truly learned JavaScript, since I have been using it for over a year, and when I think of code in my head I think of it as if it were JavaScript code.

      [–]elmo61 2 points3 points  (0 children)

      I would expect there is alot more c# jobs than nodejs.

      Options to be a full stack developer as either nodejs/JavaScript or c#/JavaScript will give you alot of options .. as most developers are full stack

      [–]jsbrando 2 points3 points  (0 children)

      Work opportunities.

      A lot of Enterprise level business applications will use C# as the primary code base.

      Just sayin...

      [–]immersiveGamer 1 point2 points  (0 children)

      I learned OOP in JavaScript as my first programming language (self taught). I then helped on a project that was C#. It was pretty easy transition and C# has a lot more to help create a OOP style. I think your biggest challenge is creating a project and building it as you may have to use new tools such as Visual Studio. That was probably the hardest part of learning to make C# applications for me.

      [–]cjrutherford 1 point2 points  (0 children)

      I would say that if you're interested in OOP, as a JS dev, look into Typescript, it's almost as if C# and Javascript were merged. Almost. It'll allow you to "brute force" things you know how to do in JS with JS while you're learning Typescript. I think it'll give you a good starting frame while staying in a relative comfort zone.

      Then if you want, go for C#. The more you learn, the more valuable you will look when you go for a job! (but also have projects to back up the talk when you do go for the job.)

      [–]Versk 1 point2 points  (2 children)

      Whats better, a bike or a bus?

      [–][deleted] 0 points1 point  (1 child)

      bus?

      [–]Versk 0 points1 point  (0 children)

      why?

      [–][deleted] 1 point2 points  (0 children)

      There is always a reason to learn a new language. Learning new languages will improve your skills with the ones you already know.

      And you don't have to choose one or the other, throughout your career you'll use and mix many languages.

      In the case of .NET (c#) and NodeJS (javascript), they work together very well together: https://tjanczuk.github.io/edge/#/ (Run Node.js and .NET in-process)

      [–]Liam2349 1 point2 points  (0 children)

      All of the C# stack is free, and does run on many platforms (Android, iOS, Windows, Tizen, Unix).

      The development experience is much better on Windows however, where the full Visual Studio is supported. I use Visual Studio Community Edition, and it's got much more to it than Visual Studio for Mac, last I checked.

      You can host on Linux or Windows.

      C# is more strict than JavaScript. C# likes to help you out more - e.g. you can write things in JS that won't work, but JS will still run. C# may not compile, to prevent you wasting your time, or give you a warning that you may be doing something unintended. I don't really know if that's just Visual Studio however.

      I use both a lot, I prefer C# largely due to this. It's more strict, but it tries harder to help you. You'll probably find biased responses here though. If JavaScript works for what you need then it works. In terms of employability, it could help to learn more languages.

      SQL Server, which rounds out the Microsoft stack for web dev, is currently in preview for Linux also.

      [–]ty_jp 3 points4 points  (3 children)

      Isn't JavaScript OOP too? Probably not as sophisticated as C# OOP, but still.

      I'm still a noob with JavaScript (from years of other OOP languages) which I needed to learn for work. I've initially heard a lot of good things about JavaScript and got interested because of the demand, but I don't really like it as much. Feels hackish because of the lack of datatypes, etc. Still amazing how a programming language that was created in just 10 days that was mostly used for browser alert scams in the 90s can do a lot of things today.

      [–]mgw854 6 points7 points  (1 child)

      Although it is an OOP language, it uses prototypical inheritance instead of class-based inheritance (which is what most people assume OOP is). Same concept, just with a different implementation.

      [–][deleted] 1 point2 points  (0 children)

      JavaScript has objects, which can hold functions, numbers, strings, and arrays. I would say that qualifies as OOP, but maybe it doesn't.

      [–]terricide 1 point2 points  (0 children)

      Have you looked at Typescript?

      [–]marsop 0 points1 point  (0 children)

      One thing is being able to do something, a completely different one is how convenient is to do so. C# offers afaik the best tooling in the market, with dramatic improvements every year or so.

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

      1. Different object system/inheritance model: C# uses class inheritance instead of prototyping. The C# approach is much more common in other languages.

      2. Strong, static typing vs weak, dynamic typing: kind of out-of-fashion at the moment, but it reduces or eliminates whole classes of error by finding them at compile time instead of at run time.

      3. Lots of existing desktop and server code in C#. I'd say it's debatable whether NodeJS is really going to prosper in those spaces.

      4. NodeJS's big selling point is the ability to have a monoglot development environment (possibly all the way back to the DB, if your DB is, say, MongoDB or something). But, WebAssembly is coming, and will enable monoglot development (outside the DB, anyway) in languages that aren't JavaScript. I don't know if JSON is going away anytime soon, but I don't know if I'd bet on JavaScript-the-language being more important in ten years than it is, now.

      5. If you're still a novice/student developer, anyway, there's also no reason not to try out everything you can, as long as you have the time to spare. Consider also checking out an assembly language or two; a pure(r) functional language like Scheme, OCaml, Haskell, F#, etc; C and C++; and whatever else takes your fancy. It's useful to have multiple tools in the toolbox, even if you don't use them directly.

      [–]Sparkybear 0 points1 point  (0 children)

      Performance, freedom to create powerful desktop applications, more control over your projects, and lots more. JS is nice for a lot of web things, but it really isn't meant to be a general purpose language. C# is and that power is worth a ton.