How to write a good core architecture for a project in ASP.NET MVC - c#

I'm going to have to write a big system in January with ASP.NET MVC3 / C#, and need to know how to write a system that will WORK. I do have a bit of experience with ASP.NET MVC and C# but would not call myself an expert. It needs to be extensible so that I can extend it later with new features. How would one go about this? Is there books that explains this topic in detail or should I use trial and error?
In short I need to know good design practice in my code thats extend-able for the future.
Regards
RaVen
The System will be a community portal with forums ratings etc. Cant say more than that << Company Policy>>, The forums I can manage because of plenty open source options... But the rest is up to me.

SOLID == Great Success
Follow SOLID principles in any project and you'll do well.

With regards to core infrastructure/architechure, SharpArchitecture is a good place to start. It is by no means the perfect solution...BUT they give you a good framework to play with and you can have a working system quickly while learning the concepts that work and don't work over time. Take a look and see what you think. It uses NHibernate, Castle and MVC.

Test Driven development will ensure quality for your project. Be strict with yourself, red green refractor. One of MVCs strengths is that it's easier to test.

Professional ASP.NET MVC 2 is a good starting point, though, I would assume that they'll come out with an MVC 3 edition as well. The NerdDinner tutorial contains a lot of ideas on how to structure your application.
Basic advice: work with the MVC architecture, not against it. Understand your application, especially your data model, and layer that onto your application structure. Typically you'll have a controller per model, but not always.
If you want more detailed advice, you'll need to be more specific about your project. I'd suggest coming up with specific questions about various details of your design as you have them, rather than a single question covering the whole project. The latter probably won't get the kind of response you desire.

you can use my "awesome" demo as a start
http://awesome.codeplex.com

If it's going to have to be extensible, make sure you write tests. You'll save yourself sleepless nights in the long run when you fix something, but ended up breaking the entire system.
As far as how to make things "WORK" - that depends on your ability. Read, and look to improve things, but don't get caught in premature optimization or it will leave you dead in the water.

Based upon your edit and your abilities, it might be wiser to select an open source CMS written in ASP.NET MVC and support it. Your skills are good enough, it sounds like, to learn how to write modules and be part of a larger community. You do not sound like you really want to write the whole thing because you are timid about your skills, deadlines, etc. Whilst learning the ins and outs of a well written piece of software, one day you may choose to write your own or contribute to a core piece of the software. There are several to choose from see my comment above under your question.
edit: I also think this will allow you to just start and not worry about every design paradigm people will throw at you for success.

WhoCanHelpMe is a nice reference application. It's built upon S#arp Architecture which is a good starting point for an MVC-application using domain driven design. That will also help you on the way with wiring IoC and db-stuff.
Remember that not every example and framework will fit your requirements, so do as jFar said, think SOLID and make your own decisions based on principals.
You should also look into MEF for extensibility.

Related

How should data be accessed. The working practic

