Archive

Posts Tagged ‘Developer’

Learning Scala from a Java perspective

October 1st, 2009 No comments

I’ve been reading up and keeping abreast of both the .NET world and Java world this year, both have some mighty exciting advancements coming – teaser: its all about the Pentiums! I’ll try and cover some of my research into parallel work later.

One of the other areas I’ve been keen on (after hearing from the leader of our pack, Mr Wolfe) was Scala and came across a incredibly useful resource by Daniel Spiewak on looking at Scala from a Java developers perspective.

The linked article is a ’roundup’ of the many posts he’s done on the topic and covers the many facets of Scala and gives it in a Java developers perspective. Highly recommended reading if your just starting out in understanding Scala and functional programming general. I have to admit, Scala is growing on me.

F# is the key functional programming language in .NET and whilst I’ve seen them being compared quite frequently, I feel they target to different areas. From a n00bish-functional-programming perspective, it feels like Scala is all about the OO and F# is more about writing in a functional perspective. But here’s an article from 2007 that may give you a better idea or Brandon Werner‘s article comparing the functional languages.

By the same token, there’s a great introduction to F# that will cover the historical and core language.

I remember messing about 10 years ago with Delphi, VB, Java, C/C++ and thinking this is RAD, but the world seems to be morphing into the functional programming paradigm now.  What better time to start musing with it?

{lang: 'en-GB'}
Share

Free ApexSql Code code

September 22nd, 2009 No comments

Request your free copy of ApexSQL Code by following the directions below!

We are launching a new promotion for the new Online Template Library of ApexSQL Code 2008.

UPDATE – ApexSQL Code for FREE! A $249 value

In an effort to really jump start the ApexSQL Code community and get more templates we are temporarily offer for free, no strings attached, full licenses of ApexSQL Code 2008 w/ 1 yr Maint to anyone who requests one.

The license will be for ApexSQL Code w/ 1 yr Maintenance for Support and Upgrades.

To request it email sales@apexsql.com and include “Free ApexSQL Code” in the subject header. We will process the request and send you your own individual key within 1 business day. These will be fullfilled via the same process as people who purchase them – the only difference is the cost is $0.

We encourage people to post feedback on our forums (bugs, feature requests etc) and post templates.

My goal is to continue this until we get a good number of user posted templates on our Online Template Library.

You will be able to continue to use your key and ApexSQL Code 2008 ad infinitum. To upgrade to ApexSQL Code 2009 (when it is released) would only require a renewal fee of 25% of purchase price. Currently $50.

This promotion could end at any time so get your request in ASAP. The keys will be viable though after the promotion ends.

Note: If you don’t receive a key in 2 business days, please send a second request (third, call etc). We have gotten a lot of requests and it is inevitable that some might get missed on the first time around.

Hurry hurry hurry!

Get Apex SQL Code for free!

We are launching a new promotion for the new Online Template Library of ApexSQL Code 2008.

UPDATE – ApexSQL Code for FREE! A $249 value

In an effort to really jump start the ApexSQL Code community and get more templates we are temporarily offer for free, no strings attached, full licenses of ApexSQL Code 2008 w/ 1 yr Maint to anyone who requests one.

The license will be for ApexSQL Code w/ 1 yr Maintenance for Support and Upgrades.

To request it email sales@apexsql.com and include “Free ApexSQL Code” in the subject header. We will process the request and send you your own individual key within 1 business day. These will be fullfilled via the same process as people who purchase them – the only difference is the cost is $0.

We encourage people to post feedback on our forums (bugs, feature requests etc) and post templates.

My goal is to continue this until we get a good number of user posted templates on our Online Template Library.

You will be able to continue to use your key and ApexSQL Code 2008 ad infinitum. To upgrade to ApexSQL Code 2009 (when it is released) would only require a renewal fee of 25% of purchase price. Currently $50.

This promotion could end at any time so get your request in ASAP. The keys will be viable though after the promotion ends.

Note: If you don’t receive a key in 2 business days, please send a second request (third, call etc). We have gotten a lot of requests and it is inevitable that some might get missed on the first time around.

Get your developers the tools they need to do the job fast and right – ApexSQL Developer Studio is the ultimate combat multiplier for SQL Developers. 7 Best of Class tools – one download, install and discounted price. Click Here for more info.

{lang: 'en-GB'}
Share

I’ve made a huge mistake: To be a computer tech or not to be a computer tech.

June 29th, 2009 No comments
I've made a huge mistake

I've made a huge mistake

An article in The Age about computer techs and their chosen lifestyle made me realise just what a mistake we’re making.

