These are programming specific articles that will be published to CodeProject. They should be complete tutorials with code examples for you to use!

IronPython: A Quick WinForms Introduction

A few months ago I wrote up an article on using PyTools, Visual Studio, and Python all together. I received some much appreciated positive feedback for it, but really for me it was about exploring. I had dabbled with Python a few years back and hadn't really touched it much since. I spend the bulk of my programming time in Visual Studio, so it was a great opportunity to try and bridge that gap when looking at something like IronPython. I had an individual contact me via the Dev Leader Facebook group that had come across my original article. However, he wanted a little bit more out of it. Since I had my initial exploring out of the way, I figured it was probably worth trying to come up with a semi-useful example. I could get two birds with one…

0 Comments

Yield! Reconsidering APIs with Collections

Yield: A Little Background The yield keyword in C# is pretty cool. Being used within an iterator, yield lets a function return an item as well as control of execution to the caller and upon next iteration resume where it left off. Neat, right? MSDN documentation lists these limitations surrounding the use of the yield keyword: Unsafe blocks are not allowed. Parameters to the method, operator, or accessor cannot be ref or out. A yield return statement cannot be located anywhere inside a try-catch block. It can be located in a try block if the try block is followed by a finally block. A yield break statement may be located in a try block or a catch block but not a finally block. So what does this have to do with API specifications? A whole lot really, especially if you're dealing…

0 Comments

Lambdas: An Example in Refactoring Code

Background: Lambdas and Why This Example is Important Based on your experience in C# or other programming languages, you may or may not be familiar with what a lambda is. If the word "Lambda" is new and scary to you, don't worry. Hopefully after reading this you'll have a better idea of how you can use them. My definition of a lambda expression is a function that you can define in local scope to pass as an argument provided it meets the delegate signature. It's probably pretty obvious to you that you can pass in object references and value types into all kinds of functions... But what about passing in a whole function as an argument? And what if you just want to declare a simple anonymous method right when you want to provide it to a function? Lambdas. So…

1 Comment

Fragments: Creating a Tabbed Android User Interface

Fragments: A Little Background Update: The actual application is available on the Google Play store. Once upon a time, Android developers used only two things called activities and views in order to create their user interfaces. If you're like me and you come from a desktop programming environment, an Activity is sort of like a form or a window. Except it's more like a controller for one of these classes. With that analogy in place, a view is then similar to a control. It's the visual part you're interacting with as a user. I remember the learning curve being pretty steep for me being so stuck in my desktop (C# and WPF) development, but once I came up with these analogies on my own, it seemed pretty obvious. So to make an Android application, one would simply put some views together…

4 Comments

Dynamic Programming with Python and C#

Previously, I was expressing how excited I was when I discovered Python, C#, and Visual Studio integration. I wanted to save a couple examples regarding dynamic code for a follow up article... and here it is! (And yes... there is code you can copy and paste or download). EDIT: Wait! Before you head to far, you might want to check out this more recent article on Python and C#! What does it mean to be dynamic? As with most things, wikipedia provides a great start. Essentially, much of the work done for type checking and signatures is performed at runtime for a dynamic language. This could mean that you can write code that calls a non-existent method and you wont get any compilation errors. However, once execution hits that line of code, you might get an exception thrown. This Stack…

6 Comments

Python, Visual Studio, and C#… So. Sweet.

Python & C# - Background Let's clear the air. Using Python and C# together isn't anything new. If you've used one of these languages and at least heard of the other, then you've probably heard of IronPython. IronPython lets you use both C# and Python together. Pretty legit. If you haven't tried it out yet, hopefully your brain is starting to whir and fizzle thinking about the possibilities. My development experiences is primarily in C# and before that it was VB .NET (So I'm pretty attached to the whole .NET framework... We're basically best friends at this point). However, pretty early in my career (my first co-op at Engenuity Corporation, really) I was introduced to Python. I had never really used a dynamic or implicitly typed language, so it was quite an adventure and learning experience. Unfortunately, aside from my…

15 Comments

Events: Demystifying Common Memory Leaks

Background If you've poked through my previous postings, you'll probably notice that I love using events when I program. If I can find a reason to use an event, I probably will. I think they're a great tool that can really help you with designing your architectures, but there are certainly some common problems people run into when they use events. The one I want to address today has to do with memory leaks. That's right. I said it. Memory leaks in your .NET application. Just because it's a managed language doesn't mean your code can't be leaking memory! And now that I've got your attention, let's see how events might be causing some leakage in your application. (There is source that you can download and run. Check the summary section at the end!) Instance-Scope Event Handlers One of the…

4 Comments

API: Don’t Forget About The Non-Public API!

Background From an object oriented programming perspective, an application programming interface (API) is often referred to as the way other developers can interact with the public members of your class(es) and interface(s). Of course, API can be used to describe how one interacts with a web service (or other types of services), but for this discussion I'm limiting the scope to that of interfaces and classes. Limiting the definition of API to public members (or the equivalent of C#'s "public" in other languages) is omitting one huge part of what it encompasses. The purpose of this post is to clarify, in my opinion, why I think forgetting about the non-public API can lead to bad framework and API designs. API And The Audience I've written before about what I think makes a good API, and I had some comments on Code…

4 Comments

It’s Our Code

Background I’m sure what I’m about to talk about here doesn’t just relate to programming–it relates to any team-based project where everyone works on a small portion of the big picture. My experiences are primarily geared toward writing code in teams, so try to find parallels in your own work/experiences if you’re not a programmer. Anyway, enough of that. When someone puts a lot of effort into something, they’ll often take great pride in the finished product. Of course, it’s great that they do! They’ve slaved away at something at work for days, weeks, or months, and it’s finally working/implemented. Other people are using it and it’s doing its job as expected. Awesome! What kinds of things could possibly go sour here? If you have experience working in teams to complete a project, you might have some ideas. Ownership You…

1 Comment

End of content

No more pages to load