Code Review Weekly Newsletter

Code Review newsletter

Top new questions this week:

Conway's Game of Life in C++

This is my attempt at Conway's Game of Life. It works, and it's the most complicated program I've made to date. I'm sure it's pretty poorly done. Any ideas on how I can improve on it? #include …

c++ game-of-life  
asked by Twooey 25 votes
answered by Kordalien 40 votes

Why does caching of string objects perform faster?

I'm trying to implement String-Pool. I'm maintaining a HashMap<String,String> to store the keys. public class TestStringCaching { static Map < String, String > cache = new HashMap …

java strings cache reinventing-the-wheel  
asked by srikanth 14 votes
answered by 200_success 13 votes

C Makefile boilerplate

This is the current Makefile that I use with my C projects. Here is what I would like to be reviewed: Reusability - is this Makefile easy to use for multiple separate projects with minimal …

c code-organization makefile code-reuse  
asked by syb0rg 12 votes
answered by Loki Astari 9 votes

Temperature Interpolation

I want to interpolate temperature in correlation with height. I have temperature data from stations with coordinates and height in this format: Lat Lon Temp Height 46.2956 16.3978 …

python performance mathematics numpy geospatial  
asked by nrasic 12 votes
answered by amon 7 votes

Enum with getting subset

I just wrote this but I'm not sure if this is good practice. Can someone give me advice as to whether it's good or how I can do better or even it's bad code? The point is that I need a sub …

java enum  
asked by chillworld 11 votes
answered by 200_success 8 votes

What would be preferred aesthetically and performance wise?

Which one of these two would you prefer writing in your code? This: tweet = tweet.replaceAll("@\\w+|#\\w+|\\bRT\\b", ""); tweet = tweet.replaceAll("\n", " "); tweet = …

java performance strings regex  
asked by Sillicon Touch 11 votes
answered by skiwi 14 votes

Trading Card Game's Hand class and tests

As part of a Trading Card Game, I have created a Hand that will need to hold all cards that a player currently has in his hand. The code is built using Java 8. The structure is the following: Class …

java game unit-testing code-challenge  
asked by skiwi 11 votes
answered by palacsint 6 votes

Greatest hits from previous weeks:

Finding repeating numbers in an array

I want to search through an array of n numbers and find the numbers that are repeated. So far I have this code, which does the job, but I find it to be a rather cumbersome method, but I can't seem to …

java homework interview-questions sorting search  
asked by Hatori Sanso 13 votes
answered by Phil K 11 votes

Caesar Cipher program in C

I'm a beginner-intermediate C++ programmer, and I never used or understood C input & validation. I just always used C++ streams. Anyway, I just want code critique, as I have never used the C …

c beginner caesar-cipher  
asked by FurryHead 8 votes
answered by asveikau 6 votes

Can you answer these?

Which one of these both run-length decoding algorithm is the most optimal?

I'm working out on Ocaml.org 99 problems, and I solved the run-length decode one. Here is the solution given by the site: let decode l = let rec many acc n x = if n = 0 then acc …

functional-programming ocaml compression  
asked by codablank1 1 vote

A simple Thread Pool

A very simple Thread pool: Any work added to the pool will be executed. The destructor will wait for all work to be finished before letting the threads stop. We then join all threads before letting …

c++ multithreading  
asked by Loki Astari 6 votes

Improving a system calculator application

I want to make sure that the code is correct in terms of its design, code correctness, best practices & Junit testing. The complete description is given below: **Functioning of the app quickly …

java design-patterns clean-code unit-testing  
asked by fscore 2 votes
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