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:
...
9
votes
Color Selector Combobox Design in C#
Good and Bad Comments
This is a good comment, because it specifies the WHY:
...
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 ...
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 ...
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 ...
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 ...
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:
...
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 ...
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 ...
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.
<...
4
votes
Tags selector in plain JavaScript, without using any plugin
Use const or let instead of var wherever possible (example, see ...
4
votes
Menu user interface class in C++
Some code simplifications
Your read_double function can be simplified through use of the comma operator:
...
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 ...
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 ...
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 ...
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 ...
3
votes
Accepted
Python coin flipper with GUI
You are abusing the heads & tails lists into making simple counters.
...
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 ...
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 ...
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 ...
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 ...
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
...
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 ...
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 ...
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,
...
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 ...
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:
...
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.
...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
user-interface × 146javascript × 41
python × 24
java × 18
css × 17
html × 16
c# × 14
jquery × 13
swift × 10
ios × 10
swing × 9
console × 8
tkinter × 8
gui × 8
c++ × 7
vba × 7
react.js × 7
python-3.x × 6
object-oriented × 6
game × 6
event-handling × 6
performance × 5
excel × 5
io × 5
layout × 5