Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Sunday, November 10, 2013

Learn and Practice LINQ & C# with LINQPad


After a much needed day off yesterday, I'm back at it today studying C# Fundamentals and LINQ (language integrated query). Thumbing through the pages of O'Reilly's C# 4.0 Pocket Reference by Joseph Albahari, I discovered that the author is actually the creator of a handy LINQ/C# scratchpad called LINQPad

During the second week of camp (seems like years ago, now!), one of our camp-mates, Danyal Mahmud told us about using LINQPad to practice writing LINQ queries. I didn't start using it right away because we were so busy learning new material. But now I wish I had, because not only is LINQPad great for LINQ, it's also great for learning and practicing C#, from a beginner level to advanced.

Here's why... 

Included in the Samples tab of the program are code snippets from C# 5.0 in a Nutshell, another highly rated book by Joseph Albahara. When you install LINQPad, you get snippets from Chapters 8, 9, 10 & 26. Then you can click "Download/import more samples...", and get even more samples from Nutshell, along with snippets from other books like C# in Depth & Asynchronous Functions in C# (I won't even pretend I know what those are... Yet!)

You can view, clone, edit & run these snippets right in the application without having to create new console apps in Visual Studio and you can practice LINQ directly on your own databases with the Add Connection feature. Starting out in C# and LINQ can be intimidating, and overwhelming at times. With tools and resources like these, however, the learning curve starts looking more like a hill than a mountain.

Wednesday, November 6, 2013

Visual Studio Keyboard Shortcuts


I'm a big fan of keyboard shortcuts. When I first started working with AutoCAD, I learned to rely less on toolbars and buttons and more on entering short aliases in the command line to get things done. The result was that I spent less time going back and forth from the keyboard to the mouse. Later, when I started using Photoshop, I was amazed at how much time you could save using keyboard shortcuts like CTRL+T (free-transform layer) and CTRL+J (new layer via copy).

The most important keyboard shortcut I ever learned, however, was CTRL+S. It only took one time losing hours of work in a CAD drawing to start using it religiously.

Now I look for shortcuts for any program I spend a lot of time working in. And since I've been spending more time with Visual Studio than with my friends and family the last 5-1/2 weeks, I've gotten pretty friendly with these little time-savers. Here are some of my favorite...

ShortcutOperationNotes
CTRL+K, CComment a line of codeYou can place cursor in line without selecting anything
CTRL+K, UUncomment a line of codeSame as above
CTRL+SHIFT+ENTERBlank line after cursor lineCursor can be anywhere in the line, and you don't have to use END, ENTER
ALT+UP or DOWNMove line up or downCursor can be anywhere in the line, without selecting
CTRL+DELETEDelete word to right
CTRL+BACKSPACEDelete word to left
CTRL+. (period)Open Smart TagWhen you get the red squiggle, sometimes it's hard to get to this with the mouse
CTRL+ALT+LOpen Solution Explorer
CTRL+; (semicolon)Focus on Search Solution EplorerSame as above, except puts your cursor in the search box
CRTL+, (comma)Focus on Navigate ToThis searches for words in entire solution and takes you to it when you hit ENTER
CTRL+FOpen Quick Find
CTRL+HOpen Quick Replace
CTRL+QOpen Quick LaunchAllows you to search everything in VS, including tools & options
CTRL+ALT+SOpen Server Explorer
CTRL+W, EOpen Error List
F1Navigate to Help FilePlace cursor in any keyword in text editor, opens MSDN help file for item
F12Navigate to DefinitionPlace cursor in code to find definition
CTRL+SHIFT+BBuild Solution
F5Start Debugging
CTRL+F5Start w/o Debugging
CTRL+F6Next Tab
CTRL+SHIFT+F6Previous Tab

Oh, I almost forgot CTRL+K, D... Automatically formats tabs and white-space to make your code look snazzy!

Friday, October 4, 2013

Week 1 Recap

Here's a view of the lake behind Pearland Town Center. I've been trying to offset all the chair-time with some running in the afternoons, and this is a great place to get out into the sunshine after a long day of coding.

Today, we reviewed a lot of what we did this week, discussed our progress with the group, and came up with a schedule for the weekend. One of the prior groups' students, Andy, is going to come in tomorrow for a Q&A, and help us tackle some of the more difficult subjects. On our own, most of us are watching C# & ASP.NET videos to drill on the basics. From talking with students in the other groups, this seems to be the best way to learn the material without getting behind.

Also, we had a good discussion about the job market for web software developers, potential interview questions we should be prepared for, and how to develop a positive, problem-solving mindset that is essential to being a successful developer.

Tuesday, October 1, 2013

Day Two - More C# & Model Diagramming

So today we jumped into the basics of Object Oriented Programming, classes, properties and more. Our team worked on a model diagram similar to this one (my homework assignment) for Fund.io and started applying some of the programming concepts to real world applications. I was familiar with implementing a shopping cart plugin into a website, but learning to build them is quite different!

Monday, September 30, 2013

Day One - Meet "The Stack"

ASP.NET MCV Stack
ASP.NET MVC Stack
Day One of Coder Camps was a whirlwind introduction into the language, tools and projects we'll be working on. Our group will be developing the admin dashboard & tools for an up-and-coming crowdfunding site called Fund.io.

I'd write more, but I'm busy finishing up my assignment: Write three functions in C#, one that will calculate the area of a circle (given the radius), one that calculates the circumference of a circle (given the radius), and one that will return the reverse of a string (ex. "What?" into "?tahW").

Edited 11:04pm - Finally finished the assignment: http://ideone.com/Fe7k8p

Wednesday, September 25, 2013

Coder Camps Prerequisite Work

In preparation for the Coder Camps programming school, I have been asked to complete some prerequisite work in the form of reading, going through online tutorials, as well as setting up this blog and a profile on LinkedIn. Although I'm still working on marking these off the checklist, I thought I'd post something about what it takes to get ready for a camp like this.

One of the books recommended by the school is Head First C# which focuses on the C# programming language and the .NET framework (not related to .net top level domain, by the way). I can tell from going through some of this book, there's a steep learning curve. I'm sure it's true with any programming language, even spoken languages, but I'm banking on being immersed in it for 9 weeks to get into the groove of things.

Another book I picked up, which wasn't recommended but looked interesting, was Code: The Hidden Language of Computer Hardware and Software. Less of a technical book, the author explores the connections between humans and machines, and the history of communications technology such as Morse code & Braille. So far, a good read that explores the world of computers in an entertaining and easy to grasp format.

Another prerequisite is to become familiar with some of the technologies that will be used at the camp. Primarily, we'll be using Visual Studio Express for Web, a web development program designed to help you create modern web applications. After installing the free software, and poking around a little bit, I could tell this is a powerful program. I look forward to seeing what this baby can do!

Since all websites are based on HTML, and more increasingly CSS, JavaScript & jQuery, a general understanding of these is needed to have a good head start going into the training. Coder Camps recommends Codecademy.com online courses to get a handle on these coding skills. I've completed the Web Fundamentals & jQuery courses, and am in the process of completing the JavaScript. The site walks you through lessons and exercises and allows you to enter and test your code in a handy virtual console. Some other online tutorial sites such as Codeschool.com and Teamtreehouse.com include videos and premium features.

While most of these tech bootcamps say they can take a complete beginner and turn them into an entry level programmer, I'm sure the prerequisite work allows students to focus on the meat and potatoes of programming when they get to camp. I feel like I've got a pretty basic understanding of this stuff, but I'm still a little nervous about jumping into 9 weeks of it. Oh well, a little pressure never hurt anyone...