I was listening to Scott Hanselman's 'Be a better developer in 6 months' and he made reference to a blog entry about becoming a better devloper: http://graysmatter.codivation.com/HowIAmBecomingABetterDeveloperPart1OfInfinity.aspx.
I began thinking of what I have done recently and what I want to do over the next few months to better my skills and overall approach to technology.
First, blogs. I read blogs daily and try to keep up with article/blog series on development, such as Jeremy Miller's Build your own Cab, where I learned more about coding approaches as well as seeing how different programmers do things that I've done before. Usually I like approaches that other's have taken and I adopt them over time. It's a lot like a code review, but instead of me correcting code its more about learning how and why the approach was taken.
Second, new technology. I try to keep up with Microsoft's pace to at least review the new technologies coming out. It is very difficult for me to fully grasp everything that comes out of MS, so I read up on as much as I can, but I do get my hands dirty with beta and ctp's of software that I think I'll use in the future. For example, at the time if this posting, I'm working with Beta1 of Visual Studio codename Orcas. I know I'll be using it, so I check it out with my side projects or just for fun. It's a good way to stay ahead of the game and it's nice to mix it up a bit with a new IDE or a new library to code against.
Third, books! I dont read as many programming books like I used to. I used to get 2-3 ASP books or C# books so that I could understand the language or environment that I was working with, but now I'm tending to choose books that are changing the way I think and giving me new perspectives, for example reading something like Pragmatic Programmer is language and platform agnostic, but a great programming book. I also like to read things that give me deeper insight to the platform, specifically .NET, such as CLR via C#. There are a ton of books that are great, and Scott Hanselman has a good list here: http://www.hanselman.com/blog/SixEssentialLanguageAgnosticProgrammingBooks.aspx.
Fourth, learn a new language. This is not so much learning another .NET language, rather learning a language that is completely different from your primary language. For example, if I were a completely C# guy and didn't know a thing about any other .NET languages, VB.NET would be good to know so I could read it, but not necessarily learning anything outside of new syntax for the same platform. I'm sure most people have already been aware of the Ruby or Python buzz. It wouldn't be a bad idea to learn something that is completely different than your used to. Every language has it's strenghts and weaknesses. Learning the strengths of other languages may teach you a thing or two about desgin as well as prepare you for future enhancements of your primary language. C# is adopting a lot of old ideas into the language that will be new to most .NET developers, but old to a lot of existing python/ruby devs.
And last but not least: code, code, code, code! Reading books, reading articles, reading blogs and watching movies for a year on how to fly an airplane does not mean you are able to jump in a plane and fly it at night through clouds! Without practice, we all only have is unverified knowledge. For example, Runbot is a robot that is learning to walk like humans. In this video, it tries to walk up a ramp knowing only what it knows about walking level terrain. As it tries, it falls and learns something new about its experience. As it tries over and over, it masters that ability. We as humans have superior ability to learn from our mistakes and learn from others' sucesses and failures. The only way we can make that into our own experience is to practice those skills. No amount of books, articles or books will replace actual experience.
I hope someone finds inspiration and feels challenged after reading this, becaus I know now that I have it up and shared, I will be challenged to become a better developer.
...read more!
Friday, July 13, 2007
Things to do to become a better developer
Posted by
Marko Rangel
at
1:45 PM
1 comments
Labels: .net, technology
Monday, June 18, 2007
Global.asax and PrecompiledApp.config
I spent the better part of the day and a bit more a few days back trying to figure out this problem!
I have put some exception handling int he application_error event of my global.asax, and everything ran smoothly on my dev and staging box. For some reason, I could not get our production environment to handle the exception handling for our unhandled exceptions. At first I thought it was our logging mechanism, but after a few tests, we figured the code was ok.
We looked at permissions for the account running the site, but there was nothing wrong there. Finally there was a link that a co-worker gave me that suggested that the PrecompiledApp.Config be removed from the root of the application. As it turns out, that file has been missing (due to some deployment issues), so we put it back in and it started to work. The application_error event was finally firing. I can't figure out exactly why the config file is needed, but it is for precompiled applications. Hope it helps someone!...read more!
Posted by
Marko Rangel
at
5:02 PM
3
comments
Labels: .net, technology
Tuesday, May 29, 2007
ASP.NET Web Application Project problems
This past weekend I was working with a continuous integration build with an ASP.NET project. I was attempting to get a website staged on a staging environment by using msbuild. I build the site and published it to another directory that had IIS pointed to it. Due to some reference issues (particularly, with the default web project template that I was using, I could not get my referenced assemblies to be available for msbuild to build the project), I switched to the Web Application Project template, that basically took the VS.NET 2003 project template, and copied all my files from the old project to the new one.
Everything debugged and ran just fine, but when I published the site and hosted it via IIS, I was being plagued with an error somewhat like this one:
The type 'objectname' exists in both
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\
and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\
I couldn't figure out why I had this issue. I could run the site just fine from VS.NET 2005, but could not actually publish it without getting that error. Searching online only yielded deleting my temporary asp.net files, bouncing IIS or even bouncing the machine. None of the issues resolved the problem.
I finally found the resolution, and it I wish I could find the post that had the resolution so I could give due credit to them, but basically the Web Project (default out of VS.NET) uses the CodeFile attribute to find the code behind file. Changing CodeFile to CodeBehind on all my aspx pages resolved the issue.
Hope this helps someone!
...read more!
Posted by
Marko Rangel
at
9:50 AM
1 comments
Labels: .net, technology
Monday, April 9, 2007
Great introduction to StructureMap 2.0
I've always been intrigued by StructureMap and Spring.net, but I've never known really how or why I should use them. I guess I never had the visibility in their benefits, but I figured that they could come in handy at some point.
Recently Jeremy Miller released version 2 of StructureMap, but it was still hard for me to get solid examples without previous knowledge of what the tools do.
He recently posted an introduction to StructureMap 2.0, and it really helped me get a better understanding of how to use it, and I can see the benfits immediately from the examples on the intro.
I still have a few questions on overall usage, mostly around configuration since the examples that Jeremy has revolve around configuration objects and the default implementation in some sort of startup method/event. If that is the case, would I have this enormous list if declarations? Surely this could be done in a config (and I think it does, so I'll just wait and see!)...read more!
Posted by
Marko Rangel
at
11:00 AM
0
comments
Labels: .net, technology
Thursday, March 15, 2007
ASP.NET Wishlist
Steven Smith has posted his wishlist for ASP.NET. He's in Seattle for the MVP summit. You can read about the items here: http://aspadvice.com/blogs/ssmith/archive/2007/03/14/ASP.NET-Wish-List.aspx.
I would like to focus my attention on a couple:
1) Recursive FindControl - Would be cool, but, as Steven mentions, there are a few functions out there that provide this. Nice to have, but dont compromise any other deliverables for this.
2) Cache Improvements - This is huge. I dont rely too heavily on Cache, but I do use it enough to say that companies like ScaleOut have stepped up to fill in the gaps that Microsoft has made. I would like to see two things out of Steven's list: Distributed Cache and a Cache Provider Model. I'd like to see the out of the box implementation have distributed cache mechanism, but also have the ability to throw in our own implementation of cache.
I'm really excited to see the next feature set of ASP.NET....read more!
Posted by
Marko Rangel
at
8:52 AM
0
comments
Labels: .net, technology
Monday, March 5, 2007
Invoking an ajax/atlas modal dialog off a postback
Recently I was working on a scenario where I had to show an ajax/atlas modal dialog using ajax' ModalPopupExtender after some server side processing had been done. This was very hard because one of the control's required properties is the TargetControlID, which responds to a click event and throws up the modal dialog, all before the postback occurs.
I tried looking for a fancy way to be able to get this modal up and running by assiging some dummy control in the markup and calling .Show() to make the dialog show up, but that didn't yield me much.
I found a bit of a hack, which is pretty much creating a control (in my example, a label) on page_load, adding it to the UpdatePanel's ContentTemplateContainer's control collection, assign the ID of the dummy label to the ModalPopupExtender's TargetControlID property and then on a postback I could call .Show() on the MPE (ModalPopupExtender) and the dialog would show up as I needed it.
In the following example I am displaying the current timestamp on a label that is set off of a button click postback event.
default.aspx: 1: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
2: <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
3: 4: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
5: <html xmlns="http://www.w3.org/1999/xhtml">
6: <head runat="server">
7: <title>Untitled Page</title>
8: </head>
9: <body>
10: <form id="form1" runat="server">
11: <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
12: <asp:UpdatePanel ID="upShowStuff" runat="Server">
13: <ContentTemplate>
14: <asp:Button id="Button1" runat="Server" Text="Process Postback" OnClick="Button1_Click" />
15: <ajax:ModalPopupExtender ID="mdePopup" runat="server" PopupControlID="pnlShowStuff"
16: OkControlID="btnOK" />
17: <asp:Panel ID="pnlShowStuff" runat="Server" Style="display:none">
18: <div style="border:solid 1px #000">
19: <asp:Label ID="lblShowStuff" runat="Server" />
20: <asp:Button id="btnOK" runat="Server" Text="OK" />
21: </div>
22: </asp:Panel>
23: </ContentTemplate>
24: </asp:UpdatePanel>
25: </form>
26: </body>
27: </html>
default.aspx.cs: 1: public partial class _Default : System.Web.UI.Page
2: { 3: protected void Page_Load(object sender, EventArgs e)
4: { 5: Label lbl = new Label();
6: lbl.ID = "tempholder";
7: upShowStuff.ContentTemplateContainer.Controls.Add(lbl); 8: mdePopup.TargetControlID = lbl.ID; 9: } 10: 11: protected void Button1_Click(object sender, EventArgs e)
12: { 13: lblShowStuff.Text = DateTime.Now.ToLongTimeString(); 14: mdePopup.Show(); 15: } 16: }
...read more!
Posted by
Marko Rangel
at
8:02 PM
1 comments
Labels: .net, technology
Wednesday, February 28, 2007
March CTP for Orcas (Visual Studio)
Good news: March CTP for Orcas is out.
It's unfortunate that I have not had time to keep up with Orcas as of yet. Just recently I downloaded the last CTP for Orcas, but haven't cracked it open yet. Now I get to download this new version and trash the older one....read more!
Posted by
Marko Rangel
at
12:08 PM
0
comments
Labels: .net, technology
Monday, February 26, 2007
FlipCalc
A couple of friends of mine are working on this really great site. The idea is a calculator that gives you an idea of the investment and return on trying to flip a house. The great thing about this site is that it uses real data on a house (given the address) and the expenses and investments.
I really do think that FlipCalc is a novel idea, and also proves that with the right idea and some invested time, you can get a small business off the ground. Where FlipCalc will go from here, I dont know, but I can really see some great extensions and partnerships taking off from here.
You can find it here: FlipCalc....read more!
Posted by
Marko Rangel
at
10:14 AM
0
comments
Labels: general, technology
Thursday, January 25, 2007
Sysinternals Suite
I'm really exited now that I can download most of the tools that I use from Sysinternals in one simple download.
http://download.sysinternals.com/Files/SysinternalsSuite.zip
Close to 70 helpful exe's....read more!
Posted by
Marko Rangel
at
3:21 PM
0
comments
Labels: technology
Sunday, January 14, 2007
Running background processes in a medium trust environment
I was recently in a situation where I needed to run some background processes against some data and in-memory data structures that contained information that needed to be processed from time to time.
My application is an ASP.NET application hosted in a 3rd party environment where they have their trust level set to medium. They host the web applications in such a way as to not disrupt other applications due to my programming, so in a way, its a bit of like sandboxing. The host more than likely set these trust permissions in the machine.config file and didn't allow for the applications to override the settings, as most hosts would. Asking them to add a scheduled task would be an option, but highly unlikely due to security constraints.
One option is to create an .aspx page that had the functionality that I needed to get done and ping it every x seconds and have it do my work, but that requires an external source hitting my website, and it feels and smells dirty.
I ran accross Rob Howard's 10 Tips for Writing High-Performance Web Applications article on MSDN and found an entry on using a timer as a background thread. I decided to pursue this idea further by creating an HttpModule that loads up assemblies at runtime into AppDomains and executes a common method (much like a plug in pattern) to do the work. I ran into a really big issue using AppDomains, so I came up with an alternate way of loading the assemblies using reflection.
In the end I came up with a solution that would run in a high/full trusted environment AND a medium trusted environment. The HttpModule will basically "dumb down" to the lowest setting specified and load the assemblies in that fashion. This allows for better isolation in higher trusted environments, but maintain the base functionality of running tasks in the background in the case of medium trust.
The concept is pretty simple: load assemblies from a given directory (or current executing directory), load types specified in the configuraiton file for the given assemblies, make sure they are compliant to the proper plug in interface, and finaly execute methods on them. It's not very difficult to get something like this up and running, so I'll be posting a binary and possibly the source code as soon as I get it cleaned up, documented, tested and a bit more pretty, so it may take me a few days or week or so....read more!
Posted by
Marko Rangel
at
9:49 PM
0
comments
Labels: .net, technology