Programmers Weekly Newsletter
Programmers Weekly Newsletter

Top new questions this week:

How do I move away from the “for-loop” school of thought?

This is a rather conceptual question, but I was hoping I could get some good advice on this. A lot of the programming I do is with (NumPy) arrays; I often have to match items in two or more arrays …

python array loops thought-process  
asked by PPG 29 votes
answered by Gareth Rees 45 votes

Interface design where functions need to be called in a specific sequence

The task is to configure a piece of hardware within the device, according to some input specification. This should be achieved as follows: 1) Collect the configuration information. This can happen at …

c++ interfaces  
asked by Vorac 23 votes
answered by CashCow 45 votes

Why does void in C mean not void?

In strongly-typed languages like Java and C#, void (or Void) as a return type for a method seem to mean: This method doesn't return anything. Nothing. No return. You will not receive anything from …

java c# c  
asked by Naftuli Tzvi Kay 20 votes
answered by Snowman 46 votes

Multithreading: am I doing it wrong?

I'm working on an application that plays music. During playback, often things need to happen on separate threads because they need to happen simultaneously. For example, the notes of a chord need to …

multithreading  
asked by Prog 19 votes
answered by ptyx 42 votes

What is referential transparency?

I have seen that in imperative paradigms f(x)+f(x) might not be the same as: 2*f(x) But in a functional paradigm it should be the same. I have tried to implement both cases in Python and Scheme, …

functional-programming imperative-programming  
asked by asgard 19 votes
answered by Giorgio 39 votes

Is there a difference between fibers, coroutines and green threads and if that is so what is it?

Today I was reading several articles on the Internet about fibers, coroutines and green threads, and it seems like these concepts have very much in common, but there are slight differences, especially …

multithreading concurrency  
asked by DejanLekic 17 votes
answered by Robert Harvey 46 votes

Addressing the fact that primary keys are not part of your business domain

In almost all circumstances, primary keys are not a part of your business domain. Sure, you may have some important user-facing objects with unique indices (UserName for users or OrderNumber for …

architecture domain  
asked by tacos_tacos_tacos 14 votes
answered by Doc Brown 26 votes

Greatest hits from previous weeks:

When do you use float and when do you use double

Frequently in my programming experience I need to make a decision whether I should use float or double for my real numbers. Sometimes I go for float, sometimes I go for double, but really this feels …

c++ c  
asked by Jakub Zaverka 51 votes
answered by Bart van Ingen Schenau 55 votes

Why would Square inheriting from Rectangle be problematic if we override the SetWidth and SetHeight methods?

If a Square is a type of Rectangle, than why can't a Square inherit from a Rectangle? Or why is it a bad design? I have heard people say: If you made Square derive from Rectangle, then a Square …

object-oriented-design inheritance abstraction solid  
asked by user793468 73 votes
answered by Stephen 147 votes

Can you answer these?

Multithreaded Pre/Post Functions

I'm programming an application for an embedded device. We are using an RTOS that supports multi threading. The device is supposed to mimic an older project that was programmed in plain C (without …

c++ multithreading embedded  
asked by clambake 1 vote

How do I resolve $ref in a JSON object?

I have written a single page application that uses rest services to retrieve JSON objects. The JSON objects being returned are C# objects serialized using the Newtonsoft.JSON library. The returned …

c# json serialization  
asked by Cameron McKay 1 vote

Why should ViewModel route actions to Controller when using the MVCVM pattern?

When reading examples across the Internet (including the MSDN reference) I have found that code examples are all doing the following type of thing: public class FooViewModel : BaseViewModel { …

design design-patterns mvc object-oriented-design mvvm  
asked by Lea Hayes 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