Programmers Weekly Newsletter
Programmers Weekly Newsletter

Top new questions this week:

When should I extend a Java Swing class?

My current understanding of Inheritance implementation is that one should only extend a class if an IS-A relation is present. If the parent class can further have more specific child types with ...

java object-oriented programming-practices inheritance  
asked by Paras D Pain 30 votes
answered by DeadMG 49 votes

What do you call a function that's pure, meaning the same input will always return the same output, but also has side effects?

Say we have a normal pure function such as function add(a, b) { return a + b } And then we alter it such that it has a side effect function add(a, b) { writeToDatabase(Math.random()) return ...

functional-programming side-effect pure-function  
asked by AR7 28 votes
answered by Andres F. 65 votes

Why would a type be coupled with its builder?

I've recently deleted a java answer of mine on Code Review, that started like this: private Person(PersonBuilder builder) { Stop. Red flag. A PersonBuilder would build a Person; it knows about ...

java design-patterns coupling builder-pattern  
asked by Mat's Mug 15 votes
answered by Jeff Bowman 18 votes

Does a `long` ban make sense?

In today's cross-platform C++ (or C) world we have: Data model | short | int | long | long long | pointers/size_t | Sample operating systems ... LLP64/IL32P64 16 32 32 64 ...

c++ coding-standards data-types 64-bit  
asked by Martin Ba 14 votes
answered by Snowman 23 votes

Supporting development for older OS

I am maintaining a large portion of legacy code, written in C. This code was initially written to be comiled against Windows 3 for Workgroups, and later a version for NT was created. This legacy ...

c windows legacy  
asked by Richard Eriksson 11 votes
answered by gbjbaanb 4 votes

Licensing on Github

I'm uploading to GitHub for the first time and I am facing all sort of doubts about licensing. I did not know that topic was that uncovered in the net! But even it is complex, my situation is so ...

licensing gpl github  
asked by Whimusical 9 votes
answered by Thomas Owens 11 votes

Is it still valid to speak about anemic model in the context of functional programming?

Most of DDD tactical design patterns belong to object-oriented paradigm, and anemic model describes the situation when all business logic is put into services rather than objects thus making them a ...

functional-programming domain-driven-design  
asked by voroninp 8 votes
answered by Jack 6 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 floating-point numbers  
asked by Jakub Zaverka 127 votes
answered by Bart van Ingen Schenau 128 votes

Can the "level 256 bug" in the game of Pacman be considered an unhandled segfault?

I am trying to explain segmentation faults to someone, and I was thinking about the level 256 kill-screen in Pacman, and how it's triggered by integer overflow, and how similar the behavior is to the ...

memory errors  
asked by Braden Best 50 votes
answered by Kilian Foth 112 votes

Can you answer these?

Drawing sequence diagram for user-forget-password functionality

I'm trying to draw a sequence diagram of the functionality of user retrieving their password when they forget it and its procedure could be illustrated in this activity diagram. As you can see, ...

design uml requirements sequence-diagram  
asked by Ivan 1 vote

Unit testing C code?

I learnt about the check testing framework today that seems good. This far I've scripted tests that uses valgrind so that the tests both display output from the tests and from valgrind. Is there a ...

unit-testing c scripting shell  
asked by Programmer 400 1 vote

PHP MVC/PAC - Logged In/Admin checks placement

I have set-up a MVC/PAC-like structure for a web application (unsure if it fits any of these design patterns fully). In short it is: Routing in index.php, which selects the controller and method ...

web-development web-applications mvc mvp pac  
asked by kgongonowdoe 4 votes
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