I am newbie C# developer. When I just have started to learn programming thins were pretty simple, you see the problem, you develop solution, test it and it works, that simple.
Then you find out the design patterns and the whole abstraction thing, and you begin to spend more time on the code that yields no results, always tiring to protect code from possible changes in future. More time less result.
Sorry for the boring introduction, but I just trying to show how frustrated I am now.
There is a bunch of data-access technologies provided by Microsoft itself, and even larger bunch of technologies provided by third-party companies.
I don’t have team leader or neighbor super skilled programmer friend, so I have to ask an advice from you.
How do you realize the data access in your real applications written in C#?
From a very overall perspective, I always hide and data access implementation details behind an interface, like this:
public interface IRepository<T> { /*...*/ }
The .NET framework offers a lot of different ways to access data, so I can understand that you are confused. However, at this time, there are only really two or three reasonable options for accessing relational databases:
NHibernate
Entity Framework
(Low-level APIs like IDataReader may still have their place in limited scenarios)
It's often difficult to see the benefit of abstraction without seeing the benefits it provides in a real world application. The best advice I can give is to read up on the SOLID principles then in writing your application try and think about ways the client may come to you and say "Now I need it to do this" which maybe a subtle change to the functionality or a major change. Think about how this would affect your code and in how many places you'd need to make those changes. Once you've made those changes how confident would you be that you haven't broken something else?
Another idea would be to download one of the sample applications. One of my particular favourites is the Data Access Platform sample provided on Codeplex. Try working through this code and see how the abstraction and pattern implementations minimise the impact on the code overall when it comes time to change.
The bottom line is it's easy to learn a programming language but understanding how to build robust solutions with it takes time. Stick with it though because when you do finally get a good understanding of software architecture it's immensely rewarding.
Some points to consider for the DAL: (note: very opinionated, but answers to this question have to be)
Encapsulate logic behind a Repository
Use interfaced-based coding
Use Dependency Injection
Use a mature ORM like NHibernate/Entity Framework 4.0 (but know when to use SPROC's for db-intensive work)
Use the Unit of Work pattern
Prevent SQL Injection attacks by using parameterized queries (or LINQ-Entites, as above)

Planning a programming project by example (C# or C++)

I am in the last year of undergraduate degree and i am stumped by the lack of example in c++ and c# large project in my university. All the mini project and assignment are based on text based database, which is so inefficient, and console display and command, which is frustrating.
I want to develop a complete prototype of corporate software which deals in Inventory, Sales, Marketing, etc. Everything you would usually find in SAP. I am grateful if any of you could direct me to a books or article or sample program.
Some of the question are :
How to plan for this kind of programming? should i use the concept of 1 object(such as inventory) have its own process and program and have an integrator sit for all the program, or should i integrate it in 1 big program?
How to build and address a database? i have little bit knowledge in database and i know SQL but i never address database in a program before. Database are table, and how do you suppose to represent a table in a OOP way?
For development type, which is better PHP and C++ or C# and ASP.NET? I am planning to use Web Interface to set form and information, but using a background program to handle the compute. .NET is very much integrated and coding should be much faster, but i really wonder about performance if compared to PHP and C++ package
thank you for the info
This may not answer your question directly, but I thought this might help you get started in some way. So here it goes: I would say, "think through the process". This means, think through the software development process:
Gather requirements
Identify and define the problem.
Get as much information/facts as you can. (turn on green light, think about everything that you want to go into your software)
Come up with a baseline (turn on red lights, what you really want? the minimum functionality your software "must have" - cant live without)
Analyze
Know what you don’t know, what are the missing facts?
Evaluate your information or lack of it/reliability of information source.
Infer facts that you don’t know.
Form an assumption, opinion, or possible solutions.
Consider alternatives and implications of each solution.
Form an action plan.
Identify technology pros/cons.
Decide technology
Comeup with a functional specs.
Research
Dig into stuff that you would want to know (Best database, ORM, design practices, code samples - gather everything, read about inventory systems that are already there)
Design
Develop
Test
Fix
Prepare deployment plan
Release the product
Gather user feedback
Analyze user feedback
Plan for items in next release.
Repeat steps
And Enjoy!
Before I start this is a shallow answer to a deep question.
1) It looks like you have a reasonable grasp of the major components of your target application. As a .net developer I'd build assemblies that matched broad areas of functionality (not sure what the equivalent is in PHP) and then you can use those assemblies together as a single large app, or seperately as required. It's unlikely you'll get it right first time, so build it how it feels right, and then do some ruthless refactoring to make it better once you've got a handled on the problem.
2) This whole area is covered by Object Relational Mapping - ORM, NHibernate is the best of the bunch in the .Net world. BTW if you learn that you'll be way ahead of the game come graduation/work time. Raw sql is so last decade. I guess you know that Sql Server Express is a free download?
3) For development go with the languages/environment you feel most comfortable in. My preference is .net, and the integrated coding is much faster. Performance is definitely good enough, especially as this is learning project - SO runs on .Net and that supports a gazillion users pretty well.
Enjoy
I don't have any good recommendations for SAP-like projects in particular, but in general the best examples to use for things like this are well-established open-source projects. Anything else is going to be a "toy" example in one way or the other, and will be simplified and cleaned up. It's the "cleaned up" that makes it most unrealistic -- one of the really key things that makes real-world large software projects different from university examples is that the real world is messy, and real-world requirements are messy, and collaboration between lots of people with not quite the same priorities is messy, and real-world software projects have to adapt to and thrive in this messiness.
In answer to your specific questions, though:
1.) Do things in a modular way. This means you have something you can test and work with as soon as you get the first module done. That's especially important when you're learning, because (a) you probably won't have time to actually finish the whole thing, (b) you'll learn a lot from writing the first bit that you'll want to apply in future bits and then you'll probably want to rewrite the first bit, and (c) you'll learn even more from using the first bit.
2.) There are many views on this, and many online articles and books. I can't answer that in an answer here (except to note that in some cases trying to represent it in an OOP way is the wrong programming paradigm -- be careful about overconstraining the answer by the question you ask!); the right answer is to find things to read and spend some days reading them.
3.) You do not care about that sort of performance issue here. Successful programs have been written in both forms. You care about what will teach you the most, and what you are comfortable working with. Either one should be fine. You'll probably find more open-source pieces to look at with PHP and C++.
Your question pretty much covers the whole gamut of planning for a project; a whole thesis might be written (+:
Keep in mind what your team and your teaching-staff want out of the project.
1) Modular is my choice. It'll force you to address the application one module at a time and keep you focussed, but that is subject to
The familiarity of your team with the preferred/recommended language for this project.
Time in hand
Remember that modular means you will necessarily have to provide for module integration too.
2) C++ or C# ? Whichever offers the more learning experience. My own experience with both mentioned technologies is limited, but I remember there used to be a Database Template Library (DTL). C# on the other hand will probably be faster to develop. I could be wrong. There are any number of free DBMS engines available on the net. Unless the assignment explicitly recommends using a text, opt for one of these.
3) I concur w/Brooks up there ^^^
Good Luck!
You are a university undergraduate. And you are talking about complete inventory system.
I suggest building a blog application first with all the best practices (like blogengine), then move to e-commerece sites (nopcommerce, dotcommerce). And then do whatever you like.
This is a common problem with undergrads like you, of jumping way higher without building any simple projects first.
As a full time PHP developer, PHP sucks! ASP.net is okay (mmm... no it sucks too), but it locks you into proprietary licenses.
If you're starting from scratch, go for node.js. It's c++ and server-side javascript. Yes, it's new, but it has engineering promise. It'll be more commonplace in a few years.
And if you're worried about performance, don't. Javascript in V8 is extremely fast.
http://shootout.alioth.debian.org/u32/which-programming-languages-are-fastest.php
Here are some node.js links to get you started:
http://www.delicious.com/homer6/nodejs
Enjoy.

