Posted by andrewmyhre on January 20, 2008
Since C# 2.0 we’ve been able to use the following syntax:
82 public class MyClass<t>
83 {
84 private t obj;
85 public MyClass(t theObject)
86 {
87 this.obj = theObject;
88 }
89
90 public t doit()
91 {
92 return obj;
93 }
94 }
This can be accomplished in C++ in the following way:
1 template <class T>
2 class MyClass
3 {
4 public:
5 MyClass(T* obj) ;
6 ~MyClass();
7 T* doit();
8 private:
9 T* theObject;
10 } ;
11
12 MyClass::MyClass(T *obj)
13 {
14 theObject = obj;
15 }
16
17 T* MyClass::doit()
18 {
19 return theObject;
20 }
This is how we can implement strongly-typed object managers, as well as smart pointers.
Posted in c++ | Tagged: c++ | Leave a Comment »
Posted by andrewmyhre on January 13, 2008
No, not me. Blogger roecode has just started writing this series, XNA Game Engine Development. I’m in awe. I’ve fantasized about writing a game engine ever since I knew what such a thing was, but without any exposure to other game developers it’s pretty difficult to learn. I’m only as proficient* in ASP.Net because the community has been out there blogging their faces off about it – for instance the completely benevolent genius that is 4GuysFromRolla, and the excellent series of articles they produced in 2006 about the ASP.Net 2.0 Membership system – a series which, by the way, helped in large part to inspire me to be a .Net ‘evangelist’, and take myself seriously as a professional developer.
I digress, but only to make the point that it’s articles like this XNA Game Engine Development series that are going to inspire others by making it all less mysterious. I mean, I wouldn’t have the first clue what needs to be set up when creating a DirectX session. Even in an XNA Game project – there are tutorials on the Microsoft websites, but none of the code is intended to be taken as being production-level code. What are the best practises when creating your architecture? What do you need to tell your DirectX device, and what should you ask of it? Stuff that’s basically ‘in-the-know’.
So if you have any interest in game development, check out roecode’s tutorial series. It’s in development and there are currently 3 parts out. This is the kind of community content that, if anything, is going to push XNA as a serious contender in game development. Now I know that as a platform for professional development, it just doesn’t compare to C++ for low-level control, but man… this is really handing a lot of power to the hobbyists. And Microsoft have always taken the view that it doesn’t matter if their code is bloated and inordinately resource-hungry, because they rely on what must surely be Microsoft’s patron saint – Moore’s Law. Where the fuck would Windows XP be if we’d never improved upon the 486? Anyway, they’re probably hedging their bets that, pretty soon, XNA is going to perform a lot more closely to C++**, and they’ll be positioned quite nicely.
Which is really all to say – cheers roecode, I await further updates most eagerly.
Here are parts one, two and three of the series.
*Note: I’m mildly proficient
**Yes, I know that C++ will always generally outstrip C#, I mean eventually the differences just won’t be so significant.
Posted in .net, xna | Tagged: .net, xna | Leave a Comment »
Posted by andrewmyhre on January 9, 2008
High expectations this year. I want to have at least a couple of commercial MVC website under my belt by 2009, and I want to be using Team Foundation 2008. Part of this will be to make use of Web Deployment Projects combined with Team Builds. What would be great is if I could have the team server spitting out nicely labelled development, staging and production builds of our sites, and if I could configure the config file changes using web deployment projects. Also I would like it to produce metrics around unit tests, integration test and interface tests, and anything else that would be useful (code metrics? haven’t explored this fully yet). I want our projects managers/testers to be able to know what build they’re looking at and easily get a summary of the changesets involved in that build.
So that’s the plan. We are currently running TFS 2005, but the documentation says that VSTS 2008 and TFS 2005 are compatible, so what I’m going to do first is set up a ‘Sandbox’ MVC project in it’s own Team Project space, for us to play with and try things out.
So started by creating a new Team Project, then a new ASP.Net MVC Web Application and Test project (makes sense – want to try out the built in unit testing functionality).
Then I choose the project in TFS I want to use as the repository.
At this stage everything is created and ready to check in, so I perform a solution check-in. All looks good, I can see padlocks next to all my files. But if I close and re-open the solution, I get the message:
The project ‘MvcApplicationTest’ is under source control. This version of Visual Studio .NET does not support source controlled projects. Any changes that you make to this project will not be propagated to source control.
Strange! And now the test project is no longer source-controlled. If I create a build to run these tests on the build server it won’t have any of the project files to compile and run.
To clarify, I’m using Visual Studio Team System 2008 RTM. Anyway, I’ve tried a couple of things, like deleting the test project and adding a new test project. Trouble is I can’t write tests against the MVC controllers due to some weird issue – I can’t add a reference to the version of System.Web.Extensions.dll referenced by the MVC project (3.6.0.0) to the test project. It’s in the GAC, but doesn’t appear in the components list (I see 3.5.0.0, the version that ships with VS 2008). So I can’t even create my own test projects.
Bit of a worry and I hope it gets addressed when MVC goes into full release…
Posted in .net, mvc, tfs | Tagged: .net, mvc, tfs | 1 Comment »