Skip to main content
10 votes

GUI for a quiz tool or game

1. Instead of: def __init__(self, root): """Constructor""" self.root = root # root is a passed Tk object do: ...
Samwise's user avatar
  • 4,010
9 votes

Color Selector Combobox Design in C#

Good and Bad Comments This is a good comment, because it specifies the WHY: ...
infinitezero's user avatar
  • 1,112
8 votes

Implementing a customized helpful hints function which includes docstring but much shorter than Python help()

Disclaimer Now that the OP has clarified that they intend to use this as a teaching tool, my answer has lost relevance for their use-case. It can still be taken as general advice for most Python ...
Graham's user avatar
  • 1,419
7 votes
Accepted

Implementing a customized helpful hints function which includes docstring but much shorter than Python help()

I'm not sure whether you're reinventing the wheel, but you are using the wrong tools for the job. I've been through the phase where I think I'm doing something unique enough that I need to do ...
jpmc26's user avatar
  • 1,243
7 votes
Accepted

Color Selector Combobox Design in C#

ETA: I've updated the design a little bit to add a property called SelectedColor to the combobox subclass. Eliminates the need for the caller to use ...
Jesse C. Slicer's user avatar
5 votes
Accepted

JavaScript discrete slider web component

It looks like you've put a lot of work into this and it appears to function well. There are only a few suggestions - see below. I agree with the comment by user3342816 that the flipped sliders seem ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
5 votes

Menu user interface class in C++

Includes I like the consistent use of alphabetical order for standard library includes. This makes it much easier to quickly check for missing includes. main.cpp: ...
Toby Speight's user avatar
  • 88.7k
4 votes

GUI for a quiz tool or game

If talking about code readability, I'd recommend you to read PEP-8 at first, for example: def one(): pass def two(): pass This is how you don't want your ...
finally's user avatar
  • 141
4 votes
Accepted

Table View Controller class in Swift

There are quite a few issues here: In switch statement, you don’t need/want break statements. Unlike C languages, Swift ...
Rob's user avatar
  • 2,657
4 votes
Accepted

Font Selector Combobox Design in C#

We can specify the DataSource of the FontSelectorComboBox instead of adding items one by one. This usually easier and faster. <...
Olivier Jacot-Descombes's user avatar
4 votes

Tags selector in plain JavaScript, without using any plugin

Use const or let instead of var wherever possible (example, see ...
kiner_shah's user avatar
4 votes

Menu user interface class in C++

Some code simplifications Your read_double function can be simplified through use of the comma operator: ...
CPlus's user avatar
  • 1,467
3 votes

Google homepage beginner project

Your code is good, but I have some suggestion to improve it. HTML You used semantic HTML for the header and footer, but for the main content you did not use any semantic html. If you use semantic ...
Mehrdad Kiani Anbohi's user avatar
3 votes

How to properly write code for Java Swing

Swing code is generally appalling, and that includes the tutorials. As always in Java, don't go around subclassing classes you don't need to. You wouldn't dare subclass ...
Tom Hawtin - tackline's user avatar
3 votes

Creating an empty Sudoku grid

I have a few recommendations to give you. Firstly, you should try to use flat layouts when you are using a lot of view components. Try changing your TableLayout to ...
Panos Gr's user avatar
  • 131
3 votes

Implementing a customized helpful hints function which includes docstring but much shorter than Python help()

It is difficult to add anything to the existing great and detailed answers, but, to follow up your comment that .__doc__ might be to difficult to remember for ...
alecxe's user avatar
  • 17.5k
3 votes
Accepted

Python coin flipper with GUI

You are abusing the heads & tails lists into making simple counters. ...
AJNeufeld's user avatar
  • 35.3k
3 votes
Accepted

Simple view for CRUD with miglayout

Quickfire opinions: Swing is deprecated. If you have the choice: do not use swing! Empty lines are a useful thing. It's pretty conventional to use empty lines between members and around the import ...
Vogel612's user avatar
  • 25.5k
3 votes

Poké-permalinks

I'd appreciate any feedback on improving perceived responsiveness for the feature this UserScript adds to the webpage. Since you are trying to synchronize the display of the image and the current URL ...
Grant Miller's user avatar
3 votes
Accepted

Is my Python tkinter application properly structured?

Don't create more than one instance of Tk You should only ever create exactly one instance of Tk. If you need to make more windows, useToplevel`. You aren't using ...
Bryan Oakley's user avatar
  • 2,169
3 votes
Accepted

Optimising multiple string splits and concatenations

I would use generic list to store messages history and Linq extension methods. If I understood correctly I would append new messages and crop to predefined maximum size. Could you test this solution ...
Tomas Paul's user avatar
3 votes

HTML table with repeatable rows and live-calculated column totals with row grouping indication

Declarations Always declare variables that do not change as const rather than let or var For example the line ...
Blindman67's user avatar
  • 22.9k
3 votes
Accepted

Python Tkinter UI Pattern Password Code

Welcome to CodeReview! Your code is quite readable, but there are still ways to improve it: Remove "magic" numbers Whenever you write a number that is not ...
Caridorc's user avatar
  • 28.2k
3 votes
Accepted

Tags selector in plain JavaScript, without using any plugin

Review General Review I like the styling - especially the colors, border radii, use of rotation, spacing etc. As far as I can tell the filtering works well. Minor wording flaw On some platforms ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
2 votes

Plain Page Flip Effect

Declare variables in the smallest possible scope It's recommended to declare variables in the smallest scope where they are needed. That way, the variable will not be visible where it should not be, ...
janos's user avatar
  • 113k
2 votes
Accepted

Loop through different controls and enabled the state of the whole group VBA

I rows are being added dynamically I would write a class to wrap each row of controls and respond to the combobox events. Since there appears to be is a fixed number of rows, there is no reason to ...
TinMan's user avatar
  • 4,328
2 votes
Accepted

User-friendly script for searching through log files

If you don't have shellcheck, install and use it (or submit your code to the online version). Here's what it says about this script: ...
Toby Speight's user avatar
  • 88.7k
2 votes

Simple React component to view cached data and test result from API

You can just remove the TODO until it's needed. The code will be easier to follow and if someone needs to localize later, they can figure it out themselves. It's clutter. ...
ndp's user avatar
  • 2,381
2 votes
Accepted

VBA UI design architecture, how to make this a piece of art

Public mainForm as mainForm 'does this shuts up the creation of the default UserForm? Nope. It merely declares a global variable that's never assigned or referred ...
Mathieu Guindon's user avatar
2 votes
Accepted

Multi-line input reader

There's not much code, however, I'd change input_lines in the following ways: Only display prompt while reading first line. If you're only going to do something ...
Peilonrayz's user avatar
  • 44.6k

Only top scored, non community-wiki answers of a minimum length are eligible