C Sharp Development 101 – A Tutorial Series

posted Sep 3rd 2010 1:00pm by
filed under: Software Development

In this tutorial series we are going to look at C# Development using the Visual Studio 2010 Express editions.  This will take you from the basics of installing Visual Studio 2010 Express, to the Object Oriented Programming style associated with C# and other languages, dabble in some database access (Access & SQL Server Express) and finally, design a project that will pull all of our knowledge together into a final solution.

We are going to begin by downloading the Visual Studio 2010 express from Microsoft’s website so that we can get started on some C# development.  After the file has been downloaded you will need to have a connection to the Internet so that the program can download the necessary files to complete the install.  For the sake of customization we won’t walk through the rest of the install and will pick up with some add-ons that will make your coding experience easier.

With the Express edition now installed, it is good to know that the express editions of Visual Studio 2010 do not support extensibility.  This means that the ability to install plug-ins and add-ons is not included.  If you happen to acquire or have a full version of Visual Studio 2010 then the option is there for you to add these plug-ins that have helped me out in a tough spot before.

  • Visual Assist X
    • This is probably one of the best applications out there for intellisense and document syntax highlighting.  Now many of you might be saying that Visual Studio already does this.  Yes they do, but not as well as Visual Assist X.  This add-on will look into your added in files such as the Boost library, and retrieve all of the Boost functions and try and piece together a description of what that particular function would do.  Syntax highlighting is the best around with the quick option to do minimal to maximum highlighting.  A must have for the avid programmer but will run you $249 for a one year subscription and $49 maintenance fee every year afterwards.  This price tag might discourage most but take the 30 day trial and take it for a test run.

  • Ghost Doc
    • A product of SubMain, this add-on will allow you to document your code quickly and efficiently using XML markup.  To generate these comments it uses the elements type, parameters of the function as well as its name to generate the comment.  This is especially useful for people who do not enjoy documenting functions in their code.   Most promising add-on if you are looking for code documentation.

  • AnkhSVN
    • A free SVN add-in for Visual Studio that allows you to connect to a repository, browse the branches all within the comfort of the Visual Studio environment.  Very easy to use for people who want to start a community project on Google Code or host their own.  A must have for people who like to collaborate and don’t want to hover over one persons computer to review code.

AnkhSVN logo

All of these have been personally used and are highly recommended for use when developing for the .NET framework.  The next part in this series will go back to an old classic for programmers; Hello World.  We will go through making a project file and printing Hello World to the console as well as on a form.  As always, any problems with the series or if you just have questions post to the comments so that we may learn from each others mistakes and grow as a community.  If you can’t wait until the next post, here is how to start making a Hello World console app.  Until next time, Happy Hacking!


