All posts by sethm

How Not Using Stack Overflow Solves All of My Problems

[OfficeWriter developer and Stack Overflow user, Seth, lets us in on the thought process and psychology behind Stack Overflow, by delving into one way he uses the online community to answer his programming questions. Anything sound familiar? Or relatable? Do you use Stack Overflow in a similar fashion? Let us know in the comments section.]

stackoverflow_post_seth

Stack Overflow is a question and answer site for professional and ardent programmers. It’s a part of the Stack Exchange network of Q&A sites. Their aim is to assemble a resource of quality answers to any and all questions pertaining to programming.

There are a lot of great things about Stack Overflow:

  • It’s free.
  • The point system incentivizes people to help others.
  • The best answers have the highest visibility (usually).
  • There are experts and legendary programmers answering your questions.
  • It’s almost like a sport or competition for those answering questions.

But my favorite thing about StackOverflow is often overlooked: fear.

I can’t tell you how many times I have been so afraid that my question will get downvoted into oblivion that I end up finding the solution while writing it. (I’ll give you a hint: it’s way more than the actual number of questions I’ve posted.)

You see, posting a question on SO is like a code review to the umpteenth power. You’re opening up, not only your code, but your thoughts, explanations, and questions to be scrutinized and judged by anyone in the world. And when you throw tags on your question, you’re basically begging people who know a lot about the subject to come and take their turn.

Also, an increasing number of companies list jobs on careers.stackoverflow, and even more companies have asked me if I have an SO profile…that’s pretty daunting. Companies may be looking at and analyzing my knowledge (or lack thereof) to determine if I’m worthy of their employment!

Not only are prospective employers trolling about there, but the people on SO are my peers. They may end up being co-workers of mine one day. I don’t want them to think I’m an idiot!

And let’s not forget about ego. I worked really hard to get my measly ~2,000 points. It may not seem like much when compared to the Jon Skeet’s of the world, but I answer a lot of questions and get no points, and the questions I ask are usually really domain-specific and never get upvotes. It took me years to get that many points! Because I worked hard for my points, Continue reading How Not Using Stack Overflow Solves All of My Problems

Released in OfficeWriter 8.6.1 – IEnumerable Feature

In OfficeWriter 8.6.1, we added a new feature that may have been flying under your radar, and I wanted to let you in on the story of how it came about.

When I first arrived at SoftArtisans I went through training of our entire product line.  As I was reviewing the training material, I came across the ExcelWriter Template section. I saw how to add data markers to my spreadsheet, and it seemed intuitive, so I went ahead and tried it:

ienumerable

At that moment, I was thinking “This is pretty slick. Now, I can just pass things into the spreadsheet!”  I’m not the greatest at reading documentation; I just like to learn by doing, so I opened Visual Studio and started writing code:


class Expense

{

double Amount { get; set; }

string Description = "";

bool Approved { get { return (Amount > 1000); } }

}

 

for (int i=0; i<1000; i++)

expenses.Add(new Expense(i));

 

Looking good so far.  What I did next, however, was my downfall:


ExcelTemplate xlt = new ExcelTemplate();

xlt.BindData(expenses);

Resources Every Performance Tester Should Know About

Performance is a widely overlooked feature in the development world. In enterprise development, better performance can correlate directly to company profit. More efficient programs utilize fewer resources; fewer resources cost less money.

On the consumer end, performance can make or break a product. One reason Google has such great market share is the speed at which they deliver their applications and data. The philosophy is pretty simple really: when users have to wait for something, they either get distracted (in which case they forget about you) or frustrated (in which case they’re mad at you).

The bottom line is performance matters. That’s why performance testing is vital to any product and company. I’ve outlined a few resources that I’ve found to be the most useful for performance testing below:

1. Steve Souders’ Blog

Steve Souders is the head performance engineer at Google and has literally written THE book on web performance. I’ve been on Steve’s RSS feed Continue reading Resources Every Performance Tester Should Know About

Best Practices for Performance Testing

Credit: tucowsinc.com

This week I set out to add performance testing to a project I’ve been working on. Why performance test? The main benefit is that we can hone in on when one of the changes we’ve made to a project has affected performance dramatically (such as memory usage, run-time, etc.). It gives us the ability to review performance historically and subsequently identify areas of improvement.

The catch with performance testing is that run-time can vary between runs, making it tricky to test. There are a couple ways to tackle this problem:

  1. The first of which is to run each performance test multiple times and average the results; then compare it to the previous run. This is the most accurate way to go about it, but not necessarily the most cost effective way to spend your time. For instance, if your performance tests take 30 minutes to complete and you need 10 runs to get a good average, that’s a 5 hour test.
  2. Alternatively, we can compare the results of a single test to previous runs and simply identify whether or not the test falls within a desired percent of our distribution. This doesn’t have quite the accuracy of the first approach, but if you don’t expect extreme performance changes it can be a viable option. The biggest downside to this approach is that you won’t necessarily detect deviations immediately.

Right now we don’t have the time to run each test multiple times, so we will be implementing our tests using the second method. For testing the run-time I created a simple function that takes a lambda expression as an argument, so usage would be something like this:

1 TimeExecution( () =>
2 {
3     DoWhatever();
4 };

The implementation ends up looking like this:

01 TimeExecution(Action action)
02 {
03     Stopwatch perfTimer = new Stopwatch();
04
05     perfTimer.Start();
06
07     action();
08
09     perfTimer.Stop();
10
11     _runtime = perfTimer.ElapsedMilliseconds;
12
13     // Store the time and assert failure
14 }

Continue reading Best Practices for Performance Testing