Code Review Stack Exchange Community Digest

Top new questions this week:

Levenshtein distance using dynamic programming in Python 3

I had to implement a function for getting the Levenshtein distance of two strings for a problem. It linked to the Wikipedia Article for Levenshtein distance and mentioned I can use the dynamic ...

python-3.x  
asked by Bilesh Ganguly 7 votes
answered by Zachary Vance 13 votes

Magic number game in Python

How can I shorten my code for this? There are 6 variable sets of numbers, someone picks a number between 1-63, if their number is in a set, you add the first number of the list to the magic number ...

python  
asked by maxwell7 7 votes
answered by hjpotter92 5 votes

Throw exception if value is not found

I want to create ENUM which maps different statuses: ...

java  
asked by Peter Penzov 6 votes
answered by Marc 14 votes

Left Shift/ Right Shift an array in C

I am trying to implement a Left shift/ Right Shift on arrays. I was able to accomplish this using double loops. Can the efficiency be improved? This is the working code for LeftShift/RightShift which ...

c++ c array iterator pointers  
asked by Vishnu 5 votes
answered by upkajdt 7 votes

Benchmarking data copying

I got inspired by a recent question to do some benchmarking on the different methods to copy data and this is what I have come up with: ...

c++ performance  
asked by upkajdt 5 votes
answered by G. Sliepen 11 votes

C++20 std::array implementation

I'd like to have a review on my C-style array wrapper. I based this on std::array implementation. I hope you can leave some feedback! array.ixx ...

c++ array c++20  
asked by Never 5 votes
answered by user673679 4 votes

2 Threads taking turns printing the alphabet

I am supposed to write code for an assignment. The goal is to make 2 threads (which are objects of a class that implements runnable) take turns printing the alphabet. One of them prints upper case ...

java multithreading concurrency  
asked by TheWerefox 4 votes
answered by Miguel Alorda 3 votes

Greatest hits from previous weeks:

Chess game in Python

I have programmed for 2 months, and I began writing a Chess game. I am a beginner programmer in Python, so please assess my code. ...

python beginner chess  
asked by Rafail 18 votes
answered by Daniel Quinn 15 votes

Very basic calculator using methods

I have made a basic calculator using methods. This is my first attempt at using methods and would like to see if I can improve on this as there is a lot of repeated code. ...

java beginner calculator  
asked by Niall Szalkai 16 votes
answered by asteri 14 votes

First C# program (Snake game)

I've just started out using C#. I've used Scratch (drag and drop programming for kids) for quite some time. Since Scratch didn't have classes and methods I have a feeling this code could be a lot more ...

c# beginner console snake-game  
asked by Wagacca 12 votes
answered by asibahi 5 votes

Quickly filter an object by keys

I am trying to optimize an object filter function. Given an array of keys, I need to filter an object. I feel that creating a new object each time may degrade performance. Is there a way to mock the <...

javascript performance  
asked by Mr. Polywhirl 22 votes
answered by wvxvw 5 votes

Pong game in Java

I have recently written the following Pong game in Java: Pong class: ...

java game swing pong  
asked by LazySloth13 16 votes
answered by ZeroOne 15 votes

Removing duplicates from an array quickly

...

javascript array  
asked by eddie 23 votes
answered by janos 19 votes

Text-based Tetris game

How can I improve this game? ...

c++ c++11 game tetris  
asked by MORTAL 11 votes
answered by Edward 12 votes

Can you answer these questions?

Interactive browser launcher in Rust using Native Windows GUI

The program is supposed to be set as the default browser in Windows and allows me to select which browser profile I want to use when I open a link from another program. I have quite some experience in ...

beginner rust  
asked by Gerald Schneider 1 vote

Recursion to generate fractal

I used recursion to generate fractal and got the desired result but I think my code can be better I started using MATLAB a few days ago and since than trying and learning new things. Now this code ...

performance recursion matlab fractals  
asked by Abdul Azeem 1 vote

Higher-order function to do throttling, written two ways

I have used below method for throttling which is a Higher Order Function (HOF), but find some difficulties to choose which one is better way to write it. Below are both methods. return of the ...

javascript functional-programming comparative-review meta-programming  
asked by diEcho 1 vote
You're receiving this message because you subscribed to the Code Review community digest.
Unsubscribe from this community digest       Edit email settings       Leave feedback       Privacy
Stack Overflow

Stack Overflow, 110 William Street, 28th floor, New York, NY 10038

<3