Programmers Weekly Newsletter
Programmers Weekly Newsletter

Top new questions this week:

Leaving intentional bugs in code for testers to find

We don't do this at our firm, but one of my friends says that his project manager asked every dev to add intentional bugs just before the product goes to QA. This is how it works: Just before the ...

testing teamwork debugging bug  
asked by Krishnabhadra 134 votes
answered by James McLeod 231 votes

Is my boss's preference for Latin-1 over UTF-8 when it comes to database configuration justified?

We are using MySQL at the company I work for, and we build both client-facing and internal applications using Ruby on Rails. When I started working here, I ran into a problem what I had never ...

database mysql ruby-on-rails utf-8 ascii  
asked by Ravenstine 14 votes
answered by amon 49 votes

How does one keep argument counts low and still keep third party dependencies separate?

I use a third party library. They pass me a POJO that, for our intents and purposes, is probably implemented like this: public class OurData { private String foo; private String bar; private ...

java design third-party-libraries constructors  
asked by durron597 12 votes
answered by Erik 9 votes

Is this a good pattern: replacing a long function with a series of lambdas?

I recently run into the following situation. class A{ public: void calculate(T inputs); } Firstly, A represents an object in the physical world, which is a strong argument for not splitting the ...

c++11 lambda  
asked by Vorac 12 votes
answered by Cort Ammon 10 votes

Should I keep email addresses as plaintext in database?

It's clear to everyone (I hope) that storing passwords without at least salting/hashing them is a terrible idea. What about emails? Let's say you keep the subscription email address, if you encrypt ...

database security email  
asked by Pierre Arlaud 7 votes
answered by manlio 4 votes

Are there any benefits of using this extra variable in the for loop annotation?

I have found the following loop annotation in a big project I am working on (pseudocode): var someOtherArray = []; for (var i = 0, n = array.length; i < n; i++) { someOtherArray[i] = ...

programming-practices  
asked by Vlad Spreys 7 votes
answered by Jerry101 17 votes

Small code, big test

I have this code in a controller of an MVC implementation: public void execute() { try { String path = userSelectsFile(); if ( path == null ) return; //Just returns ...

java unit-testing  
asked by El Marce 5 votes
answered by Mike Nakis 3 votes

Greatest hits from previous weeks:

Why shouldn't I use the repository pattern with Entity Framework?

During a job interview, I was asked to explain why the repository pattern isn't a good pattern to work with ORMs like Entity Framework. Why is this the case?

asp.net-mvc unit-of-work  
asked by StringBuilder 45 votes
answered by Shyju 35 votes

Why is polling accepted in web programming?

I am currently working on a Ruby on Rails project which shows a list of images. A must-have for this project is that it shows new posts in realtime without the need of refreshing the web page. After ...

loops logic polling  
asked by dennis 93 votes
answered by ptyx 170 votes

Can you answer these?

Hard Coded File Paths - Solution?

Say you have an application that saves image(.jpg, .png etc) and text(.txt, .xml) files, and the application has all of the files paths hard coded throughout code, per the example below. Assuming the ...

database-design file-handling storage industry-standard  
asked by Elias 2 votes

Java MVC: multiple use of the same event for different actions

I am working on a large Java project which employs the model-view-controller pattern. Should I use a different event for each action (to let the views communicate with their respective controllers)? ...

java programming-practices mvc practical-application  
asked by ben 1 vote
Subscribe to more Stack Exchange newsletters


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

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

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