Tag Archives: C# tutorial

C# 2012: Anatomy of an Async Method

There are two new keywords added to C# for asynchronous programming: async and await. The async keyword is a modifier for methods, delegates, and lambdas to indicate to the C# compiler that a method might contain async code. It also allows other code to call this method asynchronously. 

If a method doesn’t contain async code, it executes synchronously, but you will receive a warning message from the C# compiler. To run code asynchronously, use the await modifier when executing a method, anonymous method, or lambda. Here’s an example of using async and await keywords to implement an async method:

The async modifier indicates that StartAsync can contain async code. The await modifier calls the DoNetworkCommunicationsAsync method and waits for it to complete. In other words, it awaits the method.

Notice the suffix to the StartAsync method is Async. You aren’t required to add the Async suffix to the method name, but it’s a convention that Microsoft recommends and most developers follow in practice. Another tip on naming conventions refers to methods in earlier versions of .NET that implement EAP and already have the Async suffix—you would name them with the TaskAsync suffix.

To make the example simpler, the return type in the previous example is void, but async methods do have return types other than void. For now, let’s defer discussion of the return type until later, which is an important subject of its own.

The previous example doesn’t have any parameters by design in order to keep it simple. However, async methods can have parameters, but none of the parameters can be ref or out.

As in APM and EAP, as soon as the code calls an async method, with the await modifier, control returns to the caller while the method executes asynchronously. Expanding on the previous method, the following code demonstrates a basic example of how async methods work:

Let’s look at what this code shows in terms of control or what is running when. The specific threading model is defined separately for each .NET technology by a type derived from SynchronizationContext, but this is beyond the scope of this course.

The Main method calls the StartAsync method. Because StartAsync is modified as async, the code will run synchronously until it encounters a call to an async method with the await modifier. As soon as the code calls the method with await, control returns to the calling code Main. So you have two methods running at the same time—Main and StartAsync.

StartAsync continues by calling the DoNetworkCommunicationsAsync method. However, the await modifier makes StartAsync wait until DoNetworkCommunicationsAsync completes. When DoNetworkCommunicationsAsync completes, StartAsync ends. Control was already returned to Main when it encountered the await call to DoNetworkCommunicationsAsync, so StartAsync does not return at the end of the method, it just stops running.

That means that inside of StartAsync, all the code above the awaited method will run synchronously. At the same time, the async method runs. When
DoNetworkCommunicationsAsync completes, control returns to StartAsync and any code following StartAsync executes.


JoeMayoThis post is an excerpt from the online courseware for our C# 2012: Asynchronous Programming course written by expert Joe Mayo.

Joe Mayo is an author, independent consultant, and instructor specializing in Microsoft .NET and Windows 8 technology. He has several years of software development experience and has worked with .NET since July 2000.

Using Code-Focused Rapid Application Development (RAD)

There are many visual designers in Visual Studio that allow you to drag-and-drop
controls onto the screen, in what is often referred to as Rapid Application
Development (RAD). However, most applications of any significance require
code that defines the logic of that application. Visual Studio recognizes this by
supporting Code-Focused RAD—tools that help you write code faster. This
section shows a few of the ways you can navigate code, and how to add
snippets and refactor code.

Navigating Code

Visual Studio has several features supporting code navigation, including Call

Hierarchy, Navigate To, Highlighting References, and Live Semantic Errors.
The last two are not really navigation features, but they do help you understand
code better.

Call Hierarchy

Call Hierarchy allows you to view callers and callees to a type member in your
code. You can open the Call Hierarchy window (see Figure 8) by selecting the
type member name you’re interested in and pressing Ctrl+K+T.


Call Hierarchy lets you view callers and callees to a type member.

The Call Hierarchy window also lets you navigate through code. To navigate
to a specific location, double-click on that location in the Call Hierarchy
window. You can open the branches of the tree by clicking an arrow to view
either Calls To or Calls From the location of the arrow.

Navigate To

Navigate To lets you quickly move to anywhere in your code by typing a
search term. Type Ctrl+, (comma) to display the Navigate To window
shown in the Figure below.


The Figure above shows how Navigate To lets you search and move to code quickly.

After the Navigate To window appears, you can type a Search term and all the
matching members will appear in the Results window. You can double-click
any item, or select an item and click the OK button, and Visual Studio will
take you to the right location.

Highlighting References

The Highlighting References feature allows you to select an identifier and
Visual Studio highlights all the references to that identifier. Figure below shows
how this works.


The Figure above. Highlight References shows the selected identifier and references.

In the Figure above, we selected the method identifier, Level2. Visual Studio
highlighted the reference to that identifier inside the Main method.

