The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
someone at work with no programming experience who wants to get into C# programming
Kevin Marois wrote:
1) Intro To Visual Studio - Show the basics of VS. Keep it simple. Just the major parts. Overview of Solutons and Projects.
If they are new to programming, don't get too much into this somewhat boring stuff that doesn't make much sense until other concepts are understood first. I didn't learn this very well until after I at least knew the basic syntax of the language I was working with. I say start with a Windows Forms application (pop up a "hello world" messagebox). Then maybe a console app (write a "hello world" line to output).
Then go over the concept of variables. Get to user input early so he can make dynamic programs right from the start ("hello, Bob, what is your age?").
Then show how to make a webpage ("hello, Bob, this is ASP.net"). Once he has a very basic understanding of Windows Forms, console apps, and ASP.net applications, then indroduce the concept of libraries (DLL's). Make a "hello world" project that constructs a "hello, [name]" string using method parameters. Then make use of that project from a Win Forms app, a console app, and a web app. That would be a good time to explain how projects/solutions work, and how each project will output a DLL, EXE, or web files.
Then introduce numbers and loops. Calculate the average age of all the ages entered by the user (Bob is 21, Sally is 34, Jake is 59, Beth is 43... they average an age of [whatever]).
Then introduce data structures. Store ages in a list and calculate multiple values from that list by passing it to different functions.
Then introduce file manipulation. Load names/ages from a text file.
If this person has never programmed before, there is a lot of ground to cover. Gonna need time for all this to sink in. Don't get into the more complex stuff (LINQ, WCF, threading) until later.
I think if they are new to programming then a basic tutorial of development may be in store before step 1 or 2. You can teach a lot about concepts, OO, classes, structures, etc, before they need to write code in VS. Honestly if I never coded, I would probably lose interest in step 1, or not have any clue what you are talking about in step 2. Perhaps there should be a fundamental step 0?
Imho, learning a programming language or technology (C#, ADO.NET, Windows Forms, WPF, Silverlight, WCF, etc.) has absolutely nothing to do with learning how to program. I recommend that a person who has no programming experience first grasp basic concepts. Eric Grisom's Intro to CS and Programming[^] is a great example of several free open courseware series of lectures on the subject.
When I taught CS to undergrads in the 80s, my first lecture was a simulation of a for loop that used students as individual steps of the algorithm. This amusing (but valuable) exercise drove home several fundamental points on day one of the course, one of which was computers are very stupid. But very fast.
Step 3 to 4 is much too large! Your student needs to master a significant portion of the .Net Framework before tackling SQL Server in any form. I speak from experience! I would greatly fill out the students' knowledge of the controls available and best practices for using them before ever addressing databases. In fact, SQL Server should be a separate class, with C# Programming I as a prerequisite. The rest you can add as individual advanced classes, or lump them together into an advanced techniques overview course. You can't properly teach any of them except as a focused course on each technology, though they needn't be as long as the first two courses.
One of the things missing in .net is something like Rails that puts intro projects and real world projects together. Without something simple that just kind of works like that, databases are very hard to grasp. It would be nice if .net had more of that kind of thing easily available.
My intro to computing was print statements and then drawing lines and circles etc. in basic way back when, so my experience probably doesn't apply to this all that much.
Aside from "no programming experience", what does this person know? I've had to teach people who couldn't navigate Windows, so it would be nice to know a little more before I can competently critique.
I've always gone for "This is a variable" followed by "These are control structures". But then again I'm an old fogey who doesn't quite trust drag and drop programming. I like to know what's going on under the hood and clue the student into the fact that's its not just magic. When things fail, you need to know why and how to fix them.
I stress "get five lines of code to work before you try fifty." So early introduction to debugging and single stepping is essential.
But again, I don't know the level of competency in your student.
I agree with those who said, in essence, "to teach programming, you first teach programming". I think Wirth[^] is a good first step. Teaching a GUI, or a language, isn't giving them what they need to write code - which, after all is said and done, is necessary.
I have spent 20+ years teaching programming. Exactly how you attack this depends on your use of technologies.
First of all, make sure that whatever the student learns can be quickly and immediately useful in some way and therefore fun. This is absolutely essential to retaining the material and driving curiosity.
Second, do you mostly do web applications or Windows forms applications or simply database work? Which gives the student more of a chance to actually use it for something useful to them?
For databases, I would recommend (shudder) starting with Microsoft Access, or some other platform that is available to the student, as a learning tool. Access also gives the student the ability to make some simple forms. Not only will this give the student a platform to immediately make something useful, but introduce concepts that are needed for everything else, even though the student will have to unlearn a few things afterward. If you don't use Access, but the student has access to databases that are useful, a reporting tool, such as Microsoft SQL Reporting Services, or whatever your company uses, would be a good place to start.
For Windows Forms apps, you will probably need to combine that with a simple introduction to either file or database manipulation, in order to make sure that something useful to the student can be quickly constructed. Unless you have already started with databases, I would recommend file manipulation first, as being simpler to introduce.
Once you have done the above, or if you do not do Windows Forms apps, you can get into developing C# web applications, using as simple code as you can get away with while still having the objective of doing something useful.
With my company I been pushing for all my guys who have basic computer experience to start using it as a tool to make their life more efficient. I think one of the best tools for the introduction to programming VBA. Yes I know its not considered as a true programming language, but it has some good merits.
1. Free. It is included in most if not all Microsoft software and some others. Its a good way to actually see if you are interested in programming but not have to shell out the cash to find out.
2. Record Macro - You know what you want but not sure how to start programming it. Press the record button the program will attempt to record your steps in a program type fashion. Making macros is pretty much the fastest way to program something without having vast programming skills and get immediate results which is important for beginning programmers.
3. Tons of information and good examples on the internet. (That pretty much goes for anything now-a-days)
4. Making the transition to Visual Studio or Databasing (through Access) is not such a big step.
you need to teach them basic programming concepts before you get into framework/library, OOP and other various programming technologies. Think variables, variable assignment, if statements, loops and then move on to advanced (!) topics like functionsand function parameters.
Real world apps make terrible basic programming assignments because of all the distracting stuff you have put in there. Error checking, well designed code, UI design, etc.
At least, that's what I learned back when I used to teach beginning programming to non-programmers years ago.
I think you need to make it goal oriented... Something like this :
1. Create a console application that prints its first command line argument. (the basics)
2. Make it print all of them and print a warning if no argument are passed. (flow control)
3. Make it parse all arguments as int and sum them. (use variables, understanding types int/string)
4. Make it take the first argument as a mathematical expression, split by operators (+ and -) and apply them. (advanced work with data)
5. Declare an interface Expression that define a GetResult and a class for Number, Addition and Subtraction, then build an execution tree to get to the same result. (basic OO)
6. Make it work using Polish notation instead. (refactoring)
7. Implement Division and Multiplication with correct operation priority. (exploring OO)
8. Create a Windows forms UI for a calculator with a text box where the user can type an equation. (forms)
9. Parse this equation for parenthesis and operation priority and reformat it as Polish notation. (advanced data manipulation)
10. Pass this equation to the command line application previously developed and show the output. (how to look for functionalities in the framework and MS documentation)
11. Integrate the calculation code into the forms application as a separate project, add the dependency and make it work. (multiple projects, dependencies and refactoring)
12. Create a database in SQL Express and add a database for logging previous calculations with input and output. (database design)
13. Use a typed dataset or entities or whatever technology you want him familiar with to add one row to the table everytime a user presses "calculate". (simple inserts)
14. Use the database as a cache to bypass the calculator and retrieve the answer from the database if the calculation was requested previously. (simple queries and refactoring)
15. And from then on, he's ready to start fixing small issues or developing small chunks of functionality in your actual applications, either in pair programming or with constructive code review.
For Part 2 check out Rob Miles CSharp Yellow Book - a free PDF - Good coverage of the basics of programming in C#. You might also check out another free PDF book by Charles Perzold - DotNetBookZero. Very good, comprehensive coverage of C# programming, but it's a bit more advanced (geared towards C and C++ developers making the move to C#). If you pull from both, you should have all of the material you need to do a beginning and intermediate course in C# programming.
Intro to SQL seems fine for Part 3.
Part 4 - I believe I would make the Threading and Reflection intro level and save the advanced specifics for Part 5. Threading in particular is very difficult (even for advanced programmers) to do well. Keep everything in part 4 at the intro level. All you want to do here is give a basic understanding of all the options available. I would also consider adding intros for SDLC (Software Development life Cycle) and TDD (Test Driven Development).
Part 5 - These should be individual advanced courses delving into all of the things you have an intro to in Part 4. You might also want to have available advanced courses in Software Design and "Best Practices".
I would not have the student(s) work on anything I intend to use in a production environment until they are well into the courses for Part 5. Until then they will have no (or at best little) concept of good software design or programming best practices.
At the very advanced level, you might want to make available cources in ORM (Object Relational Mappers, NHibernate and FluentNHibernate come to mind as a very mature ones), Object Databases - Perhaps Versant's db40, and frameworks such as the Spring.NET Framework and Microsoft's MVC Framework.
Kevin Rucker, Application Programmer
QSS Group, Inc.
United States Coast Guard OSC
"Programming is an art form that fights back." -- Chad Hower