Code Review Weekly Newsletter

Code Review newsletter

Top new questions this week:

Nesting versus GOTO: which is better to avoid?

In Java they're not really known as GOTO statements and are rather referred to as Branching Statements, but I find that the former term is a bit more indicative of what they actually do. Regardless, …

java best-practice loop parsing style  
asked by Jeff Gohlke 37 votes
answered by Bobby 38 votes

Print an ASCII diamond

This takes a width specified by user and prints a diamond of that width. It uses only three for loops, but could I reduce that further? Is there a more elegant solution? public class Diamond { …

java loop console  
asked by tadamson 17 votes
answered by syb0rg 16 votes

Rational number arithmetic

I was assigned to make a Rational class to perform functions on fractions. After awhile I got it to work, but now I'm wondering how to simplify and clean up my code. Basically how to improve and use …

java classes  
asked by Jake 13 votes
answered by rolfl 17 votes

Tic-tac-toe 'get winner' algorithm

As a first step to attempting the Weekend Challenger Reboot, I decided to first implement a regular 'tic-tac-toe' game and then expand it later to be 'ultimate tic-tac-toe'. Below is the code for the …

java algorithm refactoring game code-challenge  
asked by Roddy of the Frozen Peas 12 votes
answered by Simon André Forsberg 9 votes

How can I improve this Caesar encryption?

I have the following method which encrypts a english text, given the plain text and the desired key: /// <summary> /// Encrypts english plain text using user defined key. Range for the …

c# caesar-cipher  
asked by bodycountPP 11 votes
answered by Nacimota 8 votes

First Scala FizzBuzz implementation

Would love some feedback on this. I'm coming from a Java background and kinda feel like I've just done exactly what I would do in Java. Is there a better way? for (i <- 1 to 100) { if ( i % 3 …

scala fizzbuzz  
asked by cookiemonster 10 votes
answered by Beyamor 15 votes

Simple Java calculator

I am a beginner in Java programming. Here is my simple calculator. I hope you could scan through my coding and let me know if there is any error in my coding or how I could simplify the code. import …

java beginner  
asked by Isaac 10 votes
answered by Vojta 10 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 10 votes
answered by Phil K 9 votes

Playfair Cipher in C++

I have been working on a Playfair Cipher in C++ for a final Project in a Cryptography class. I was hoping for some feedback on the project so far. I recently got a job programming before I've even …

c++ cryptography  
asked by Singularity222 3 votes
answered by avip 2 votes

Can you answer these?

System for inputting and monitoring worker shifts

I've been building a system for inputting and monitoring shifts for casual staff, who work across multiple sites with the ability to generate accounting information. I've had some help from Stack …

php mysql sql security  
asked by danielsmile 3 votes

Function launching default editor

I have written a function that launches the default editor set in git config, right now I have managed to get it working for Sublime, nano and Vim. def launchEditor(editor): """ this function …

python performance software-design git  
asked by san 4 votes

Avoiding RequireJS circular dependencies

My app module bootstraps a Backbone.js application. I need app to be available in every other view for easy access to router, triggering navigation, etc. I never ported an app to RequireJS before, …

javascript backbone.js modules requirejs  
asked by Dan Abramov 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