Live Semantic Errors

Live semantic errors show you problems with your code as you type. You can
see compiler errors and warnings without building your code. Figure 11 shows
what a Live Semantic Error looks like.


The Figure above. Live Semantic Errors show you problems as you type.

The example in the Figure above is missing an end quote, which is a compiler error.
The Live Semantic Error appears as a squiggly line under the location of the
error. For warnings, you receive a green squiggly line.

JoeMayoThis post is an excerpt from the online courseware for our C# 2012: Visual Studio 2012 IDE
course written by expert Joe Mayo.

Joe Mayo is an author, independent consultant, and instructor specializing in Microsoft .NET and Windows 8 technology. He has several years of software development experience and has worked with .NET since July 2000.

Does Google Prefer C/C++ or Java Programmers?



Any job hunter will tell you that while it’s important to have experience, a great resume, and a strong work ethic, it’s also equally important to do your homework regarding the company you’re interviewing for.

This can mean reading up on their financial situation in the Wall Street Journal, downloading annual reports, and understanding the firm’s strategies for future growth. And in the programming world this means understanding what languages the company is known for.

For example, there is an ongoing argument within the programming culture of Google: what language does the company prefer, C++ or Java? This article in Forbes addresses the question and the answer is: neither. What recruiters care most about is experience, a willingness to learn, and ability to think creatively.

So if you’re an expert in Java, odds are Google will want to talk with you. And our Java tutorial video can help you get there.

Thousands of developers worldwide use LearnNowOnline to gain the technical skills they need to succeed on the job and advance their career.

How Learning HTML5 Can Help You


With the quick rise of HTML5 in the development of modern websites and applications, it’s now more important than ever to learn the ins and outs of what’s becoming the standard markup language of the World Wide Web.

With our comprehensive selection of HTML tutorial videos online, it’s easy to become an expert in the essential coding language of the modern internet. Here are some more ways in which an HTML5 tutorial can help you:

  1. Become The Most Productive Developer You Can Be – If you’re a developer, a big part of your job is staying up-to-date on all the latest trends in technology and design. A comprehensive online video tutorial will help ensure you’re at the head of your professional field.
  2. Be Prepared To Meet The Demands Of Your Clients – To always be the most productive professional in your field you need to be able to deliver on all of the varied needs of your clients. Be keeping your skills sharp and up-to-date with video tutorials for C# and HTML5, you’ll be best prepared to deliver the highest quality service to your clients.
  3. Be Ahead Of The Curve – HTML5 is becoming the defining language of the modern internet. It’s used to build websites for the traditional and modern web, as well as the latest applications. Keeping yourself current on the latest applications of HTML5 will help your professional development.

Thumbnail for 637


Thousands of developers worldwide use LearnNowOnline to gain the technical skills they need to succeed on the job and advance their career.

Need Reasons Why C# is the Best Language for Mobile Apps Development?

c video course

When it comes to honing your programming and development skills, it is worthwhile to consider the old adage “follow the money.” After all, no one wants to become an expert in a programming language that will be extinct in five years. At the same time, programmers should pay attention to heavily-hyped languages, as they could be their meal ticket towards a prosperous and exciting career.

Of course, we don’t use the word “hyped” lightly. Many languages have been billed as the “next big thing” only to quickly fizzle. That’s why we really like this article, which provides eight concrete and convincing reasons why C# is the best language for mobile development. No hype, just facts.

Ultimately, the language has many benefits that make it conducive towards long-term development for business purposes. For example, it’s very reliable and allows programmers to detect and isolate bugs quickly. It boasts advanced runtime and powerful features like object-oriented programming and encapsulation.

And perhaps most importantly, it’s easy to adopt, especially for developers well-versed in object-oriented programming. So what are you waiting for? Sign up for our C# tutorial video today.

Thousands of developers worldwide use LearnNowOnline to gain the technical skills they need to succeed on the job and advance their career.

The Decline of the IT Generalist

vsBack in the good old days – say, 20 years ago – many small companies had what was considered an “IT generalist.” They pretty much did everything. They set up and managed the e-mail, fixed computers, kept an eye on the network, and managed small projects.

They were, of course, “the IT guy.” And even in companies with larger IT staffs, many of the IT workers had a hand in all different types of technology. They even dabbled in programming; it wasn’t abnormal for IT workers to be mildly proficient in Windows, Cisco, Perl, etc.

Well, now we’re approaching the age of “specialists.” Many companies have a separate “expert” in network management, help desk, project management, etc. And this trend is particularly acute in the programming world. The list of languages, of course, is a long one: Java, VB, C#, Ruby, Python, etc.