Key things to learn to be a senior developer under the MS platform

I know the following:
asp.net webforms, mvc, sql server 2005/2008, web services, and windows services.
I want to expand so I can be a little more versatile.
What things should I be focusing on? (this is general guidance, with a web focus)
I am thinking:
SSIS
windows workflow
sharepoint
What other common skills should I know that seem to be go well with what I know already?
Architectural/design patterns are a big plus. Understanding how technology should be applied when in charge of an application, what technologies to choose in different situations.
If you like the web focus, AJAX, the MS AJAX framework, JQuery, is good to know. Silverlight is also good to know...
Not technologies but principles really
SOLID
ORM
TDD
DDD
Er, learn how to lead a team. Your seniors will promote you when they trust you to lead. Listing more platforms doesn't do anything unless you're trying to get hired somewhere else.
Here's a start.
A mindset for test-driven code and continuous integration will get you far, I've found. Keeping these in focus while developing will give you a safety net to fall back on while minimizing risks of regression bugs.
Keep an open mind on the 'how' to do things, and constantly ask 'why' you are doing things the way you are. A true senior developer under any language won't mind being shown a better way to do things. Use tools that analyze your code (PartCover, nDepend, resharper) and understand their suggestions.
Work on some open source projects -- learning in a silo won't give you constructive criticism on what you're producing.

MVC or Webform Architecture for new site

