JavaScript or C# - c#

I'm new to development and want to learn JavaScript and C#, which one do you think would be best to start with. I want to mainly build web apps.

They're not mutually exclusive.
JavaScript is client-side programming (DOM manipulation, effects, AJAX).
C# is server-side programming (database communication, OO, external services, etc).
You should learn both. (and ASP.NET MVC while your at it).

That's a tough question as they are for different purposes. Do you know basic HTML and CSS already? If so, you may want to get comfortable with javascript and working with the DOM and take a look at Javascript libraries like JQuery or Prototype.
For Web development you are going to be working with either ASP.NET or ASP.NET MVC in C# and this will serve as the "behind the scenes" layer. You may want to spend some time and learn the C# language first before moving into the C# Web frameworks. Once you do that, you can work on integrating your Javascript skills.
If you have basic HTML/CSS knowledge already, than I would probably start with getting comfortable with C# and than move onto ASP(.NET or MVC). There are plenty of tutorials at asp.net. With C# and ASP there are a lot of components built in that can make building fancy ajaxy web pages easier than coding them with just javascript and html.

I would say if you want to build dynamic web applications, its more important to learn the server side first. One can do a lot of things without client side scripting, although it is important for certain types of UI.

I expect that C# will be easier, if your goal is to learn a language well, as javascript is easy to modify but to do it well requires a great deal more effort.
You can pick up on the basics of object-oriented programming easily, whereas there is a great deal of flexibility in javascript that allows you to do a great deal with little code, but with a steeper learning curve.
What is your goal? Do you want to focus on writing some innovative webpages, where you are using HTML5 features? Then javascript would be the best option, as ASP.NET MVC is not going to push the boundaries of writing games in WebGL, or using the other new features available in HTML5.
But, if you want something that will allow you more options, then C# can be used to help support web applications, as well as write desktop applications and enterprise apps, leveraging the power of .NET4.0.
But, to really use .NET4 you will either need to use mono or use some version of Visual Studio, and if you use the express version then you will have some limitations.
So, it may come down to cost, desires and goals, as to which one is better to start with, as they are very different.

Related

Improving A Legacy ASP.NET WebForms Project to Modern Standards

I was given a project in WebForms to make robust and I had so far added several improvements to it. Don't get me wrong, I like WebForms for its simplicity but much of it is I feel like 'grandfather' type of coding.
Here's what I did, just to give you some ideas:
1.) Added VueJS to the frontend
2.) Added Webpack and a bit of ReactJS to on some pages
3.) Used .NET core on running a custom protocol app that triggers from inside the WebForms project
4.) I've added an emailing function (Inbox, Sent Items, Drafts, Trash, Junk, etc.) (from WebForms and jQuery, another one was WebForms + VueJS) to it as well.
It has gotten pretty big. I was just wondering if it will be scalable? Our management is thinking of putting it on the cloud soon but I believe it wouldn't work because of the architecture of our project - we will have to slowly transition it to modern web standards (apply MVC, use WebAPIs rather than WebMethods (static) on CodeBehind files).
I really am lost. What's the best route in improving a WebForms project to modern standards? Something scalable and cloudable (if that even is a word).
Thanks.
(Let me reach for my flame-retardant underwear.)
The big difference between WebForms and more contemporary web design frameworks is that WebForms attempts to layer an event-driven forms management paradigm on a platform that is not built for events. Web pages are not desktops.
In my experience, the efforts to maintain the illusion of web events in a complex application far outweigh the investment in taking the original functional requirements to MVC, or NodeJS, or React, or some framework that is designed for the calls and responses of the stateless servers of the Web.
I vote do-over. You will have to do your own cost/benefit analysis if you want to take that route. If you do go that way, this forum is a good place to post specific questions with code samples related to coding problems that you uncover on your journey.

asp.net core 2.0 dotvvm vs razor pages - which one is more powerful for an interactive web app?