More and more companies are looking for language-specific specialists, and that’s good news for job seekers. Check out our Java, C#, or Visual C# tutorials and become a “specialist.”

Thumbnail for 628

Thousands of developers worldwide use LearnNowOnline to gain the technical skills they need to succeed on the job and advance their career.

Why You Should Learn To Use C#

c video course

C++ is one of the most popular programming languages and is used on a wide-ranging variety of operating system platforms. Therefore, you may wonder why you’d want to learn all you can about C# if you’re already familiar with C++. Here are just a few reasons why a C# video course could be beneficial to you as a programmer:

  1. C# borrows some of the best components of C, C++, and Java to create a simple, modern, general-purpose, object-oriented programming language. This makes C# safer and easier for the average developer.
  2. The standardization of C# allows it to be run on many different platforms and architectures. This makes learning C# a valuable goal for any developer.
  3. If you know C++, you should have no problem learning C#.
  4. Learning C# will broaden your client base. Many large companies that hire contractors to do their programming and development want to use languages like C# because of their stability and standardization. Having C# as another tool in your professional toolbox will make you a more productive developer.

These are just a few of the ways an in-depth C# video course can help your professional development as a programmer and developer. These and other online tutorials can help ensure you’re the most skilled and productive professional you can be.



Thousands of developers worldwide use LearnNowOnline to gain the technical skills they need to succeed on the job and advance their career.

More Evidence that C# is Poised to Become the Mobile Development Language of Choice

c video course

If you need further proof that C# is poised to become the mobile application programming language of the future, ZDNet is reporting that Xamarin, the Boston-based software company, will now start allowing iOS coders to use Microsoft’s Visual Studio.

This is important news because according to Xamarin, it is the first time any software company has enabled developers to build iOS applications using Visual Studio. That’s because the company – along with other development experts – believe that C# is the optimal language for mobile development.

Developers looking for a job or to switch careers should take note. After all, the future of the Internet is increasingly mobile, and C# is poised to take center stage. Just take a cursory look at any job board and you’ll see disproportionate amount of C# openings. Fortunately, our C# tutorial video library enables you to learn the language in the comfort of your home and at your own pace.

The mobile future is coming, whether you like it or not. Make sure you’re ready.



Thousands of developers worldwide use LearnNowOnline to gain the technical skills they need to succeed on the job and advance their career.

What are the Most In-Demand Programming Languages?

url3If you’re a programmer, sometimes it’s a good idea to occasionally read up on job reports that illustrate the most popular languages on the job market. Doing so accomplishes two things. One, it allows you to keep place with your fellow programmer peers; and two, it may make you consider a change in your area of as proficiency. C#, for example, is in demand, and as a result, you may consider a C# video tutorial to help get you up to speed.

That said, don’t take these reports as the entire gospel truth. For example, look at where the data is collected. Some studies, for example, look at programming job openings on Twitter. This is all well and good, but as this article notes, Twitter is disproportionately used by start-ups. In other words, blue chip companies post their programming jobs elsewhere, which can skew the results.

This reality underscores the importance of knowing where you want to be. If you’re aiming for a start-up, then you probably won’t be surprised if like-minded surveys tout JavaScript. But if you’re angling for a blue chip company, languages like .NET are likely in greater demand.

Thumbnail for 637

Thousands of developers worldwide use LearnNowOnline to gain the technical skills they need to succeed on the job and advance their career.

Facebook is Sending Its Employees to Boot Camp….Coding Boot Camp!

Screen Shot 2013-03-07 at 1.03.29 PMFor those of you keeping track of the big trends in the IT and online marketing world, you’ll know that mobile computing is poised to be “the” big issue for 2013 and beyond. After all, more and more users are surfing the Web from mobile devices, and it’s sending all sorts of shockwaves throughout Silicon Valley.

For example, companies like Dell, which specialize in manufacturing PCs (remember them?) are in big trouble. The same with Intel, whose business model is predicated on selling chips for mainframe and workstations. And then there’s Google, who has restructured their AdWords program so that more of their customers place ads on mobile devices, where they pay-per-click rates for Google are higher.

And now Facebook is joining the party. According to this article, the company is sending employees – even non-IT employees – to “coding boot camp.” And it’s not just plain old coding – it’s mobile development that they’re focusing on. After all, the company’s mantra nowadays is “mobile first.”

You can see a trend developing here.

The bottom line: if you’re an IT professional looking to make yourself marketable, mobile development is where it’s at. And with C# being hailed as mobile’s best hope, our C# tutorial video is a great place to start!