I'm developing a website , job portal. I have 2-3 years of ASP.NET webform development experience,
I want to create a professional job portal site (to improve and learn more) but trying to decide on best architecture. Any suggestions or advice will help...
Thanks
Well, there are a number of ways to answer this question, and I'm sure many others will chime in. I'll just say that since your goal is to improve and learn more, and you already have 2-3 years of webform experience, this might be a good opportunity for you to learn MVC. Then you will have experience in both, and can make more informed decisions regarding the best architecture for future projects.
Happy learning!
Whilst nobody can tell you exactly what to do, the team I manage is about to release a new CMS / Job portal using ASP MVC. MVC gives us excellent testability and scalability out of the box and it can be quickly combined with tools such as nHibernate / windsor (IOC) / nCache / jQuery - this ensures that you have a wealth of resources on the internet to help accelerate your development and skill. You can also embrace standards such as XHTML 1.1 strict, which is almost impossible with ASP.Net webforms due to the auto generated HTML
1 other advantage is that you also get away from the dreaded ASP.Net viewstate.
Use ASP.NET MVC if you want to:
learn the ASP.NET MVC framework
use jQuery or similar libraries
really learn web-languages (HTML, CSS, JavaScript)
use Test Driven Development
have a clean separation of concerns
If you don't have the time or will to learn to use the ASP.NET MVC framework correctly, stick with ASP.NET WebForms.
My answer is almost always "ASP.NET MVC." The amount of flexibility and features and testability and maintainabilty and ... heavily outweigh WebForms.
WebForms has the advantages of a rich ecosystem of existing controls and documentation, and is really powerful for some kinds of tasks (complex, multi-form interactions), but I find its limitations get in the way far too often. You have to mold yourself to it.
It really depends on what the end goal of the application is. As Scott Ewers said, if your goal is to learn, then using ASP.NET MVC will expand your breadth of knowledge in the ASP.NET space (since you already know web forms).
Additionally, if this is going to be a public product, you can leverage the testability benefits of MVC and run automated unit tests. Key ideas like Separation of Concerns can also increase long-term scalability and maintainability.
The primary reason why you might choose web forms is if you are rapidly prototyping the job board application. As you know, web forms allows you to drag-and-drop components onto the canvas to quickly create some basic data entry functionality.
There is a herding code podcast from May 13 on the subject.
Herding Code 47: Joe Brinkman on Webforms vs ASP.NET MVC.
I also agree that choosing MVC would have the advantage of allowing you to expand your knowledge. That not being the only reason, given the choice as well I just finished a small MVC project (my first) and let me tell you MVC rocks! Its a great framework which I feel gives you more flexibility and at the same time out-of-the-box tools to create a web app quickly and painlessly. It was my first experience with VS2008 & .NET FW 3.5 & LINQ, and all the guides at www.asp.net helped me go forward quickly (especially the free tutorial chapter from an MVC 1.0 book mentioned here).
I also got to learn JQuery along the way, as it is very much integrated into these new technologies.
One think to take note though is that this being a new tech, version 2 is already being cooked up, so if your project is for the long run, have that in mind and plan accordingly (in my case, being a small project, I'll probably try upgrading my project to version 2 when its officially released). Yet at the same time, having a fully MS (and thus MSDN) supported version 1 was a godsend for me...
Good luck!
I have good experience in Jquery, CSS, HTML, Javascript but not in TDD.
I have time..and willing to learn MVC but wasn't sure MVC is good choice for Job portal or similar site..
This can be considered a shameless self-advertisement but here is my quiz on how to choose between the two:
http://sietch.net/ViewNewsItem.aspx?NewsItemID=101
I was recently tasked by one of my clients to write a paper, or simply a checklist, that would help other lead developers make this same decision.
I posted the first 2 rough drafts on my blog. I am admittedly pro-mvc but the paper/checklist has been we received so it might be helpful.
http://eric.polerecky.com/archives/a-somewhat-less-biases-comparison-of-mvp-and-mvc/[http://eric.polerecky.com/archives/a-somewhat-less-biases-comparison-of-mvp-and-mvc/][1]
I think the most often overlooked benefit of MVC is convention; I really see any convention in webforms projects and while not strictly enforced in MVC projects at least its there.
i started developing our current app in webforms, mvc wasn't available when development started.. i've chosen the MVP pattern, with URL rewrite HTTP module. currently i'm investigating plugging in some MVC into this, basically to use the front-controller instead of using page-controllers. the other things in already established MVP architecture with web forms in my app give me more flexibility than pure MVC approach without WebForms, which i like, although require a bit more code than MS MVC examples (never tried it for real project to see if it stays that way, like in those examples in screencasts).
what i don't like with MVC is mixing control code inside templates - i believe loops, ifs and stuff like that just shouldn't belong inside the template. but a couple days ago i've ran into Spark view engine that looks kind of promising in that segment, although not still close to the Tapestry 5 (a component-based webGUI framework) in the java world.
But the above mention suggestion to mix both might work for you to explore MVC world and have the safe ground to fallback to if something won't work for you might be ok for you.

How long would it take a non-programmer to learn C#, the .NET Framework, and SQL? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am not that good at programming. I finished my masters degree in electronics. I want to learn C#, the .NET Framework, and SQL. How much time do you think it would take (if I have 5 hours a day to devote to it)? Also, what order do I learn them in? I have Visual Web Developer 2008, is that enough to begin?
Copied from a new question by the same user:
I should have specified that I wish to make a career out .NET Development. I'd like to give myself 2 months to get the 'basics' down. As a developer, what is expected out of you in IT companies? What skillset do they require and what are the responsibilities as a junior or mid-level developer? I don't have any industry experience, will I be able to get a feel of the job duties while at home?
That's like asking how long it would take to learn French:
1 day to learn what it is
1 week to learn it to an infant/elementary level
1 year to be considered a beginner by professionals
Several years to be considered an experienced professional
Plus there's "deep" knowledge of those subjects which a mere mortal such as you or I will never learn
Then again, plenty of people (most normal people, non-programmers) never learn those subjects, so if you're like "most" people then the answer would be "it would take forever" or "it will never happen".
Dive right it, make it a hobby, and have fun :)
Coming from an electronics background myself I can tell you that you should pick it up pretty quickly. And having an electronics background will give you a deeper understanding of the underlying hardware.
IMHO the root of information technology is electronics.
For example..
Think of objects as components.
The .NET framework is essentially drawers full of standard components.
For example you know what a 7400 (NAND gate) is capable of doing. You have a data sheet showing the pin outs and sample configurations. You don't typically care about the circuitry inside. Software objects are the same way. We have inputs and we have methods that do something to the inputs to produce predictable outputs. As developers we typically don't care how the object was written... just that it does what it says it will do.
You also know that you can build additional logic circuits by using two or more NAND gates. This of this as instantiation.
You also know that you can take a NAND gate and place it inside a circuit where you can modify the input signals coming in so the outputs have different behaviors. This is a crude example but you can think of this as inheritance.
I have also learned it helps to have a project to work on. It could be a hobbyist project or a work project. Start small, get something very basic working, and work up from there.
To answer your specific question on "what should I learn first".
1) Take your project you have in mind and break it into steps. For example... get a number from the user, add one to the number, display the result. Think of this as your design.
2) Learn basic C#. Write a simple console application that does something. Learn what an if statement is (this is all boolean logic so it should be somewhat familiar), learn about loops, learn about mathematical operations, learn about functions (subroutines). Play with simple file i/o (reading and writing text files). The basic C# can be thought of as your wiring and discrete components (resistors, caps, transistors, etc) to your chips (object).
3) Learn how to instantiate and use objects from the framework. You have already been doing this but now it's time to delve in further. For example... play with System.Console some more... try making the speaker beep. Also start looking for objects that you may want to use for database work.
4) Learn basic SQL. Lots of help and examples online. Pick a database you want to work with. I personally think MS Access is a great beginners database. I would not use it for multi-user or cross platform desktop applications... but it is a great single user database for Windows users... and it is a great way to learn the basics of SQL. There are other simple free databases available (Open Office has one for example) if you don't want to shell out $ for Access.
5) Expand your app to do something with a database.
Just do it! Don't sweat the details.
Well, it will take you forever. There is so much to learn about programming that 10 years are not enough.
http://norvig.com/21-days.html
Don't get me wrong, you will learn the basics quickly enough, but to become good at it will take much longer.
You should focus on an area and try to make some examples, if you choose web development, start with an hello world web page, then add some code to it. Learn about postbacks, viewstate and Sessions. Try to master ifs, cycles and functions, you really have a lot to cover, it's not easy to say "this is the best way to learn".
I guess in the end you will learn on a need to do basis.
The best thing about C# is that it is very catchy. Easy to pick up, and you'll also have fun doing it.
But .Net framework is a very big library full of wonderful things to discover, and yet again due to the nature of .Net you'll also have fun learning it. It's a coherent, object oriented, well documented library, and C# makes it so simple to work with it that you can simply discover your way through it while coding.
The vast majority of articles, books or resources about .Net and C# simply concentrate on explaining functionality and the framework and far less about how to avoid quirks, workarounds or exceptional cases, like it happens with other languages I don't want to name (*cough C++*) so in the end the experience of learning C# and .Net is very enjoyable from start to finish, and the things you can accomplish using .Net also makes it very rewarding.
You picked a good language to start with, in my opinion, and finally to answer your question, it will take you about:
2 to 3 months to learn the basics
1 to 2 years to become a versed developer
5 years or more to become a expert or, depending on your dedication, a "guru".
But then again, beating the numbers and breaking the limits lies inside human nature. Can you do it faster than this? ;-)
How long is a piece of string? I think this is subjective. I know programmers that have learned an extraordinary amount in a very short time based on the experience that they've exposed themselves to.
Basically, get your hands dirty and you're bound to learn more.
It really depends on what you mean by "learn". You could probably spend a week and get a couple of pages up on the web that had some minimal level of interactivity to save information entered by the user in some database, and then have some other pages for querying and displaying the information. You could then spend the next 10 years of your life learning all the intricacies of the .Net framework, SQL, and mastering using the IDE.
The period of which you are capable of learning really depends on your ability to grasp the logic behind programming while where to learn from depends on your learning style.
If you are a learn-by-a-book type of guy, just jump on Amazon.com and perform a quick search, pick up the book with the best reviews or wait for someone here to recommend a book (I'm not a programming by book guy)
If you prefer screencasts (video feeds demonstrating what to do) or tutorials, then go straight to the source: http://www.asp.net/learn/. There are tons of videos and tutorials explaining everything you need to get started.
Visual Web Developer 2008 Express should be all you need to get started. Basically, the express editions are Visual Studio chopped down to a precise set of functionality to accomplish one thing. They don't have some of the bells and whistles needed for large scale development, but everything you should need.
Can't tell how long it would take, it really depends on your existing knowlege. I managed to learn the C#/.NET 2.0 core basics in about 2 months.
My suggestion to you: Try to learn towards exams, they make sure your learning covers all important parts and also guide you through this new technology. See Microsoft Learning.
If you have any programming experience, you can probably learn the C# syntax in a few hours, and be comfortable with it within a week or so. However, you will not be writing complex structures unless you write a lot of code with it. It's really the same as learning any language: you can learn all the words and grammer fairly quickly, but it takes a while to be fluent.
EDIT
A book you may want to pick up for learning C# is C# in a Nutshell (3.0) which I found to be very useful, and has been recommended by several people here.
If you want to learn, REALLY want to learn, then time is not of consequence. Just move forward everyday. Let your passion for this stuff drive you forward. And one day you'll see that you are good at C#/.NET.
You'll pick up c# fairly quickly (the language syntax is not that complicated). It will take you a long time to really learn the .NET framework, but you'll pick up the heavily used parts of the framework fairly quickly, and you should start seeing patterns in the framework.
My advice to you: don't just learn from a book or website. They will teach you the language and framework, but they will not teach you how to program anything useful.
Writing little code snippets will teach you how to do a very specific tasks, but they do not teach you how to write applications. My suggestion is that you think of an app that might be fun to work on (and doable... e.g. don't think that you're going to write an operating system or crysis or something in a month or two). Personally, when I was learning, wrote my own full featured IRC app, complete with rich text, personal messaging, etc.
The answer in my view is related to whether you have a tangible problem to solve or if you just want to learn for example to be prepared for a possible new job. If you have a problem then you are in better shape. You can start by looking around and seeing how other people went about solving that problem. Languages in general you should be able to pick up fairly quickly (after all you hold an MS in EE, no small feat IMO).
What you need to be on the lookout for is good programming practices. You'll probably see yourself asking "why is this method so small", "why is this method empty and what the heck is this abstract word doing here". That will give you perspective beyond syntax towards good writing.
When I switched careers out of Finance, I took 9 months off to study C++ full-time out of a book by Ivor Horton. I had a lot of support from my best friend, who is a guru, and I had been programming as a hobby since high school (I was 36 at the time).
It's not just the syntax that's an issue. The idea of things like pointers, passing by reference, multi-tiered architectures, struct's vs classes, etc., these all take time to understand and learn to use. And you're adding to that the .Net framework, which is huge and constantly evolving, and SQL, which is a totally different skill set than C#. You also haven't mentioned various subsets of the framework that are becoming more widely used, like WPF, WCF, WF, etc.
You're an academic so you can definitely do it, but it's going to take serious effort for a long time, and you definitely will need some projects to work on and learn from. Good luck to you.
According to Malcolm Gladwell, it will take you 10,000 hours to get really good. So get cracking.
Simple answer: a lot longer than two months. Learning to program competently will take longer than that, no matter what. It took me years to learn to be a competent object-oriented programmer, and I'm good at this stuff.
More detailed answers: it doesn't really matter whether you learn C# or SQL first, as they're very different. I'd probably suggest SQL, as it's easier to learn and more independently useful.
You will have a hard time getting used to the on-the-job realities at home, much as if you were studying plumbing or quantitative finance.
You're going to have a hard time putting all the information together without one or more projects you try to do. You're going to need to have other people to tell you when you're being stupid, when you're being overclever and will pay for it later, and when you're actually getting it.
Try to find an open source project you find vaguely interesting. Study their code. Figure out why they do what they do. Look at the bug list, and try to find something as trivial as possible to fix. Work from there. Learning to contribute is going to teach you things that are useful in the work world, and it will give you something to point at. It will be far easier to get your first job if you have some experience to point to.
All "relativity" aside, not fast. Based on the fact that you said you never programmed before...to become a basic programmer, a few years.
And to become a good to outstanding (using design patterns and industry recognized standards that relate to common standards as defined by ISO/IEC 9126 Standard such as testability, maintainability, etc.) programmer, it takes years of experience and coding often.. you do not become "Sr." or an "Architect" overnight and the same thing is true for a mid-level developer who doesn't code slop.
It's always a process where you improve. So learning is relative. But to learn the basics, seems simple until you start to design classes and interfaces. And even Leads stumble on the basics..doing things wrong. Everyone does. There is so much to be aware of.
If you're just going to be adding features (using classes your Lead or Architect has stubbed out for the team) and not really adding new classes, etc. it's easier....but you should take care in coding using standards and you still have to know complex areas of OOP. But that's not really OOP. When you start to creating classes, interfaces and knowing about inheritance, heap, references, etc. yada yada...and REALLY understanding it takes time no matter how smart you are or think you may be.
So, for a new programmer. Not easy. Be prepared to code a lot. And if you are not, find a job where you are. It's all about coding as much possible so you can get better.
Read these books FIRST. Do not dive into any others out there because they are not geared toward teaching you the language in a way you can get up to speed fast:
http://www.amazon.com/Head-First-Object-Oriented-Analysis-Design/dp/0596008678/ref=pd_bbs_sr_4?ie=UTF8&s=books&qid=1231280335&sr=8-4
http://www.amazon.com/Head-First-SQL-Brain-Learners/dp/0596526849/ref=pd_bbs_sr_7?ie=UTF8&s=books&qid=1231280335&sr=8-7
http://www.amazon.com/Head-First-C-Brain-Friendly-Guides/dp/0596514824/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1231280393&sr=8-1
http://www.amazon.com/First-Design-Patterns-Elisabeth-Freeman/dp/0596007124/ref=pd_bbs_sr_3?ie=UTF8&s=books&qid=1231280393&sr=8-3
they will get you the fasted jump start into understanding, better than any books out there.
Also for these lame type of responses, ignore them:
"Then again, plenty of people (most normal people, non-programmers) never learn those subjects, so if you're like "most" people then the answer would be "it would take forever" or "it will never happen"."
Those come from developers (typically leads) who have some Ego trip that DON'T want you to learn. Everyone learns differently and at different paces and eventually you will become "fast". I get very tired of hearing Sr. developers say statements like this when their sh** also stinks many times no matter how good they are. Instead they should be helping the team to succeed and learn as long as their team is working hard to keep abreast and doing what they can on their own as well (not leachers).
Make sure you try to get a Jr. Level Developer position first...
2-3 months to learn the basics...no way. Unless you're gonna code spaghetti sure. Same goes for the 1-2 years. Spaghetti it is then..
Build on what you already know and have a look at lot of job adverts. E.g I have seen jobs asking for WinForms/WPF AND electronics for the writing of a UI to control a custom bit of hardware.
You may find the “robotics” .net toolkit interesting.
.Net is now too big for anyone to learn both WEB and Desktop so you have to decide the way you are going to go. Web has lots more jobs, but there are very few people with good desktop stills.

Categories

Resources