Code Review Weekly Newsletter

Code Review newsletter

Top new questions this week:

Checking if two numbers have the same sign

Is there a more elegant way than the following to check if two numbers have the same sign? bool sameSign(int num1, int num2) { if (num1 > 0 && num2 < 0) return ...

c# integer  
asked by John Demetriou 16 votes
answered by rolfl 45 votes

Searching for bad Minecraft questions on Gaming.SE

To preface this post a little bit, I'll explain a little bit of the "backstory" here. The Stack Exchange site, Gaming.SE, also known as Arqade, often has a large influx of bad questions about the ...

sql-server stackexchange t-sql  
asked by Ethan Bierlein 15 votes
answered by rolfl 13 votes

Algorithm to transform one word to another through valid words

I have been practicing backtracking and I wanted to know how I can improve my code. For eg, I don't want to use global. Also, have I am not sure if my code will work for all the cases. # Given two ...

python algorithm edit-distance backtracking  
asked by Pradeep Vairamani 12 votes
answered by Barry 8 votes

Printing large numbers, or not large but LARGE

I just started learning Java about a month ago. I'm wondering, what would an experienced developer do differently in the code below? As I learn to code, what direction should I be pushing myself? I ...

java beginner ascii-art  
asked by Heath 12 votes
answered by rolfl 8 votes

Interpreting Brainfuck code to C#, then compiling to a .exe

This is a C# programme to convert Brainfuck to C#, then convert that C# to a .exe. So basically, it's a Brainfuck to Windows exe file converter/compiler. This requires any of: .NET 2.0 in ...

c# brainfuck compiler  
asked by EBrown 11 votes
answered by TopinFrassi 9 votes

Comparing two lists

I am getting two different lists of members, then if certain conditions meet, I add more members to the list before converting into an array. Is there any way this could be improve? I guess we can ...

c#  
asked by Please Teach 11 votes
answered by Jeroen Vannevel 10 votes

Check if more engineers are happy than not happy

I wish to use this sample to make my code more readable. Could you share with me your ideas on method naming, variable naming, if-statements etc. It would be great if you have any URLs. private ...

java  
asked by yarix 10 votes
answered by mdfst13 27 votes

Greatest hits from previous weeks:

Swift 1.2 Singleton Implementation

I am pretty new to Swift, as a solo developer I was wondering if somebody could pass comments on the singleton implementation below. The code does work, but being new to Swift and knowing that there ...

beginner ios singleton swift  
asked by fuzzygoat 26 votes
answered by Rhuantavan 19 votes

Convert object array to hash map using lodash

The use case is to convert an array of objects into a hash map where one property is the key and the other property is the value. Common case of using this is converting a "link" object in a ...

javascript beginner underscore.js lodash.js  
asked by Pete 7 votes
answered by Jon Anderson 25 votes

Can you answer these?

Return React child component based on current state

I am trying to build a multi page form widget with React for a website inspired by this. Since quite some time has passed since I last touched JavaScript, I'm directly adapting to ES6/7 and tried to ...

javascript react.js ecmascript-6  
asked by Marian 1 vote

Simultaneous confidence interval

I recently read an article in which the authors present Algorithm 1 to compute a simultaneous confidence interval. I was interested in implementing Algorithm 1 in R here. The algorithm is freely ...

r statistics  
asked by 3209Cigs 1 vote

Copying csv to sql_table

I wrote code that takes csv and export it to sql table. It looks like this: def import_to_temp_table(table_name, filepath) headers_with_type = headers_for_temp_table.map { |x| x + ' text' ...

ruby sql ruby-on-rails active-record  
asked by Mateusz UrbaƄski 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