Skip to main content

Posts

Showing posts from August, 2012

Learning a New Language

Today I'm going to share something about myself that most developers probably don't want to admit about themselves, but I suspect I'm not alone.  If I'm not alone, this might be able to help someone, so here it is.
I find that the hardest part of learning a new language is starting.  I find that my competence in most languages follows a curve along time that looks like this. This demonstrates that the really challenging parts of the language are early on.  When first starting out with a language, it usually takes me a crapload of time just to get to the point of a working "Hello World".  Now there are exceptions to that rule (Ruby comes to mind), but I find that this early time is important to my understanding of the language.  I am learning compiler/parser tricks and understanding little nuances like the need for semicolons, or that every method must be in a class (C# but not C++) even if namespaces aren't necessary to get the application to compile.
I&…

CTW - Black Hole Ripples

First, some background.  Wednesday is "Conspiracy Theory Wednesday" around my house.  We pick a conspiracy theory and research it.  If there's documentaries, we watch it.  If there's articles online, we dig them up.  The idea of CTW is simple.  Treat the conspiracy theory as though it were fact for one day.  Try to find every way to make it fit reality.  By doing this we can get a better understanding of the angles people will try to defend it from, and then it also makes it easier to debunk the conspiracies on any other day.
So I'm going to try to start putting up my Wednesday posts as CTW posts.  It's representative of something I do 1 day every week, that's 52 days a year.  So it's a big part of who I am.  It's not exactly programming related, but it's a little bit of fun and a decent break.
Today's conspiracy is Black Hole Ripples.
Calling it a "conspiracy" isn't exactly accurate given that the link I just posted is from …

Know What You're Working With

When teaching programming, every teacher has his or her own custom style.  The difficulty is that, when learning about programming, you need to understand the teacher's style, and that's the bit their less likely to explain, sometimes because they can't and other times just to avoid arguments about how they should change.
So I'm going to go over a stylistic trick that a lot of teachers use.  When learning to program, some teachers tend to live in the IDE.  They don't discuss the background stuff that's going on, which can leave you in the dark when you try to understand how everything attaches to the computer as it exists.  So the teacher will be discussing programs inside the IDE but may never even show you the output directory.
I'm using Visual Studio in this walkthrough, but the purpose here is to show you that you should look at the output directories of your own programs, even your toy apps.  Here's the output directory of a tiny hello world app. N…

Source Control Branching and Merging

It is something that is so common that it's unsaid most of the time, but the entire professional software world relies on Source Control.  When I was a young newbie developer, I didn't even know what Source Control was.  It's easy for us to forget those old days and look at new developers when they ask us questions and not mention anything about how they should be using some form of Source Control aka version control.

There are a lot of different version control systems out there these days.  There's even heated debates about which is best.  The point of this article is not to tout one or the other, but I will anyway.  Git is awesome, but their Visual Studio plugin sucks!  Team Foundation Server integrates perfectly with VS, but tries to do to much, having an entire Agile system built in and fails as a version control system.  Everything else is not as good at Git and also has crappy VS integration.

Seriously though, this article is about Branching and Merging.  Do you…

Document it!

Anyone who's been in software development for any amount of time will know that a common issue in any team is a lack of documentation.  If you've been in the industry for more than a year, it starts to feel like "beating a dead horse" when talking about how we need more documentation.
You can try to appeal to people's emotions expressing frustration and a need for sympathy and empathy in the process, but that's just not how Software Developers work.  If you want to appeal to people like me, you need facts, and lots of them.
That's not enough though.  If you can convince your programmers to write the documentation, then you still have to convince management that it's worth the money.  The truth is, no one is on your side here.  What's worse, the guy who's touting documentation now, probably was against it last week.  It's a really hard sell.
This is my generous gift to you.  I'm going to give you the selling points that I've used ri…

Javascript - First Class

It may or may not surprise you to know that I have a heavy Javascript background. While my first language was VB6, I don't think I've ever delved into any language quite as deeply as I have with Javascript. I used to use a gnome back-end to build very complex projects in Javascript. Therefore, you might know how cool of a concept it is to me to use Javascript as a First Class Language.

Much more exciting however, is that Microsoft is doing just that, and in Visual Studio no less!  This means that we not only get intellisense and other features.  But now we can code entire applications in Javascript as if it were .NET at its core.

It may not seem like much, but it means that you could theoretically code pure Javascript from Logger to Server to Front End and it could seriously simplify programming in the future.  This is something I'd like to see available in more languages, but if Javascript is the start, then so be it.  Hoorah for JS!

yield return in C# 4

OK, so I've been watching pluralsight videos lately and you would not believe how much they seem to love this "yield return" in C# 4.0.  Let's take a look at it in a small implementation.
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { var numbers = new List<int>() { 1, 5, 10, 15, 20, 25 }; foreach (var number in GetLargeNumbers(numbers)) { Console.WriteLine(number); } Console.Read(); } static IEnumerable<int> GetLargeNumbers(IEnumerable<int> numbers) { foreach (var number in numbers) { if (number > 10) { yield …

Useful Links

As an apology for not keeping up with posting this week, I provide you with cool & useful links.

Console Emulator, good one!
http://code.google.com/p/conemu-maximus5/

Crapload of Free E-Books from Microsoft
http://blogs.msdn.com/b/mssmallbiz/archive/2012/07/27/large-collection-of-free-microsoft-ebooks-for-you-including-sharepoint-visual-studio-windows-phone-windows-8-office-365-office-2010-sql-server-2012-azure-and-more.aspx

Temporary Phone Number App
http://burnerapp.com/

New Network Security tool I found
http://www.snort.org/

View the source code you're using in these obscure libraries from Microsoft et al
http://www.koders.com/

Tabbed Remote Desktop
http://terminals.codeplex.com/

Programming Jokes, in code
http://moviesascode.net/

Node.js is cool, but stack Meteor on top and you can do other cool stuff
http://www.meteor.com/examples/leaderboard

How I set up blogger syntax highlighting
http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html

Trello, agile/scrum…

Uploading a File in ASP.NET MVC3

I've done my research on this.  I've seen the literally hundreds of tutorials on how to upload a file in Microsoft's MVC platform.  So, let's do the bit that all of them show first.

@using (Html.BeginForm("Upload", "Home", FormMethod.Post, new { enctype = "multipart/form-data" })) {     @Html.Hidden("id", Model.Id)     <input type="file" name="file" />     <input type="submit" value="Upload" /> } 
So the first thing to note here is that this is Razor.  There isn't an HtmlHelper for a file input, so we have to add one manually.  Same for the submit button.  Then we notice that I'm using Html.BeginForm, not Ajax.BeginForm.  Everyone loves AJAX right?  Well, AJAX doesn't allow file uploads by default, so if you want to do uploads via AJAX you'll need a plugin for jquery.  I'm submitting via POST for obvious reasons, you do not want your file's byte array in y…

What Kind of Web Host Do I Need?

Let's call this the newbie guide to starting a website.  I've always hosted my own sites, so the reason I'm doing this research is because I'm considering a move to hosting off-site.  There are probably hundreds of tutorials out there, so for those of you browsing, this is purely about hosting, not about actually making a website.
This post was also inspired by a question.  First thing's first, you should decide on a hosting provider based on your needs.  So this tutorial will be broken up based on the levels of need.
Minimal Need - $5/month
So the first level of need is minimal.  This type of site is something your mom is using to present photos of her ebay sales.  It's probably something Wordpress can handle.  If you think it's going to need to handle traffic, many providers also allow for PHPBB on these.  All of this is called Content Management System, and you can use any host that will allow you to FTP and upload documents for your website for this.  Mo…