Skip navigation
Help

Stack Exchange

warning: Creating default object from empty value in /var/www/vhosts/sayforward.com/subdomains/recorder/httpdocs/modules/taxonomy/taxonomy.pages.inc on line 33.
Original author: 
Stack Exchange

Stack Exchange

This Q&A is part of a weekly series of posts highlighting common questions encountered by technophiles and answered by users at Stack Exchange, a free, community-powered network of 100+ Q&A sites.

Stack Exchange user and C# developer George Powell tries hard to follow the DRY principle. But as any good dev knows, it's not always possible, or even optimal, to stay original. Powell writes:

Often I write small methods (maybe 10 to 15 lines of code) that need to be reused across two projects that can't reference each other. The method might be something to do with networking / strings / MVVM etc. and is a generally useful method not specific to the project it originally sits in.

So how should you track shared snippets across projects so you know where your canonical code resides and know where it's in production when a bug needs to be fixed?

Read 15 remaining paragraphs | Comments

0
Your rating: None
Original author: 
Stack Exchange

Stack Exchange

This Q&A is part of a weekly series of posts highlighting common questions encountered by technophiles and answered by users at Stack Exchange, a free, community-powered network of 100+ Q&A sites.

Java developer Stijn Geukens is working with 10 developers, and nearly every dev has his own style. That's about to change, as the company may soon impose a standard code format upon all developers. They'll be using Eclipse to help facilitate the change. But is forcing consistency upon the team more trouble than it's worth? See the original question here.

How professional

ZeroOne answers (39 votes):

Read 13 remaining paragraphs | Comments

0
Your rating: None
Original author: 
Stack Exchange

Stack Exchange

This Q&A is part of a weekly series of posts highlighting common questions encountered by technophiles and answered by users at Stack Exchange, a free, community-powered network of 100+ Q&A sites.

Chris Devereaux has recently been reading up on "Literate Programming," an innovative (and mostly unused) approach to programming developed by Donald Knuth in the 1970s. It got him thinking about new ways of implementing tests. "Well-written tests, especially BDD-style specs, can do a better job of explaining what code does than prose does," he writes in his question. Also, tests "have the big advantage of verifying their own accuracy." Still, Chris has never seen tests written inline with the code they test. Why not?

See the original question here.

Read 21 remaining paragraphs | Comments

0
Your rating: None
Original author: 
Stack Exchange

Stack Exchange

This Q&A is part of a weekly series of posts highlighting common questions encountered by technophiles and answered by users at Stack Exchange, a free, community-powered network of 100+ Q&A sites.

It's a response often encountered during technical interviews: "OK, you solved the problem with a while loop, now do it with recursion." Or vice versa. Stack Exchange user Shivan Dragon has encountered the problem and he knows how to answer: show that you're able to code both ways. Give the interviewer what he wants. But which method is generally preferable? A few more experienced programmers respond.

See the original question here.

Read 19 remaining paragraphs | Comments

0
Your rating: None

Stack Exchange

This Q&A is part of a weekly series of posts highlighting common questions encountered by technophiles and answered by users at Stack Exchange, a free, community-powered network of 80+ Q&A sites.

kojiro Asks:

I'm asked to perform or sit in during many technical interviews. We ask logic questions and simple programming problems that the interviewee is expected to be able to solve on paper. (I would rather they have access to a keyboard, but that is a problem for another time.) Sometimes I sense that people know how to approach a problem, but they are hung up by nervousness or some second-guessing of the question.

Read 18 remaining paragraphs | Comments

0
Your rating: None

The Stack Exchange

This Q&A is part of a biweekly series of posts highlighting common questions encountered by technophiles and answered by users at Stack Exchange, a free, community-powered network of 80+ Q&A sites.

Robert Harvey asks:

Occasionally I see questions about edge cases on Stack Overflow that are easily answered by the likes of Jon Skeet or Eric Lippert—experts who demonstrate a deep knowledge of a particular language and its many intricacies. Here's an example of this from Lippert's MSDN blog:

You might think that in order to use a foreach loop, the collection you are iterating over must implement IEnumerable or IEnumerable. But as it turns out, that is not actually a requirement. What is required is that the type of the collection must have a public method called GetEnumerator, and that must return some type that has a public property getter called Current and a public method MoveNext that returns a bool. If the compiler can determine that all of those requirements are met then the code is generated to use those methods. Only if those requirements are not met do we check to see if the object implements IEnumerable or IEnumerable.

Read more | Comments

0
Your rating: None