107 Responses to C Sharp Development 101 – A Tutorial Series

  • michael says:

    Let me be the first to chime in.. I love C#. Let the flame wars begin.

    But seriously, I am freaking good at it. Say what you want about M$, C# is a nifty language.

  • Andy says:

    I second Michael’s sentiments. C# makes Windows development palatable. The IDE, compiler, and debugger in all editions of Visual Studio are really slick. I only use C# for native apps though, my heart still belongs to PHP when doing web development.

    Anybody that ever has to build anything for Windows should definitely learn C#… it’s RAD without compromising.

  • descention says:

    I have a few friends who will be interested in this.

    Thanks Greg!

  • Were you sponsored? says:

    Please disclose if this is sponsored.

  • EdrZero says:

    I love C# so much that I use it all the time on Ubuntu thanks to Monodevelop, I’ve even made a program to send data to a Pic18f2550 using the usb port, all in C#.
    you should keep in mind making a new part in this awesome tutorial, to show how to use monodevelop on ubuntu or even in a mac. that would be great!

    Greetings from Colombia.

  • Great! This language is my current favorite and it is good to see a tutorial on one of my favorite sites.

    I’m currently making a amp monitoring circuit with the http://netduino.com and programming this thing via C# has been a breeze.

  • giammin says:

    you forgot to mention RedGate Reflector

    i think Resharper is miles ahead of visual assist x

  • catzburg says:

    It would also be nice to include how to interface with external hardware like custom USB devides and COM ports. Otherwise, I like.

  • Mihail121 says:

    I also love the .NET platform. I love C#, I love LINQ, I love the .NET technologies, I love F#, I love everything somehow connected to .NET, .NET languages, etc. Give me more .NET and I’ll be happy. Go to hell with Java 7.

  • David says:

    @EdrZero Completely agree. Mono and MonoDevelop rule!

  • Taylor Alexander says:

    I have been using C# for a couple years, and its great! For years I only knew embedded programming, and it was really tough to develop things when I couldn’t even make a simple PC app to communicate with the microcontroller! Now I can whip up simple utilities, or even complex ones, pretty quickly.

    And for what its worth, one of my buddies who is a $130k/yr veteran programmer recently started doing some stuff with C#, and he really likes it. He does a lot of C and Python, but he said C# has really nice structure and he likes the IDE. A lot of people gripe about C# for some reason, but its actually really nice. Yeah, you get more control with C++, but sometimes you don’t need that much control.
    -Taylor

  • Roon says:

    I like the idea of Visual Assist X, but $250? Come on that’s crazy for a product that provides a fancy intellisense…

  • Ralph says:

    So what is being hacked? Anything?

  • Mihail121 says:

    Roon, that’s nothing for a company and imagine it could speed up development by even 0.0001%. Then your new Windows 8 will cost $10 less. Nifty!

  • sneakypoo says:

    Now there’s a coincidence, I downloaded Visual C# Express not two hours ago. I need a program that takes a BMP stored in RGB565 format and spits out C-source describing an array containing the hex values of the file so that I can use it in a PIC+LCD project (hah, good luck deciphering that one).

    No luck thus far though.

  • javabean says:

    you know… this is i believe my first post here. in the 6 or so months i have been watching this site i have been “happy”. Seeing you …people… go through and suddenly “offer” .net/mono developmental tutorials on your front page make me wonder if i should even bother coming back.
    .Net/Mono is basically a dead/dieing language with microsoft/novell both disbanding massive amounts of projects .net/mono look to be disbanded soon.
    While i have no proof of that actually happening Techrights will show you that they have been disbanding at what was “last month” an accelerating rate. you should be encouraging the use of development languages/enviroments from places not in the middle of a “fire-sell”

  • Amtal says:

    What does this have to do with hacks? If you’d focused on some specific thing that makes C# cool (like elegant uses of LINQ, or clean uses of generics) rather than advertising commercial software (VS2010, Visual Assist X) it’d be different. As much as I love C#, the post is not informative or interesting or inspiring.

  • Jim says:

    I think that while this post may not be inspiring, it is quite possible (hoping) a lead-in to bigger and better things. I myself requested more software h@ck$ as well as some more ground-up style information when I took the HAD survey..

  • Chris says:

    @Were you sponsored: You’re a retard.

  • Mike Cantelon says:

    Diluting your content with stuff that has nothing to do with hacks may not be the best long-term strategy.

  • Nomad says:

    @Amtal:
    “the post is not informative or interesting or inspiring.”
    Yeah, thats YOUR opinion…there are about 11 other people having another opinion. So please…stop trolling. Thank you.

  • Osgeld says:

    “the post is not informative or interesting or inspiring.”

    I feel the same way to a degree, but my opinion is not every ones opinion (though it should be)

  • James says:

    So far they’ve provided an intro and some info on additional packages in preparation for the tutorial. Lets give Greg a break and a chance to actually write a tutorial shall we? “this post is not informative or interesting” – it’s not meant to be, it’s a bit of a starter/intro to what’s coming. Good grief.

  • Osgeld says:

    well I don’t feel compelled to download and setup all this stuff from this article

    I dunno, get all this stuff and sit on it for the next tutorial on a undisclosed date sometime?

    and being Ctarded what is this stuff? yea he explains it, but what is boost library, why do I want to highlight it? Do I need ghost doc for simple hello world learning tutorials? why would I want to have a SVN repository when I dont even know hello world

    to me its a link list and not “OMG WOW THAT! is something I want to get into”

    this could have been truncated, and included the next planned article in one roll, then I might have been more enthusiastic about it as something to get my feet wet with over the long weekend

    oh well (shrug)

  • mess_maker says:

    I have written a few programs in C# and really enjoyed it. I spend every day developing software in PHP and AS3/Flex so it is relevant to my interests. Good article, thanks.

  • Derrick Hinkle says:

    Not that I have a problem with learning C# or anything – quite the opposite, it’s on my todo list, but this is most certainly NOT one of the reasons I read hackaday. Don’t get me wrong – want to teach me about raw memory writing in other programs spaces, or some clever hardware interface using it? Sure, awesome. But, there’s a million billion basic programming tutorials out there, Hackaday doesn’t need to start with them as well.

  • FrankenPC says:

    C# and Visual Studio 2010 are rapidly becoming the best development environment period. The only thing that’s lacking is Javascript intellisense support. JQuery is an awesome technology and ironically enough really does an excellent job augmenting ASP.NET development by making client side UI elements and AJAX data access very simple to program and debug.

    Silverlight (XAML, a WPF derivative) is going to be an awesome GUI based web modeling tool but it’s severely limited by browser and consequently the host OS. So, ultimately I’m holding out hope for HTML 5 to replace both Javascripting and Flash/Silverlight style code. It will be incredibly easy to build intellisense technology around HTML 5.

  • FrankenPC says:

    RE: AnkhSVN, I prefer the file system based client to the IDE environment. It’s just so much easier to simply fire up Visual Studio and do your work without all the integrated synchronization hoopla.

  • cackus says:

    Sorry, the whole Idea of C (the beginning my uncle helped develop it) was cross platform compatibility, adding a bunch of M$ PROPRIETARY stuff makes it a USELESS LANGUAGE. I don’t care how “Nifty” it is.

    The problem is like dealing with DirectX, if it locks you in to one vendor it’s a BAD THING.

    Whatever the merits are of C# they are outweighed by that simple fact. C# could be the end all super fantastic wonderful language from heaven, Tie it to M$ and it’s just another useless non-standard standard.

    I’m sure to get flamed by all the people who have serious investments of time, but I have been programming for 30 years, I have seen them come and go and Proprietary is ALWAYS BAD. Breaking standards, splitting groups dissension etc… The fact that it splits us here is more than enough to shy away.
    Java’s ability to run on multiple platforms has effectively
    unified all the UNIX flavors, and has allowed some software companies to
    deliver to both UNIX and Windows customers. This is the greatest challenge to the Microsoft dominance of PC-based software.

    Thus the REASON behind C#. If I can’t cross compile it’s not of any use to me. Yes there are some C# compilers under development for Nix environments, but they are fare from cross systems compile ready.

    Anyway I haven’t seen anything in C# that would make me sacrifice the ability to compile for multiple systems. What happens when you want to compile a version for some future PDA android type pad etc. or just for Linux Unix or even Mac? Your screwed. Might as well add some libraries in C++ to do the same functions and wait for the C# fad to pass.

    Sure you can run Mono(.NET for nix) but do you rally want to deal with M$ and it’s whims, which often are deliberate attacks on open systems, described nicely in the infamous M$ Halloween letters?

  • M4CGYV3R says:

    Visual Assist is great for languages that have poor or no support for auto-complete in VS but C# already has pretty amazing Intellisense support via the .NET framework and Visual Studio. I would assume they did not remove this feature from the Express version.

    C# is a great fun language, and it’s excellent for quick development and prototyping. It is virtually identical to Java with a few minor exceptions. I think there’s a few of those proto-systems out there that have a simple micro and display that can be programmed in C# too.

  • cackus says:

    Someone mentioned Silverlight, Um isn’t that dead yet? It’s only real use is to deliver DRM’ed content.

    HTML5 doesn’t actually Need it, video is better done with ogg/theora or better yet VP8 (better picture less memory, faster and OPEN)

    x264 may be open, but it’s still has strings attaching it to one vendor.

    Anyway silverlight, C# who wants a development environment limited by the economic motives of the companies tied to it.
    M$, apple, nokia etc etc gets a hair up it’s ### and sorry all your work and your site has to be re-done.
    Proponents of such systems make headaches for those who try to make content available on as many platforms as they can.

    So I develop in silverlight, oh sorry Iphone, android Linux etc etc.. WHY? Anyway after the DISASTER NBC had with the Olympics silverlight is effectively dead. Most systems STILL can’t view the Olympics!!

    NBC DROPPED IT.

  • PR says:

    Good stuff. I’ve been looking to get into C#, and this will probably help.

  • Eric says:

    “Now there’s a coincidence, I downloaded Visual C# Express not two hours ago. I need a program that takes a BMP stored in RGB565 format and spits out C-source describing an array containing the hex values of the file so that I can use it in a PIC+LCD project (hah, good luck deciphering that one).”

    That would be easy in MATLAB.

  • blinkyb says:

    SharpDevelop!!!!!!!! FREEEEEEEEEEE

  • Osgeld says:

    @Eric, just get any language that can read the file,and the rgb pixel color (most game dev systems) and dump into a file, crap 2 off the top of my head with tutorials are processing and love2d, probably pygame

    or in other words don’t multipost off topic

  • Osgeld says:

    nevermind smack me for the multipost comment, I feeble mind got Edr and Eric mixed up

    otherwise …

  • Tachikoma says:

    I have this love have thing with C# … but fortunately love portion is slightly more, depending on context and what I’m working on. Admittedly, I have only dabbled in C#, so my observations might be somewhat limited.

    I absolutely love the managed allocation concept in C#, it’s something C++ should adopt natively as a standard. Even C++ CLI is ok (which is what I use for some projects), but the syntax can be a bit hairy.

    The extensive use of namespaces (as opposed to header files declarations) in C# .NET libraries are well organised too. Again, I wish C++ compilers would use this concept.

    Getter/setter methods rock.

    That said, I’m not too enthused about having both class declarations and implementations in one big scope. Things get a bit messy when you have huge classes to deal with. (Maybe this is something I need to brush up on?)

    VisualStudio Express seems to be quite slow when dealing with C# source code, which annoys me.

    The #1 thing that really annoys me is the lack of native code generation in C#. Not a fan of MSIL at all, and quite frankly the JIT compiler doesn’t even start to compare with natively compiled C++ code in terms of CPU performance. While this may not be a big deal if you do mostly GUI programming, but for things like serious CPU based data processing, it doesn’t cut the mustard.

  • JA says:

    “I second Michael’s sentiments. C# makes Windows development palatable.”

    Exactly. _Windows_ development. And only in small scale. Don’t even start with Mono.

    It really is not palatable at all when you realize you have serious performance problems (no, wall really). And same thing when you realize that you’re paying lots of $$ for MS to get desent sw licences, and yet they are buggy crap. Yes, both the licences and the software.

  • DMacATTACK says:

    I will definitely be following this, I happen to love C# as well as most of everyone here. I would like to see some insight with respect to OpenGL (I know its not meant for C#) if possible. I have recently completed a 3D laser scanner (project website coming soon) using C#, and the OpenGL libraries & linking are lacking substantially (I’ve tried SharpGL, Tao Framework, OpenTK,… etc)

  • Mr. T says:

    It is difficult for beginners to start with VS. This article is just what was needed!!! Thanks!

  • Frank says:

    C# + LibUsbDotNet = awesome USB microcontroller projects

  • Mastermage says:

    Im downloading them now :)

  • Max says:

    The are a number of readers who don’t use windows, osx or even linux and will these readers may start reading other sites more and hackaday less as the number of ms, apple or ubuntu hacks increases.
    Hoping HAD keeps its balance.

  • edonovan says:

    C# really shines when it comes to creating a usable user interface in 15 minutes.

    I hope you go into hardware interfacing so this is more relevant to HaD patrons; not many of us want to create a software suite just to monitor I/O.

  • MrSarcasticSolderer says:

    Great article, I look forward to follow up material.

    As a software developer I have used C# as my primary language for the last 9 years. The whole .NET eco system has matured greatly. My only gripe was moving from .Net1.1 to 2 as there were some code breaking changes to the libraries.

    I’m currently working on a C# winforms GUI to drive a 4WD robot over wifi using a web cam and an xbox 360 controller. The MS tools are making this a fairly painless and even fun endeavour.

    Keep up the great work guys :)

  • Alan Parekh says:

    @MrSarcasticSolderer, that sounds like an interesting application sounds like a lunar rover type of app.

  • Chris Muncy says:

    The MS page you linked to:

    http://msdn.microsoft.com/en-us/library/k1sx6ed2.aspx

    is broken. None of the example code is displayed.

  • Philip says:

    You have to click on the C# button just above the code example.

  • inf3rnal says:

    If you like C# you should check out http://www.netgore.com/! It is a mmo engine built from the ground up using C# and SFML and Mysql!

  • r_d says:

    Was softwaretutorialaday.com not available?

  • khani3s says:

    Diluting your content with stuff that has nothing to do with hacks may not be the best long-term strategy. [2]
    Was softwaretutorialaday.com not available? [2]

  • HTH says:

    C is a variable… C++ is an increment… C# is a syntax error.

  • Just as a side note, you mentioned the express edition, but if you have a .edu e-mail address, you can go to https://www.dreamspark.com/ and download VS 2005, 2008 and 2010 Professional Edition for free from Microsoft… Also Expression Studio 4 Ultimate, Windows Server 2003, 2008, and 2008 R2 Standard editions, Windows Embedded CE 6.0, SQL Server 2008 Developer, etc… This probably isn’t news for many but it would be worth mentioning in the article as I imagine there are a lot of college students here.

  • therian says:

    for GUI use wxWidgets this will make your code platform independent and fast # is for lazy people who dont mind speed compromise and waist of money

  • localroger says:

    I will never use a dot net product. I think I can swing my company to switch to Linux and a whole different toolchain before that happens. (We’re a small shop, and I’m both the in-house and product development IT department.)

    dot-Net was a swipe at Java, in M$ typical embrace-extend-choke fashion, and in order to make their move M$ obsoleted billions of lines of working code by making the “next generation” of Visual Studio totally incompatible with VS6. It wasn’t a next generation at all; it was a totally new and different product with new and different capabilities. Were some of those capabilities good? Yeah, probably. But I’m more concerned with ten years of legacy apps that are no longer supported by any supported M$ development tool.

    Fuck Microsoft and their next new product too. My existing code is now better supported under Linux via WIne than by the company that sold me the original development tools. You hitch your wagon to Microsoft’s horse at your peril.

  • David says:

    So many haters! I was very happy to find this post and it’s inspired me to download VS Express and give it a go.

    Not every article on the site suits me either, but instead of complaining, I simply skip it and read the next one.

    Please don’t be put off posting any follow ups to this tutorial, or any similar posts for that matter.

    Dave

  • Osgeld says:

    yes please post something more than 3 paragraphs that do not explain anything and a link list next time

    I like this one especially

    “”This will take you from the basics of installing Visual Studio 2010 Express”"

    then

    “”For the sake of customization we won’t walk through the rest of the install”"

    hella useful! apparently we are too stupid that we need instructions to download a file and run it, but too smart for the rest of the install

    good article

  • Amtal says:

    Seriously, this better get followed up with some mad LINQ/generics/FFI wizardry tutorials. Otherwise, it looks like a sponsored ad-post for commercial software.

    Download Python + MatPlotLib + NumPy instead… Your code will run on more machines, not require a giant runtime, and have better long-term support.

  • amk says:

    The “not-a-hack” comments will never stop will they? I’m guessing that most hack-a-day readers, myself included, enjoy these “non-hack” posts. If we didn’t, the ad revenue from this site would have suffered, and the posts would have stopped a while ago.

    I’m a pretty hardcore c++/python kind of guy, but I’ve been meaning to try c# out for a long time now. Thanks for the tutorial, keep them coming.

  • amk says:

    Let me also add that the less-technical posts like this, and yes the arduino stuff too, help introduce people who might be proficient in one area to new areas. I’m a software guy, but years ago I started reading sites similar to hack-a-day, which inspired me to dive into the hardware side of things. As a result, today, I spend most of my time working with embedded systems. Which I enjoy a lot more.

    And, you could say, that although there might not be a hack every day, sites like hack-a-day birth a hacker-a-day. Which is just fine in my book.

  • Amtal says:

    @amk You’re right that intro-level posts are important, but this is:

    -a link to download VS2010
    -a link to what I assume is a hello world tutorial
    -a high-visibility advertisement for a $250 commercial product
    -links to SVN/autodoc plugins

    Only two of those are useful to beginners, and all the links were broken when I tried them. This looks like an SEO post plain and simple.

    I hope I’m wrong and that there’ll be further tutorials as promised, though. I’ve been meaning to give C# a go; it looks like a nice middle ground between C++ and functional languages/Python. Heck, it’s got a proper “for” statement!

    The main thing delaying me is I’m not sure what the killer application of C# is. I know it’s good with GUIs, but what else? I suspect LINQ might do some sorcery with databases, but haven’t run into a good example yet.

    What do you guys think?

  • Amtal says:

    One slightly obscure but very impressive example of LINQ: using it to define monadic parser combinators!
    http://blogs.msdn.com/b/lukeh/archive/2007/08/19/monadic-parser-combinators-using-c-3-0.aspx

  • Scott Cowan says:

    for vim bindings use ViEmu
    I’m using VisualSVN over AnhkSVN
    GhostDoc is overkill since too much commenting hides your code
    Resharper is a must for IDE enhancements

    skip express and go to monodevelop/sharpdevelop it lets you use solutions

  • Anonymous says:

    C# is bad..
    .Net is bad
    And the worst thing is that no-one can be sure that all you C# fans are not M$-bots.. :P

  • lexi says:

    When I want to waste time fixing dangling references, memory leaks, and struggling with poorly supported APIs, I use C++.

    When I actually want to get some work done, I use C#

  • Necromant says:

    Is Microsoft HaD’s new sponsor? Really, C# sucks hard.

  • Necromant says:

    @lexi
    > When I want to waste time fixing dangling references, memory leaks, and struggling with poorly supported APIs, I use C++.

    Dude, if C++ is too hard for you, be honest and put it straight: C++ is too hard for me, so I use C#.

    Besides, C# is pretty unportable. Believe me, If you ever would like your app to be portable across linux/windows/mac/symbian – C# is NOT your choice. QT&C++ is WAY better.

  • @Everyone:

    Sorry about all of the broken links, they are fixed now as I was having some technical difficulties.

  • r_d says:

    Not only unportable, it’s totally useless for embedded development, which _used_ to be the main focus of this site.
    Desktop applications development isn’t interesting. I do plenty of it because I occasionally need a program that doesn’t exist, but I don’t ever want to read about it on a site for hacking.

  • dev says:

    I can see where people are coming from with this not being what they want from hack-a-day, but I personally like to see a wide variety of stuff, even things that may not qualify as “hacks”. I guess I like things more for technology hobbyists in general than just for those who work with hardware or embedded software.

  • therian says:

    It surprise me how many people try to cut corners instead applying reliable and proper way, in a long run they only lose time since all they knowledge is worthless when company they dependent on decide to make changes.
    I newer even bother to look at something what tied to single company or platform

  • Neckbeard says:

    @Ralph
    Tutorials are an aid to hacking, therefore not open to flaming.

    @Hackaday
    I’ve indulged in a little C# in the past and especially enjoyed how easy it was to knock together a small app after an hour or so of reading. Keep this series going, just the basics let those who want to learn finish off on their own steam.

  • lexi says:

    @Necromant

    Portability is not a concern for me, None of my clients ask for portable code. They ask for something that will work in Windows and they want it developed as fast as possible.

    C++ is not to hard for me. I was a c++/QT coder for 3 years before becoming a C# dev. I also had the same mindset at you before I moved over to C# “C# and MS sucks, C++ is the greatest thing since sliced bread” Until all of my clients started requesting C# dev because it saves so much development time. And when portability isn’t an issue, why should I waste time using QT? And when the database/network is the system bottleneck and not the speed of the code, who cares that it’s slower? No one.

    You probably have never even tried using c# and visual studio, thats why you say it sucks. Do you know what commercial QT licenses on windows cost? More than a copy of Visual Studio, I can guarantee it.

    Point is, You get more work done, more clients request it, portability and speed aren’t issues for me, and it pays exactly the same.

  • Bob says:

    To all the hating noobs: Professionals use whatever language is appropriate be that c#, Java, python or whatever. Try broadening your horizons rather than ruling things out on religieous grounds and you will be a better programmer.

    To the guy who wants to still use VB6. Converting VB to C# is trivial and you’ve had 8 years to do it. Plus if you really want to stay in the stone ages windows 98 and VS6 still work as well as they ever did.

  • James says:

    I shouldn’t worry, it’s like religion – Anyone who cares about religion to any degree is hysterically over-protective of “their” religion and believes all other religions are wrong. Most of the rest of the world think each religion has reasonable traits but generally will work with whatever floats their boat, will try a bit of everything or ignore the ones they don’t find useful and laughs at the religious nut on the corner who’s getting all upset that no-one is taking him seriously.

    Use what helps you at the time. There will always be someone who thinks what you’re doing is correct and wants to pay you for it. IF it’s for home use, just use whatever is easiest for the job and ignore all the religious nuts telling you you’re coding to the wrong God.

  • A Different Ryan says:

    Yep. Proprietary languages like xcode are wrong.

  • Tom# says:

    Bob wrote: “To all the hating noobs: Professionals use whatever language is appropriate be that c#, Java, python or whatever.”

    What I observe is that many professionals are even more “religious” when it comes to how they do their work, because they’ve become accustomed to their software/environment for years and thus don’t /know/ or /want to know/ much else. After all, they see it as competition.

    As to C#: What exactly does “appropriate” mean?

    I like to think more of “options” and “possibilities”.

    How well is C# suited for all the mobile computing ahead?

    A colleague of mine connects his phone to an LCD, keyboard and mouse via docking station and this is his everyday working station. Advantage: He has all data right at his fingertips, everywhere, everytime.

  • Angry Coder says:

    C# is slower than Java and less portable.

    C# also has patent encumbrances and Microsoft’s long history of suckering people into investing in their proprietary systems and then strategically abandoning them.

    In the past, migrating to Microsoft platforms like Active Channel or Microsoft Office Accounting have gotten people fired. Small businesses have been bankrupted.

    Just recently, how many people made significant investments of time and money to develop for the Microsoft Kin phones only to have Microsoft drop them after just 6 weeks?

    Maybe you know a Microsoft fanatic that spent months putting all their finances into Microsoft Money just to have it discontinued?

    By contrast, Free Software is something you can depend on. With Free Software you know the file format. With Free Software you can add features. Focus on what you can depend on!

  • hukares says:

    @Tom#, what Bob means is, “Use the language suitabl for the job”

    Use PHP for webdevelopment — ASP sucks!
    Use C# for Windows GUI app development — use C++/Qt or C/GTK+ for GNU/Linux GUI app development.

  • Amtal says:

    Use only Lisp or go home.

  • Necromant says:

    @lexi
    > You probably have never even tried using c# and visual studio, thats why you say it sucks. Do you know what commercial QT licenses on windows cost? More than a copy of Visual Studio, I can guarantee it.

    Surprise, I did. I even did some commertial dev with C#. And during that part of my life I have witnessed what I can call the worst codebase ever.
    If you want something enterprise and fast – use java. This will save you a lot of effort.
    Oh, and btw, VS sucks hard. It’s not even close to a well configured emacs.

  • Necromant says:

    > You probably have never even tried using c# and visual studio, thats why you say it sucks. Do you know what commercial QT licenses on windows cost? More than a copy of Visual Studio, I can guarantee it.

    Are there any problems with cryochambers? Anyway, Welcome to the 21st century – QT is LGPL here!

  • DarkFader says:

    I kind of like C# now. It makes things very simple. In C(++) you have to invest in some good macros and stuff to get the rest of the code size down a bit/manageable. (Speaking from embedded C experience)
    Anyway, something relevant:
    [DllImport("inpout32.dll")]
    public static extern UInt32 Inp32(UInt32 portAddress);
    [DllImport("inpout32.dll")]
    public static extern void Out32(UInt32 portAddress, UInt32 data);

  • Mark M. says:

    @all the Java cheerleaders/C# haters:

    1. C# runs on 3 systems (Linux/MacOS/Windows), not one.

    2. Most C# < 4.0 would compile in Mono and run with trivial changes. I remember the first time I tried compiling VS source with a fairly sizable 3.5 project and was amazed. If you follow SOLID principles, your issues should be trivial.

    3. C# compiles to native code and is blazing fast, so those who claim it is somehow slower than a memory/resource hog like Java obviously have never seen a C# program running on Mono. (Or windows for that matter). Now, If anybody has EVER seen a large scale Java application that didn't pose memory or cpu resource issues I'd like to hear about it, because I haven't seen one in 10 years despite seeing about 30 or so on very serious hardware.

    4. Anybody who suggests that Java is a great enterprise language has either never been involved with a Java enterprise application, or is blissfully proud of each travesty they wreck upon the world. Please stop. Your code sucks and that's why you can't finish a project (please pick any 2 of the following:) on time, on budget and with required functionality.

    5. Anybody who would suggest coding in C++ is simply a matter of adequate expertise has obviously never met your average corporate developer, (or tried to hire a team of them). [Usually Java fan boys, btw] This is no different than somebody in the 90's telling a client that they should bypass VB6 and use C for a Windows GUI/DB app:

    It's absolutely nuts and will result in: needlessly higher costs and a very high probability of failure unless it will only be written by one or two guys and then immediately launched into space without a radio-data link.

    5. 'coding for thirty years' != 'authoritative voice'. I've been coding for over a decade, but I hardly think that any of my earlier experience is more than a conceptual stepping stone to my last three years of work. Maybe people have different experiences, but most people I meet who claim to have been coding for 'n' decades are hopelessly stranded on some technology or methodology that psychologically blocks them from getting up to date. My only doubt is whether the inevitable follow up will be: 'These kids today don't know anything' or 'Offshore development has made it impossible to keep a job in programming'. (The first may be true but is unhelpful, the second is definitely false.)

  • Wait, I’m not done with the android development tutorial yet… lol. Nice work guys.

  • Dave Eaton says:

    Anyone who is not programming 1′s and 0′s by hand and winding their own magnetic core memories is a sissy.

    What a waste of finger muscles. But I cannot resist.

    C# is an easy to learn alternative to lots of other languages, learning it will not harm your ability to learn other stuff, there are embedded platforms that use .NET, so it isn’t useless for hackery, and what professionals use and how they use it doesn’t have to concern those of us who are not professional programmers.

    This kind of bitchfest is like a primate feces flinging contest, or gangs attacking someone for the color they wear. The object is to get something done. I can get things done in a handful of languages. They all aggravate me at one time or another. Microsoft provides the express editions free, so expense is not an issue, and there are lots of things to learn before worrying about memory leaks and bullshit, so anything that makes life easier is OK by me.

    So, to any noob unsure of what to do: try it out if it sounds interesting, and look at what has been done with it- Coding 4 Fun or CodeProject has lots of interesting examples, some involving neat hardware. It might teach you something, and you can uninstall it if you discover that it is the antichrist. Never listen to advice from someone who merely denounces. It isn’t useful. Real debates are possible, but if you are a noob, you probably wouldn’t appreciate them, so go make something cool, and use whatever tool you want until you hit a performance brick wall that forces you to learn something else.

  • Keivn says:

    i Really Like C#, aside from the lack of support for Pointers. but you can always make a DLL in Delphi or C and add it as reference and use within C#. best of both worlds. 8)

  • mistercrunch says:

    Seriously? Everybody loves C# so much here? What’s wrong with you people?

    Now go and install GCC people. Free yourselves.

  • giammin says:

    to Mark M.

    You just said the things that i would like to say!

    i just want to add:

    to people who said php is better than asp:
    TRY ASP.NET
    it is real web development.
    it is not code mixed in html or 50 methods which do almost same things but slightly different

    to who said that opensource is better and cheaper:

    in enterprise development that is not always true (reallife case studies says that) because you don’t have any kind of support,

    you don’t know if a bug will be corrected

    opensource code often is really hard to understand/edit because many different style and approaches are mixed together

    sorry for my bad english

  • giammin says:

    forgot to say:

    currently i work mainly with c# and if needed in c++ but worked with java,c, php.

    13 years of work experience

  • keystoneclimber says:

    This cracks me up. Since when is “hacking” solely associated with electronics or embedded hardware? Uh… if I recall correctly hacking got it’s start in some “old school” diverse areas of study like social engineering. Funny how among a whole bunch of my language is the k00lest folks there isn’t a single reference to Perl?!? I think I’m gonna learn my hacks over at Instructables from now on. Next up… 6800 assembly tutorial

  • @DaveEaton: lol no one does that any more sad to say. The funny thing is, I’ve found bugs in datasheets for a few “coughMicrochip, coughAnalogDevice” companies that had errors in the register “values” after sanity-checking my self and finally sitting there looking at the returned data on a logic analyzer, finally came to conclusion. People can’t count binary. And just because it’s a multi-billion dollar company, doesn’t mean squat. I think they have like one person proof reading the datasheets or something.

  • Angry Coder says:

    Watch what they do, not what they say.

    Microsoft’s own core applications are being re-written as web services.

    Microsoft Office Web Apps is written in AJAX. That is to say JavaScript.

    If you learn JavaScript & SQL they will still be useful 5 years from now.

    If you learn C# and Access you’ve pretty much wasted your time instead of developing marketable skills.

  • David says:

    @DaveEaton Totally agree with you. I’ve given it a go and it makes learning to code a lot easier than simply copying into notepad and compiling.

    The included tutorials are excellent and the language is very similar to other programming languages. Being the noob I am, I find this the be a great way of being introduced to coding.

  • Mark M. says:

    Oh, Ok AngryCoder.

    Man, maybe I should give back all those 6 figure years of income I’ve made coding C#. SQL will be useful while RDBMS’s dominate for the forseeable future, no thanks to the inch deep developers pushing sql hater bs like Hibernate (“the DB is a glorified string repository for my brain dead objects!”) and NoSQL (“I’m bigger than Google!”). But JS will be (and already is) a dime a dozen.

    My Take:
    I. The Web is the data bus. Future apps will be bindable, throwaway NATIVE apps that hook into it from multiple devices.

    II. HTML5 is the most overhyped baloney since Web 2.0, (“WOW, Google’s Logo …MOVES!!!”) and will fail to end hunger or achieve world peace.

    The whole idea that web hosted apps are going to take over is a wet dream of companies vested in big machines that otherwise don’t have an edge over distributed computing. Ask yourself if the following makes sense:

    1. So, at the point at which ever more processing power is being pushed to the furthest extremes of every device on the network, we are all going to adopt a server hosted/thin client model because it has some overly complex local persistence mechanism?

    2. So, the technology that has only *marginally* successful in replacing MS Outlook, and has been perpetually hyped as ASP, SAAS, and now Cloud based Computing will suddenly be dominant once the next shiny new web standard emerges for the coronation? Wasn’t XHTML and CSS2 supposed to do that?

    3. So, Once we hold the coronation, HTML5 will be frozen, no new features will be added, and no bugs will be found? All browsers shall implement it correctly and the world will live in peace?

    4. So, HTML/CSS/JS is such a superior bundle of interface technology that the same implementation can’t run reliably on four or five browsers with vastly more processing power than the multitude of different devices jumping on the data bus, but somehow HTML5 will work awesomely on every device, every form factor, and every processor, and create an awesome user experience customized for each device as well!

    [Hold on, I've got to stop laughing long enough to keep typing]

    5. Somehow HTML/CSS/JS is NEVER as good as a native app on any device you can name, EVER, (All those Iphone and IPad developers are just wasting their time when they could be making web apps!), but HTML5 is going to hit it out of the park.

    I call bull on the whole HTML5, all apps will be browser based hype wagon. Learn native apps and MVVM.

  • osgeld says:

    “”all those 6 figure years of income I’ve made”"

    the 2 figures after the decimal point don’t count

  • Nels says:

    @ Everyone commenting along the lines of “waaaa not a hack”.

    Site is called Hack a Day. I haven’t seen a day yet where among the articles posted, there isn’t been at least one hack.
    If you’re not interested in this article, stop crying and scroll past it. Does it *really* put you out that much that there’s an article that isn’t useful to you?

    Also @that one guy who said he’d stop visiting HaD because of this post:
    I lol’d.

  • Doug says:

    In my opinion, anyone who thinks C++ beats C# clearly has no reasonable knowledge of C#

    “f you learn C# and Access you’ve pretty much wasted your time instead of developing marketable skills.”

    You’re a moron, with the most myopic of viewpoints I’ve ever seen from a ‘developer’.

    “Seriously? Everybody loves C# so much here? What’s wrong with you people?”

    Clearly we’re smarter than you.

    “i Really Like C#, aside from the lack of support for Pointers. but you can always make a DLL in Delphi or C and add it as reference and use within C#. best of both worlds. 8)”

    C# does not lack support for pointers. You need to research PINVOKE.

    “C# is slower than Java and less portable.

    “C# also has patent encumbrances and Microsoft’s long history of suckering people into investing in their proprietary systems and then strategically abandoning them.”

    Nothing but a Microsoft Hater. Plane and simple. The facts do not support your claims.

    “Use PHP for webdevelopment — ASP sucks!
    Use C# for Windows GUI app development — use C++/Qt or C/GTK+ for GNU/Linux GUI app development”

    PHP, really? Come into the 21st century brother, no flying cars, but we have smarty phones.

    … Yup I have lots of time on my hands to bitch at MS haters about near sighted comments from the uninformed. That’s because I use a nice managed framework and get my work done in a lot less time.

    Go bask in the green glow of your iSeries, freakin’ dinosaurs.

  • Armando says:

    I don’t get it, sorry, where is the tutorial :|??

  • Leave a Reply

    XHTML: You can use these tags: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Hack a Day serves up fresh hacks each day, every day from around the web as well as hacking related news.

    Send us your hacks






         




    Hacks

    Resources