Code Review Weekly Newsletter

Code Review newsletter

Top new questions this week:

My Blackjack game

I am not happy with this code as I am sure there are better ways to do what I'm trying to achieve. I'm a beginner and I've used what I know to date to complete this. import java.util.Random; import …

java beginner game playing-cards  
asked by NiallSzalkai 13 votes
answered by Jivings 13 votes

Quadratic expression calculator

I'm hoping to get some feedback on how to improve and optimise a program I wrote which takes three values as input (via the terminal) and uses them in the quadratic formula. I'm aware this is mostly …

java beginner mathematics  
asked by Andrew 12 votes
answered by Vogel612 12 votes

Is my AI solution to Untrusted Game considered logical or "ethical"?

I am applying to a university to study Computational Linguistics, and as I read, it would be recommended to have a background in Artificial Intelligence. The Admission board asked me to prepare a …

javascript game interview-questions pathfinding ai  
asked by SAFAD 11 votes
answered by Tneuktippa 11 votes

Logical Sudoku Solver in Java

I've been working on a Sudoku solver as an introduction to the Java programming language. I know there's a bunch of ways to program a Sudoku solver, including a brute force/recursive approach and a …

java beginner sudoku  
asked by AdmiralAdama 11 votes
answered by toto2 10 votes

Prime Number Generator - Are the conventions proper?

I am slowly learning C and C++, and decided after a few lessons to dive in myself without any help. I developed this Prime Number generator. It seems fast, but I'm wondering if I'm following the best …

c++ best-practice beginner primes  
asked by Canadian Luke 11 votes
answered by janos 16 votes

Java enum containing a hash map for look up

I have the below enum. I need to get the description by code. It is working but can it be improved still? public enum Maps { COLOR_RED("ABC", "abc description"); private final String code; …

java enum  
asked by user755806 11 votes
answered by Simon André Forsberg 14 votes

Class for handling unit conversions

I am creating a class to be the end all defacto class for handling unit conversions. This is particularly difficult in my company's industry where imperial architectural strings are used as units. I …

c# strings readability converting  
asked by jth41 10 votes
answered by Jerry Coffin 7 votes

Greatest hits from previous weeks:

Implementation of Heap Sort

Is this the correct implementation of Heap Sort using Java? How can it be improved further? import java.util.Arrays; public class HeapSort { public static int heapSize; public static int LEFT(int …

java sorting heap  
asked by n1234 3 votes
answered by 200_success 3 votes

Getting current time with milliseconds

I am looking for a more efficient or shorter way to achieve the following output using the following code: timeval curTime; gettimeofday(&curTime, NULL); int milli = curTime.tv_usec / 1000; …

c++ datetime  
asked by Meysam 1 vote
answered by saeedn 2 votes

Can you answer these?

Testing async API calls using Jasmine 2.0

I'm upgrading my project from YouTube's V2 API to their V3 API. I'm also taking the time to upgrade to Jasmine 2.0 since I already need to look at my test cases. Here's a couple of test cases and the …

javascript unit-testing jasmine  
asked by Sean Anderson 3 votes

BBCode to HTML converter using functional programming

I was inspired to write a BBCode to HTML converter as I'm currently learning functional programming. I wanted achieve functional cohesion. jsFiddle I'd like feedback on: How to structure functional …

javascript functional-programming  
asked by mister_rampage 3 votes

Is it correct to extend a bean class and write a class which holds logic to populate the bean we extend

I need to extract some metrics from ManagedBeans and store the collected metrics in an object bean. The object bean is defined with member variables to hold the metrics. In this case, is it right to …

java design-patterns  
asked by krishna 3 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