Sunday, March 31, 2013
#
Saturday, March 30, 2013
#
Nice presentation he had at google:
Wednesday, March 27, 2013
#
Thursday, February 28, 2013
#
Saturday, August 25, 2012
#
I like the following quote which I found on codinghorror:
[As Steve points out this is one key difference between junior and senior developers:]
In the old days, seeing too much code at once quite
frankly exceeded my complexity threshold, and when I had to work with
it I'd typically try to rewrite it or at least comment it heavily.
Today, however, I just slog through it without
complaining (much). When I have a specific goal in mind and a
complicated piece of code to write, I spend my time making it happen
rather than telling myself stories about it [in comments].
Saturday, June 2, 2012
#
Recently i found out that there is a thing called "coding dojo". The point behind it is that software developers want to have a space to
learn new stuff like processes, methods, coding details, languages, and
whatnot in an environment without stress. Just for fun. No competition.
No results required. No deadlines.
Some days ago I joined the Zurich coding dojo. We were three programmers with different backgrounds.
We gave ourselves the task to develop a method that takes an input
value and returns its prime factors. We did pair programming and every
few minutes we switched positions. We used test driven development. The
chosen programming language was Ruby.
I haven't really done TDD before. It was pretty interesting to see the algorithm develop following the testcases.
We started with the first test input=1 then developed the most
simple productive program that passed this very first test. Then we
added the next test input=2 and implemented the productive code. We kept
adding tests and made sure all tests are passed until we had the
general solution.
When we improved the performance of our code we saw the value of
the tests we wrote before. Of course our first performance improvement
broke several tests.
It was a very interesting experience to see how other developers
think and how they work. I will participate at the dojo again and can
warmly recommend it to anyone. There are coding dojos all over the
world.
Have fun!
Sunday, May 13, 2012
#
Here's a short tutorial on how to use log4net in C#
1. Get log4net from the
apache website.
2. Open your project with visual studio.
3.
Add the reference to your project: You find the reference in the zip
that you just downloaded: \bin\net\xxx\release\log4net.dll. xxx is your
.net version.
4. Add the
Appender section to your app.config. The following code uses a file for the logging:
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net"/>
</configSections>
<log4net>
<root>
<level value="DEBUG" />
<appender-ref ref="LogFileAppender" />
</root>
<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender" >
<param name="File" value="log-file.txt" />
<param name="AppendToFile" value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>
</log4net>
</configuration>
5. Use the following code to use the configuration you just added to app.config:
static void Main()
{
log4net.Config.XmlConfigurator.Configure();
...
6. To log use the following code:
using log4net;
...
private static readonly ILog log = LogManager.GetLogger(typeof(Bar));
log.Debug("this is the first log message");
...7. If Visual studio doesn't recognize log4net. Configure your project like this:
Visual Studio -> project -> project name properties -> target framework -> .net Framework (not client)