With the latest release of ASP.NET CORE version 2.0 we now have Razor Pages which I really like because it shows a MVVM way of developing which I am already familiar because I've used it in UWP.
I was searching to develop web apps without js because I am a .net developer and I came across this framework known as DOTVVM , it is great because it gives some features of js frameworks like Angular, React etc. and it also integrates very well with ASP.NET CORE 2.0
I want to discuss this between following 3 scenarios :
I should use DOTVVM and not use JS at all.
I should use Razor pages instead with asp.net core 2.0, because razor pages provide all functionality which dotvvm provides and it will have more community in future.
I should learn a JS framework like Angular or React because neither razor pages, nor dotvvm is powerful enough to replace them.
The discussion can be from point of view of all developers, so I can get opinion of JS developers as well as those who have worked with dotvvm or Razor pages. The aim is to create completely interactive and responsive web app with good performance.
**Important : ** the web app created can be a progressive web app from the start or maybe turned into a pwa after creating it, depends on the technology I choose at the end.
I know for a progressive web app I will need to write a little JS, but that is alright considering that is very simple and little to write.
The reason of this question is so that we can discuss these options from multiple perspectives and deduce a better option at the end for my app.
It really depends on the type of the application you are trying to create. The fact is that you can build any application in any web technology. The difference is only in how difficult it would be.
Razor Pages are very easy to use and they are part of ASP.NET Core platform. They are using the MVVM pattern, but they are not helping with client interactivity. If you need to hide some form field based on some condition, you would need to do it in JavaScript.
I would use them for a simple company website, very simple admin sites with few pages and trivial forms, or for a public facing part of some eCommerce site. I would probably use also jQuery or other libraries to do the interactivity, animations and things like that.
DotVVM is an MVVM framework which helps especially with web applications with complicated UI: lots of complex forms with dozens of fields and interactivity (when you select an item in a combobox, another combobox will get new values, some fields will be pre-filled, a part of the form will disappear or change and so on). Modal dialogs, multi-step wizards, lots of grids with data, sorting, paging...
Because DotVVM handles many things for you and translates the data-bindings to JavaScript, you don't need to write the JS yourself. It doesn't mean that you should not learn it. It will help you a lot if you know it - you will be able to add even more interactivity, extend the framework when you need it and more. DotVVM lets you do quite a lot without knowing JS, but you will get much further if you know it.
Angular, React or other client-side frameworks are used widely today and many websites and applications are built in that. They are more universal than DotVVM, which aims primarily at the business app segment and requires .NET on the server (because it is not only the client-side library).
Using Angular or React requires the knowledge of JavaScript, and not only that. You will need to know Node.js and the related tooling, like npm. You will need to exchange data with the server, so you will need to build probably a REST API, use Swagger to generate the client-side proxy classes, and then you will probably need some other JS libraries with controls and things like that.
It is quite a lot of things to learn and if you are used to the comfort of Visual Studio, like the IntelliSense or the debugger, you will miss these features for sure.
And finally, you don't need to stick to one technology. You can combine Razor Pages with DotVVM for example. You can make the admin dashboard in DotVVM and the public part of the website in Razor Pages.
Microsoft is coming back to the WebForms approach to simplify the project structure trusting in the "Convention over configuration" mantra, while hiding the configuration from developer to make things faster. But it has the disavantage that everything will be mixed again. I doesn't look like a smart move for organizing. But... Hey! Something new must catch the attention of the dev towards Microsoft.
If your page uses an MVC Web API for the REStful, it's really more easy to just use Razor pages. If not, I would recommend you to use Core MVC.

Converting / Porting a C# app to a web based technology

Has anyone heard of a way to port or convert a C# desktop application to a suitable web technology. The important factors here would be high framerate, used for displaying flashing objects onto the display.
Or, alternately what is the best web language to use for a good response time (JS, Java Applet, etc). If anyone has done anything with similar requirements, what have you tried?
EDIT: It's a C# .NET 2.0 Windows standalone desktop application. I really don't know anything more, I was just wondering if any technology exists for any kind of C# application to any kind of web technology. This is for a job I'm applying to and I was just asking this for insight.
This is a very subjective question, but I have been doing some web development that specializes in creating highly dynamic front end environments so I can give you my two cents.
You are a C# developer (which implies you have used .NET in the past). If you want to remain loyal to MS, you could try developing web application using their ASP.NET MVC frameworks. I would shy away from Silverlight as MS has no intention of actually enhance it from what I have heard (Build conference).
Personally, I have been using AngularJS, HTML5, D3.js to create highly interactive, data visualization applications that resemble in terms of interactiveness a desktop app.
EDIT:
On the last Build conference, it was easy to tell that MS was trying to push for web technologies over desktop technologies. They are pushing stuff like HTML5 and Typescript (which integrates nicely with VS). They had no mention of any desktop technology which infuriated quite few people. So, if you want to embrace the future: go for HTML5 and JavaScript (Typescript)
EDIT 2:
Links:
http://angularjs.org/ (A very easy to use MVC front end framework, it goes nicely with the ideas behind MVVM)
http://www.typescriptlang.org/ (Microsoft's favorite flavor of JS)
http://d3js.org/ (A very cool library for data visualization, if you are interested)
Well, you have Silverlight, which can use C# that can do serious graphics, but it probably doesn't have much of a future. Microsoft has it on the axe list.
You could always use HTML 5 Canvas, which has very good support for complex graphics with high frame rates. You are going to have to rewrite your code though. I have never heard of anything which can convert a WinForms application to the web with any degree of reliability.

Is there a reason to use a Javascript framework in conjunction with ASP-MVC?

