Programmers Weekly Newsletter
Programmers Weekly Newsletter

Top new questions this week:

Why would you not use the 'using' directive in C#?

The existing coding standards on a large C# project includes a rule that all type names be fully qualified, forbidding employment of the 'using' directive. So, rather than the familiar: using ...

c# coding-standards  
asked by Jim Mischel 44 votes
answered by GlenH7 48 votes

How do I test a system where the objects are difficult to mock?

I am working with the following system: Network Data Feed -> Third Party Nio Library -> My Objects via adapter pattern We recently had an issue where I updated the version of the library I ...

testing object-oriented-design development-process mocking adapter  
asked by durron597 31 votes
answered by svidgen 21 votes

Does C# 6.0's new null-conditional operator go against the Law of Demeter?

The Law of Demeter states the following: Each unit should have only limited knowledge about other units: only units "closely" related to the current unit. Each unit should only talk to its friends; ...

c# design-patterns object-oriented-design  
asked by Arthur Rizzo 25 votes
answered by GlenH7 39 votes

Iterator pattern - why is it important to not expose the internal representation?

I am reading C# Design Pattern Essentials. I'm currently reading about the iterator pattern. I fully understand how to implement, but I don't understand the importance or see a use case. In the book ...

design-patterns iterator  
asked by MyDaftQuestions 20 votes
answered by Kilian Foth 45 votes

Should UDP data payloads include a CRC?

For a company I used to work for, I had to implement a socket receiver that mostly took data in UDP form over a local connection from some specialized sensor hardware. The data in question was a ...

security networking  
asked by Motig 8 votes
answered by Philipp 15 votes

How do I balance 100 clients checking the same database table in a loop?

What I have This is a prototype. I have a pool of 100 clients connected to the server via websockets reporting things and awaiting for commands. The server polls the commands database table of type ...

database node.js sockets websockets polling  
asked by The Sexiest Man in Jamaica 5 votes
answered by gbjbaanb 2 votes

Do I violate the Single Responsibility Principle with my multi-purpose AST Class?

I am writing a compiler, for which I devised a rather classic architecture: it's composed of sequential passes piped together, starting with a lexer and a parser, continuing with a macro processor, ...

object-oriented architecture single-responsibility  
asked by H2CO3 4 votes
answered by DeadMG 4 votes

Greatest hits from previous weeks:

What does the Spring framework do? Should I use it? Why or why not?

So, I'm starting a brand-new project in Java, and am considering using Spring. Why am I considering Spring? Because lots of people tell me I should use Spring! Seriously, any time I've tried to get ...

java frameworks dependency-injection spring  
asked by sangfroid 133 votes
answered by Darien 53 votes

Is testable code better code?

I'm attempting to get into the habit of writing unit tests regularly with my code, but I've read that first it's important to write testable code. This question touches on SOLID principles of writing ...

design unit-testing testing tdd  
asked by WannabeCoder 82 votes
answered by gbjbaanb 104 votes

Can you answer these?

What is the difference between "kk" and "HH"+1 in ISO-8601?

In the ISO-8601 there are multiple hour formats, one of them is "kk" for hours 1-24. What is the purpose of this? Are there countries that offset their time? Is it for military usages? The ...

java date-format  
asked by Creperum 1 vote

How to distribute the number of elements in a bucket so that it is Within a Range - Algorithm

I have been solving a problem where in say I have 50 elements n1, n2, n3, ... , n50 Now I have a limited number of buckets, say 5 buckets and the bucket can hold a range from , say 100 to 150 only ...

java algorithms optimization  
asked by Argho Chatterjee 1 vote

Mechanism for showing AAD usernames to other users?

I have a multi-tenant web application that authenticates against Azure Active Directory and allows users to modify content. What is the appropriate way for me to display the name of the last person ...

azure active-directory  
asked by Matthew Haugen 1 vote
Subscribe to more Stack Exchange newsletters

Unsubscribe from this newsletter or change your email preferences by visiting your subscriptions page on

Questions? Comments? Let us know on our feedback site. If you no longer want to receive mail from Stack Exchange, unsubscribe from all emails.

Stack Exchange, Inc. 110 William St, 28th Floor, NY NY 10038 <3