General Technical Ramblings, and a smattering of Enterprise C# RSS 2.0
# Wednesday, July 02, 2008
Visual studio (and its related tools) tends to leave a lot of temp files around. Mostly this is not a problem, however every now and again they are a nuisance:
  • When you want to distribute your source code
  • When you want to add the code to external source control (SubVersion)
  • When you need the free space
  • When you need to archive the project
The basic rules for clean-up are:
  • All directories (recursive): obj/*
  • All directories (recursive): bin/*
  • All directories (recursive): TestResults/*
  • All files: *.sou
  • All files: *.resharper
  • All files: *.resharper.user
  • All files: *.gpState
Oh, and I have been playing with WPF (Windows Presentation Foundation), which required .NET version 3.5.



If you can think of any new rules, or you want the code, just let me know...
VisualStudioProjectCleaner1.exe (20.5 KB)
Wednesday, July 02, 2008 7:48:44 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
General | Utility | Visual Studio
# Friday, June 13, 2008
Here are a list of cute things to be found in the world of software development:

Friday, June 13, 2008 3:47:50 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
General | Software Engineering
# Tuesday, June 10, 2008
From Slashdot: "jexrand recommends an interview with John De Goes in which he argues: "The tools market is dead. Open source killed it." The software developer turned president of N-BRAIN explains the effect that open source has had on the developer tools market, and how this forced the company to release the personal edition of UNA free of charge. According to De Goes, selling a source-code editor, even a very good one, is all but impossible in the post-open source era, especially given that, "Some developers would rather quit their job than be forced to use a new editor or IDE." N-BRAIN's decision is but one in a string of similar announcements from tools companies announcing the free release of their previously commercial development tools."

Open-source is here to stay, and it is going to change the business model for a great many products. I regularly uses tools from both sides (NUnit, NCover, Reflector) and (Resharper). Both open source and commercial product have to be innovative -- but they tend to innovate in differenet ways and for different reasons.

Tuesday, June 10, 2008 9:56:08 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
General
# Saturday, June 07, 2008
Simple string <-> 3DES encryption sample:
public string Encode(string Key, string PlainText)
    {
        TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();

        //mode of operation. there are other 4 modes. We choose ECB(Electronic code Book)
        tdes.Key = GenerateKey(Key);

        //padding mode(if any extra byte added)
        tdes.Mode = CipherMode.ECB;
        tdes.Padding = PaddingMode.PKCS7;

        //transform the specified region of bytes array to resultArray
        ICryptoTransform cTransform = tdes.CreateEncryptor();

        byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(PlainText);
        byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
        //Release resources held by TripleDes Encryptor

        tdes.Clear();
        //Return the encrypted data into unreadable string format

        return Convert.ToBase64String(resultArray, 0, resultArray.Length);
    }

    public string Decode(string Key, string CypherText)
    {
        TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
        //set the secret key for the tripleDES algorithm

        tdes.Key = GenerateKey(Key);
        //mode of operation. there are other 4 modes. We choose ECB(Electronic code Book)

        byte[] toEncryptArray = Convert.FromBase64String(CypherText);

        tdes.Mode = CipherMode.ECB;
        //padding mode(if any extra byte added)

        tdes.Padding = PaddingMode.PKCS7;

        ICryptoTransform cTransform = tdes.CreateDecryptor();
        byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
        //Release resources held by TripleDes Encryptor                

        tdes.Clear();
        //return the Clear decrypted TEXT

        return UTF8Encoding.UTF8.GetString(resultArray);
    }

Saturday, June 07, 2008 7:41:53 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Code Snippet
I decided to move from PHP to ASP.NET and dasBlog. After a little configuration, we are up and running again... And it was easy too. However, I have a couple years of blog history to port across. Hmm, this might not be so quick...

Saturday, June 07, 2008 7:19:07 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
General
# Thursday, May 01, 2008
General Links on topic (Development, Software, Web, Tech):

Thursday, May 01, 2008 4:31:08 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
General
# Saturday, October 15, 2005
Introduction
ReSharper is a .NET IDE plug-in to give more sophisticated editing, navigation, refactoring, and code generations. Link
Refactoring Definition:
"Refactoring is the exercise of taking functional code, and while not increasing its functionality, increasing its quality" -- Debugging is therefore the act of altering the code to fix a specific bug, while not intrinsically increasing the quality of the code around it.

Oh, ReSharper, how do I love thee, let me count the ways:

Refactoring should be a key skill of a software engineer. Once formal conception design is complete, there are always grey-areas or bad implementations to correct, or continuous improvement opportunities as we get a more complete understanding of how the software should be constructed. The key concept, or rather precept, in refactoring is quality. To understand refactoring we therefore need to understand code quality (See article What is quality code?).

Mantra's :-}
1st Mantra Of Refactoring:
If you are reading code, you should be planning how to refactor it.


2nd Mantra Of Refactoring:
Compiler-refactors, or automation-assisted refactors are King.

3rd Mantra Of Refactoring:
The single bane of refactoring is the introduced error.


3rd Mantras Corollary:
Unit tests and Refactoring is a match made in Heaven.


4th Mantra Of Refactoring:
If a bug is logged against a class, that class should be refactored.


Books
Refactoring is well covered as a key discipline/skill in print:
Refactoring: Improving the Design of Existing Code
Refactoring to Patterns Design Patterns: Elements of Reusable Object-Oriented Software
(Gang-Of-Four book!)

Rules Of Thumb:
- Refectoring should be explicitly listed on the project work breakdown.
- Refactoring should account for 10-30% of the effort during the construction and maintenance phases.
- Large-scale (non-compiler/automated) refactoring candidates should be listed, and then planned for project deadtime.
- Refactoring should be used as the key principal in Code Review sessions, altering code to discuss ideas and better quality implementations.
- All developers should engage in refactoring work this includes Architects, Leads, Senior and Junior developers.
- In general, a refactor that reduces total amount code, is normally successfull.
- The first tool of basic refactoring is the 'helper method'.

As my mentor (Anthony Steele) once said "Forget about OO, must people don't understand procedural programming"... Meaning, that most developers do not leverage the power of basic procedural programming to reduce or hide complexity. - Refactoring should, in general, reduce the 'contract' the code has with the outside world. That is to say, a piece of code, or a class, or a method, should expose the smallest amount of complexity to the outside world.

Refactoring is a team skill

Refactoring is a colaborative dialogue -- if the team is constanly refactoring, but without cohesion the results will reflect this, the code will be a patchwork of divergent ideas. In my code world view consistency is more important the correctness(within bounds of reason). It is better to all do the wrong thing the same way, that to sometimes to the right thing in many diferent ways. If you have exprience in larger project with more than one strong personality -- you will recognise the truth of it. In part this is true, because you can organise a large-scale refactor of a first case (consistently wrong), but not the second case (partially right).

Back to the key point: Refactoring is a colaborative dialogue. The team should be constantly discussing posibilities for refactoring, in the short, medium and long term. Easy, medium and extreme refactors. The ongoing refactoring dialog has many advantages:
- It keeps things fun and interresting
- It serves to establish a common lingo/terminology and common design patterns (and anti-patterns!)
- It introduces new ideas for design and implementation, and provides a basis for evaluating them (What would the new refactor give us? What is the cost? What is the Risk?).

Evaluating a Refactor
In very time terms, before we start a refactor we always ask the same questions:
1. What would the new refactor give us? This is the expected code quality increase. We evaluate the current and future benefits.
2. What is the cost? Essentially, man hours; but also includes the effort needed to motivated the required time from management and the rest of the team. It is important to include the oppurtunity cost of more features/functionalty what could have been implemented.
3. What is the risk? Knock-on bugs!
Saturday, October 15, 2005 4:11:57 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
General | Software Engineering
# Tuesday, August 31, 2004
Topics: Emergence, Computer, Evolution.

 The game has a *very* simple set of laws, from these laws amazing amounts of complexity can be generated -- and not just noise. Life can be used to create a computer within itself, which may in turn be used to create a computer within itself, which may be used in turn...
Introduction
Advanced
The Holy Grail - The Life Universal Turing Machine
Image
Space Ships :-}
Tuesday, August 31, 2004 3:58:54 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -

# Wednesday, August 18, 2004
Software Engineering and Architecture has, in my opinion, the following prerequisite's:
- UML - <a href="http://www-306.ibm.com/software/rational/uml/">Unified Modeling Language</a>
- RUP - <a href="http://www-306.ibm.com/software/awdtools/rup/">Rational Unified Process</a>
- XP -  <a href="http://www.extremeprogramming.org/">eXtreme Programming</a>
- OOP (given) - Object Oriented Programming
- Functional Programming (misunderstood)
- Design Patterns - <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0201633612/104-8900376-9931946?v=glance">Gang Of Four</a>
- CMM - <a href="http://www.sei.cmu.edu/cmmi/">Capability Maturity Model</a> - A pragmatic approach to chart an organization's development ability in terms of its stability/ability to reproduce success/maturity/development process. Most of the world sits at CMM-0, while Microsoft/IBM sit at CMM-4, and god sits at CMM-5.
- SOA - Service Oriented Architecture - The impact of web services, and automated services across organisational boundaries.
- AOP - Aspect Oriented Programming - <i> I don't know of a short, or cute way of explaining this -- which is a good cute to say that I do not understand it</i>
- Refactoring - To rework an existing chunk of code/design/architecture, in such a way as to increase it's elegance/speed/quality without increasing its functionality.

Pragmatics:
- Bi-Polar development world (Open Source & Java Soup vs. Microsoft Stack vs. The Old Stuff)

Concepts: "Tao or Philosophy of Software Engineering"
- Concept: Software Economics (Lack of Scarcity, Quality-Performance-Price triangle)
- Physical Law: Heisenberg's Uncertainty Principal
- Physical Law: 2nd Law of Thermodynamic
- Maths: Godels Proof: Deterministic World Flaw (Proof?)
- Physics: Occams Razor
- Concept: Emergence
- Maths: Chaos Theory and Emergence, as applied to Software Engineering
- Concept: Quality before Performance
- Science: Scientific Method, as applied to Software Engineering

I plan to return to these themes over time, and expand or explain the theme's theory and my personal philosophy of { Software Engineering, Software Architecture, hacking, etc }.

If I have missed anything, or you have additional information or pertinent links, please add them as comments.
Wednesday, August 18, 2004 3:57:05 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Software Engineering
Navigation
Archive
<November 2008>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Guy Langston
Sign In
Statistics
Total Posts: 12
This Year: 6
This Month: 0
This Week: 0
Comments: 0
Themes
Pick a theme:
All Content © 2008, Guy Langston
DasBlog theme 'Business' created by Christoph De Baene (delarou)