Long story short: now I run a computer repair business.

Babes, parties, status, wealth – these are just some of the things you’ll be missing out on by becoming a computer tech.

But that’s OK. If you have what it takes to be a computer tech, you will have a genetic predisposition to driving away members of the opposite sex. In fact, members of any sex.

I’m just kidding.

Oh darn, I was just about to enjoy being a techie. But wait he’s just kidding.

How do you know if you have this personality type? If you have more computer magazines than girlie magazines, and if the thought of an Intel Core 2 Quad Q9550 with 12mb L2 cache running at a clock speed of 2.83GHz and a bus speed of 1333 MHz stirs the kind of feelings usually associated with procreation, you are well on your way to a career in computing.

Uh-oh, this one time, at band-camp LAN camp I was talking about the new Intel i7‘s coming up and oh noooooo! Just remembered I also have far too many developer mags lying around and no Womens Weekly nor Cosmopolitan‘s. Doom is imminent, it was also a kick-ass game made by those clever folks at id Software who just the other day got bought out by Zenimax Media, they’re also working on Doom 4 powered by the RAGE engine did you know? Doh, I’m digging my own grave aren’t I by going on? I better stop, you just go and read the article yourself before I start admitting to something like my crazy adventures in Linux.

But if your a hottie and you see a computer-techno-nottie, just go and give them a hug. They need it, those tradies, they’ve got their stuff together, so do the sparkies. We programmers, gamers who resort to online dating and wierdly obsessed facebook/twitter stalkers need love too. Who knows, we might even get around to fixing that problem with the mouse moving around the screen all by itself one day.

One things for sure, the future is not set, there is no fate but what we make for ourselves.

{lang: 'en-GB'}
Share

.NET Tools: NDepend static analysis tool, leave T-Pain behind.

June 1st, 2009 5 comments

The release of Visual Studio 2008 brought along Code Metrics to the IDE‘s ‘out-of-the-box’ functionality (I’ve been overusing that phrase thanks to our resident CRM Consultant at work!). This was a major boon for .NET developers to get a clear idea of health of what they write, Visual Studio 2005 gave FxCop integration that provided much needed static code analysis for .NET assemblies. Together these tools provide a peek into the deep depths of the project your working on, it benchmarks the correctness, performance and security implications, localisation, design issues amongst other metrics. Damn useful if you’ve inherited – as I often do in my consultancy life – someone else’s code base with little or no documentation. They say code is the best documentation right? (oh gosh, not one of those projects!)

Whilst both the metrics in VSNET and FxCop give you a low level understanding of your code – based on framework guidelines, what if you want more in depth understanding of what your ‘working with’ rather than how you use the .NET framework? How many methods derive from a certain control – remember we’re doing static analysis here, no Resharper loving! Or how maintainable the assemblies are. What are the methods with more than 30 lines of code? (hint: need to refactor!)

This is where NDepend comes in. NDepend is a static code analysis tool on steroids – and I’m not exaggerating here. You will love NDepend long time as I do right now.

Load up NDepend, point to your assemblies, then let NDepend think a little and it will spit out a plethora of information for you to take in.

The NDepend UI – VisualNDepend

There is however one caveat, the first time you use it – and I know this will happen to the majority of users, you’ll probably get overwhelmed with what you’ll be displayed with:

NDepend Paint.NET Analysis

NDepend Paint.NET Analysis

So you can reproduce this with the trial of NDepend, I’m looking at the latest Paint.NET release. But once you get over your initial sense of wonder and disbelief you can start to demystify the UI and the beauty of NDepend. Dont worry, theres plenty of documentation and help to get you on your way, I’ll cover those later :-)

First, we have a Class Browser to the left that lists all the assemblies that are being anaylsed – this includes the assemblies you selected (black!) and the assemblies that were added automajically by NDepend as dependencies (blue).

To the right of the class browser is our Metrics visual representation (those black balls actually mean something – Marty!). We can tell NDepend to show us (visually via the Code Metrics display) the top 10,20,50-5000 methods. Double click on any item in the view and it will automatically jump to the source (in the working VS.NET instance if available) for you to inspect further. Theres also deep integration with Visual Studio too – again later!

Underneath the Metrics window we have the Dependency Graph on the left and the Dependency Matrix on the right. This view gives us an idea of the coupling between the assemblies in our list.

The World of CQL