I'm bringing myself up to speed on Javascript, and I'm beginning to wonder if there is a purpose to using a Javascript framework like Backbone/Knockout if I'm already using ASP.Net MVC on the server side.
Since I'm trying to create a single-page browser experience, I can see why having a Javascript framework would be useful in general, but I'm beginning to wonder if I can't create a better experience just relying on AJAX server connections to update the page portions I want refreshed. I guess in general: what is the purpose of a Javascript framework?
While there are plenty of advocates for using Backbone and Knockout with MVC (Scott Guthrie was one of them with his SPA sample project), I find it overkill for a lot of my projects.
Lately I've been quite addicted to managing my JavaScript dependencies with Require.Js. It speeds up loading, helps me to modularize my code, and provides some handy uglification. However, at the end of the day, it is up to you to decide how much client-side architectural overhead you need.
As an aside, you may want to consider AngularJS as an alternative to Backbone/Knockout.
First off, I would say that nowadays most users expect dynamic experiences as well as responsive interfaces (responsive in terms of speed not the buzzword responsive). To achieve this, using JavaScript is generally the way to go. Usually you save yourself round trips to the server, which take up time and bandwidth.
As far as using a JavaScript framework, and choosing which one to use, that is really going to depend on the type of application you plan on building. For example, Backbone is great at structuring your application, whilst Knockout is great at handing user interaction. There is a bunch more variables that go in to this though, and there are plenty of blog posts which compare and contrast the various frameworks.
You will be hard pressed to get a truly interactive and dynamic web application without using JavaScript these days. The various frameworks will hopefully help you achieve the features you would like.
Javascript frameworks make SPA's and rich client side interactivity smoother, at the cost of more implementation than server side alone. The workhorse of Knockout is it's ability to update the DOM real time when models change, so you don't have to navigate and modify the DOM yourself. Its a tool. If you need it for your project, then by all means give it a shot, its probably worth the learning curve and learning javascript the object oriented way. If not, then you are wasting valuable slacker time by creating client and server side models.

Learning C# prior to learning ASP.NET MVC?

With only mild programming experience in the past, I was wondering about C# and ASP.NET MVC..
Do you guys think it's a better idea to learn C# before learning ASP.NET MVC? I've already delved a little into both of these already, but I still need some help deciding.
I think I would be a much stronger MVC user if I had more knowledge of the C# language itself.
What do you guys think?
Thanks!
If you're going to use C# to code your ASP.NET MVC Models/Controllers/etc. then yes, learn C# before you dive into ASP.NET MVC.
That way, you'll be able to better handle the language issues you're going to run in to when composing your .NET MVC application. Otherwise you're going to be trying to learn two things at the same time and not get a good grasp on either one.
Master C# first, then go to ASP.NET, then learn MVC and other patterns. Don't bite off more than you can chew, newbie mistake.
I agree with your third paragraph with C# at your back you'll be a stronger ASP.NET MVC developer; but I also think that they (C# and ASP.NET MVC) make great co-learning tools. And if you're going to try to pick up both tools, doing it together makes a lot of sense.
ASP.NET MVC is a pretty tough framework to start out on. It assumes you are already versed in ASP.NET, and ideally you even have a little bit of Ruby on Rails or similar experience too (ASP.NET MVC was really influenced by rails). On top of all of that good knowledge of C# is also very helpful.
I guess it depends on what your needs are. Are you going to create a mission critical webapp that your business depends on? In that case, yeah really learn ASP.NET and C# well. If this is just for a hobby and/or learning, then I say just go for it and learn C# as you go.
I jumped into Rails and Django without learning Ruby or Python first.
You learn what you need to know pretty quickly and everything you do learn is always guaranteed to be practical and immediately useful.
If you already understand MVC you already know which piece of code does what.
Knowing C# before jumping into anything .NET related is very recommended if not required. MVC is only a way of making webpages with the tools of ASP.NET which uses C# and VB as its backend languages. MVC is actually called ASP.NET MVC. Think of C# as the equivalent to PHP or Ruby in "Ruby on Rails".
Learn C# first. C# will be around for years to come; MVC may or may not be (Microsoft has a long history of handling web site code with flavor-of-the-month paradigms that don't age particularly well).
I have to disagree with Matt Greer about any assumption for MVC that you are already versed in ASP.NET. Nearly all of the tutorials and/or books that I've come across definitely do not start from an assumed ASP.NET knowledge base. In fact, for a junior developer, I'd think that knowledge of ASP.NET would be detrimental and confusing, as ASP.NET adds a whole bunch of stuff (designers, viewstate, abstractions, etc) that really is sort of the antithesis of ASP.NET MVC development.
ASP.NET MVC, however, is a framework that definitely requires knowledge of C# or VB to implement properly. In the end, any of the code that drives the site will be written in C#. The ability to properly write .net code is a definite requirement.
I'm personally very partial to Apress books, so I'd recommend the following:
Apress Beginning C# 2010:
http://www.apress.com/book/view/9781430231714
I'd also recommend from experience
Apress Pro ASP.NET MVC 2:
http://www.apress.com/book/view/1430228865
Another really great series for learning ASP.NET MVC 2 is the screencast series available from tekpub at:
http://www.tekpub.com.
Asp.net MVC is a framework for web development on top of .net developed in C#.
So if you want to know the priorities(not necessarily in a waterfall model, you can learn them in parallel):
First you must learn C#(some oo priciples and the way you must structure your code).
Second you must learn the rules and techniques
in web development (Html, Css, javascript, Web Architecture and the way it works(concepts like session management, cookies, etc) ...)
and Last learn
the Asp.net MVC

Categories

Resources