Then we have – what makes me get jiggy wif it, the CQL Query window. CQL is Code Query Language, and its just as your thinking, its SQL for Code. Armed with a basic understanding of CQL you can get some really useful information about your project – infact the report that gets generated by NDepend already contains a bunch of metrics for you and comes with over 85 metrics to begin with in a heavily documented specification – with examples. Writing a simple bit of CQL like the one below, will give you a representation of all public methods that contain more than 30 lines of code.

SELECT METHODS WHERE NbLinesOfCode > 30 AND IsPublic

Neat huh? Thats only an example from the features page, there’s lots more. We can even setup a constraint to notify us when we exceed a threshold.

WARN IF Count > 0 IN SELECT METHODS WHERE NbILInstructions > 200 ORDER BY NbILInstructions DESC

This will warn us when we have methods that exceed 200 IL instructions. You can even combine a bunch of them and workout a metric to benchmark which methods you need to refactor, heres one from the report that gets autogenerated by the VisualNDepend tool:

WARN IF Count > 0 IN SELECT TOP 10 METHODS /*OUT OF "YourGeneratedCode" */ WHERE 

                                           // Metrics' definitions
     (  NbLinesOfCode > 30 OR              // http://www.ndepend.com/Metrics.aspx#NbLinesOfCode
        NbILInstructions > 200 OR          // http://www.ndepend.com/Metrics.aspx#NbILInstructions
        CyclomaticComplexity > 20 OR       // http://www.ndepend.com/Metrics.aspx#CC
        ILCyclomaticComplexity > 50 OR     // http://www.ndepend.com/Metrics.aspx#ILCC
        ILNestingDepth > 4 OR              // http://www.ndepend.com/Metrics.aspx#ILNestingDepth
        NbParameters > 5 OR                // http://www.ndepend.com/Metrics.aspx#NbParameters
        NbVariables > 8 OR                 // http://www.ndepend.com/Metrics.aspx#NbVariables
        NbOverloads > 6 )                  // http://www.ndepend.com/Metrics.aspx#NbOverloads
     AND 

     // Here are some ways to avoid taking account of generated methods.
     !( NameIs "InitializeComponent()" OR
        // NDepend.CQL.GeneratedAttribute is defined in the redistributable assembly $NDependInstallDir$\Lib\NDepend.CQL.dll
        // You can define your own attribute to mark "Generated".
        HasAttribute "OPTIONAL:NDepend.CQL.GeneratedAttribute")

Whats more, because NDepend is language neutral you can query any managed assembly. Theres so much goodness you can get from CQL, most of your needs are already documented in the specifications.

Healthy coder == healthy code right?

NDepend also gives us a representation of what state the code is in with the generated report.

Paint.NET Abstractness vs Stability

Paint.NET Abstractness vs Stability

This metric – based on Robert C Martin’s Abstractness vs Stability paper. To quote the paper’s Abstract directly:

This paper describes a set of metrics that can be used  to measure the quality of an object-oriented design in terms of the interdependence between the subsystems  of  that design.   Designs which are highly interdependent tend to be rigid, unreusable and hard to maintain.
Yet interdependence is necessary if the subsystems of  the design are to collaborate.  Thus, some forms of dependency must be desirable,
and other forms must be undesirable.   This paper proposes a design pattern in which all the dependencies are of the desirable form. Finally, this paper describes a set of  metrics that measure the conformance of a design to the desirable pattern.

In the case of Paint.NET we can see that we’re all over the bottom corner of the image. What does this mean?

First we have the two ends of the scale.

  • Y – Abstractness
    This measures how abstract the assembly is, can it be extended without recompiling? Lots of interfaces and base classes help here.
  • X – Instability
    Measures how much this assembly is utilised by its public interface. For most third party component (from vendors) they’ll fall into the less instability area, so you have to ensure that any changes are properly managed to avoid breaking clients.

Then we have two zones.

  • Zone of uselessness
    This is when an assembly is very abstract and extensible but no-one uses it you’ll find it closer to this area.
  • Zone of Pain
    This is when an assembly is referenced (or have lots of dependants) and is not very extensible – no abstract implementations.

One thing to note though, the words ‘Pain’ and ‘Uselessness’ may be a bit harsh in its wording. If you – like me – have a core ‘framework’ that you write have it locked down and reference it muliple projects then they should indeed fall into the ‘Zone of Pain’ assuming that you have ensured its stability and realise the consequences of breakages later on. Most third party products will fall into here – we’re talking your UI Controls, Sharp components etc.

Ideally you’d want to be hovering in the green area cosey with the line in the middle for your core product.

Would you like Documentation with that?

As mentioned earlier, NDepend comes with lots of help, firstly we have – what I used, the Getting Started screencasts, tutorials, CQL Documentation with *actual* usable examples.

Scott Hanselman has also released a nice cheatsheet for NDepend that will go well hanging next to your PC.

Integrating NDepend to Integration Server

At home (and at work) we use Jetbrains TeamCity, you can easily integrate NDepend into TeamCity by following Laurent Kempé directions.

If you use CruiseControl.NET, you’ll find Robin Curry‘s guide on integrating NDepend to NAnt and CruiseControl.NET useful.

Integration with your favourite tools

NDepend fully integrates with Visual Studio and Reflector.

NDepend Options Integration

NDepend Options Integration

The integration in Reflector – which reflect that of Visual Studio integration.

NDepend Reflector Integration

NDepend Reflector Integration

Gives you one click access to some common metrics.

Conclusion

If you want to get a good understanding of your project – or someone elses, metrics will help you greatly to give you an impression of the health of the project and NDepend will come in quite handy for you. We only _barely_ scratched the surface with this blog post, I’ve spent a good chuck of a week using NDepend and find it ubber useful in my work life – partly because it involves reparing the mess others have left – but it also serves as a good reminder of how you should write code.

References

Fine Print: Full Disclosure

I was offered a license to NDepend by Patrick Smacchia and given the chance to write my thoughts on this product, I was not paid to review this product – feel free to send some moola if you want to though ;-)

{lang: 'en-GB'}
Share

Cheatings OK: (X) HTML Elements Best Practices

April 28th, 2009 1 comment

Came across a cool little gem, a (X)HTML Elements Best Practices Guide by Keryx which also has a Pdf version.

{lang: 'en-GB'}
Share

COOL: wotnews.com.au, Search, scrape and analyses news for you!

April 21st, 2009 2 comments
wotnews Logo

wotnews Logo

Got told by a co-worker about this today, a news site that searches, scrapes and analyses news items for you. wotnews.com.au, even has a Google Alerts style notification system to get told when interesting news items trickle through. Whats really impressive about this little beauty is that its written by a very small team and is packed with functionality.

Say we want to know more about the Sun being acquired by Oracle item from yesterday, query it. You’ll get a bunch of highlights for the month regarding the two keywords, and the latest articles aggregated over the internet. It even has Twitter integration to findout the latest goss.

While it seems to be still in its infancy, this web-application (and the AI behind it) will surely improve over time bringing some very interesting utilities for gathering news. Who needs Digg.com now apart from the memes and references to PedoBear?

The web framework behind it I was told is Django (which I’ve toyed around with) and the front-end makes heavy use of CSS Sprites as seen on this graphic.

Learn about CSS Sprites

You can learn more about CSS Sprites via these links:

Funky!

{lang: 'en-GB'}
Share

TortoiseSVN 1.6.1 Released

April 13th, 2009 No comments

TortoiseSVN 1.6.1 is out with several changes & fixes linked with Subversion 1.6.1.

Download:

Whilst on the subject of all things Subversion, have you seen the Subversion v1.6 Quick Reference Card? Enjoy. Waiting for a VisualSVN 1.7.1 update anytime soon.

{lang: 'en-GB'}
Share

Windows 7 Beta SDK and .NET Interop Samples Posted

April 2nd, 2009 No comments

The Windows Tean blog‘s Developers blog has a run down of the .NET Interop Samples for Windows 7. Make sure you install the Windows 7 Beta SDK and grab the samples.

I have yet to play with them :( But the Windows 7 Builds are running awesomely on my Dell M1330.

{lang: 'en-GB'}
Share

Bootilicious: MvcContrib 1.0 out

March 28th, 2009 No comments

Quick note that MvcContrib 1.0 is out! A perfect companion for ASP.NET MVC with some damn useful extensions to help you.

{lang: 'en-GB'}
Share

Thought of the week: Administrators, Developers & Friends.

October 20th, 2008 No comments

Here’s something to keep in mind the next time you see your administrator at work.

Keep your friends close, but your admins closer.

With that, something for the developers of the world.

Yes, we all need to be hugged sometimes but these days developers need it more than anyone else (well aside from Administrators).

Go on, go into that dark room that people barely visit and hug a developer today. You’ll bring a smile to their faces, turn their frowns upside down and who knows they may actually help you the next time your stuck  instead of asking you whether you’ve tried turning it off and on again like those pesky admin types who usually just sit there playing solitaire all day (or so the story goes).

But you know what, on your way up back to your 15th floor desk, why not give the Admins a little shout out and see what they’re doing too. Who knows, maybe next time they’ll make one for the less fortunate Administrators of the world.

{lang: 'en-GB'}
Share