29
votes
Accepted
Python - Tkinter - periodic table of chemical elements
I hope you enjoy this bit of code.
I did!
Your symbols, keywords and values should have capitalised variable names since they're global constants. However, life would be easier if your symbols were ...
27
votes
Python - Tkinter - periodic table of chemical elements
Don't optimize the wrong thing
You have an excellent review already, so I'll comment on a narrow topic: cramped
code layout. For example:
...
24
votes
Accepted
2048 with GUI in C
Well done. This is not a complete review, but instead a (short) list of possible improvements I found when I skimmed your code.
Documentation
First of all: thank you! It's great to have ...
10
votes
A GUI Youtube Player (2)
Thanks for bravely offering up your code.
I'm sure it will emerge in better shape.
Each development project has its own standards.
If they aren't written down in the ReadMe,
then we tend to assume ...
9
votes
Accepted
C++ "Dear ImGui" file browser
One of the things I'm specifically wondering, is it ok/proper to have static helper functions in the .cpp file if they are not member functions? (should they be member functions and should they even ...
7
votes
Accepted
Handling dialog closure in a VBA user form
I like how your form is no longer concerned with anything other than being a form.
One More Abstraction Level
I'd go one step further, and encapsulate the controls, so that the presenter class doesn'...
6
votes
Accepted
AppJar number pad and keyboard
Python has an official style guide, PEP8. It won't hurt getting familiar with it, since it helps keeping your code readable, consistent and ready for others to mess with.
Combining Italian and ...
Mast♦
- 13.4k
5
votes
Accepted
Displaying an arbitrary number of buttons and automatically arranging the buttons
Don't import tkinter twice
You're doing this:
import tkinter as tk
from tkinter import *
Remove the second import since you are already importing tkinter. That ...
5
votes
Accepted
Populate Comboboxes with Hashtables using PowerShell
The first thing to observe is that the five pieces of code are identical except for two parameters that are varying. We can capture the common the code in a function (let's call it ...
5
votes
GUI Number Generator in QT C++
I see a number of things that may help you improve your program.
Use proper case for file names
We all know that Windows is not case sensitive with respect to file names, but pretty much every other ...
5
votes
Accepted
Qt Number Generator v2
Seems like you've made a lot of improvements since your previous post! Let's get into the review!
1. General Overview
a. Use the ...
5
votes
Accepted
GUI to organize images, chapter titles, animation steps, and instructions
If there's a list, make it a list
Do not represent RxCx variables as separate variables. Represent them as nested lists and it will greatly simplify your code. ...
5
votes
Accepted
College Billing System - Java
Absolute positioning
This:
l1.setBounds(550, 100, 250, 20);
and lines like it are non-ideal. Absolute positioning will fail to scale the controls and their ...
5
votes
Accepted
Python PyQt6 populate QTreeWidget with a list of named tuples
You have a pile of unstructured, global code; this needs to be organized into functions and maybe classes
Close your cursor once you're done with it, ideally via context management
Order your query ...
5
votes
ConnectFourFX.java - A Java FX GUI app for playing Connect Four against AI
The functions has*Strike() are basically the same function, but with different starting points and different strides through the ...
4
votes
Minimal spreadsheet program
The code looks okayish so my point are mostly about code style and preferences, you might easily ignore any if you prefer a different coding style.
Apart form things that @janos mentioned:
1....
4
votes
Minimal spreadsheet program
is_reference
The possibility of an IndexError can be mostly eliminated by reordering the conditions:
...
4
votes
Accepted
My first Qt application - a multiple-state window with a menu
That's a good first Qt program. Most of my comments are preferences rather than rules, but I'll try to provide justifications.
In main(), no need to ...
4
votes
Accepted
GUI Application for counting visitors
Personally, when building GUI applications I like to wrap my code into a class, and handle each action into each own method. I'll start from top to bottom.
I don't use wildcard ...
4
votes
Autocomplete for tkinter Entry widgets
Very, very, very nice code! It's very difficult to find something for an improvement. So only some not very important things:
In your list comprehension
...
4
votes
Accepted
Buttons labelled with the number of times they have been clicked
Here are a few things I'd recommend changing:
There's no need to store the sum of a and b. You can always compute it in the ...
4
votes
Accepted
Basic Countdown Timer
Very clean code indeed, there's not much to be said here.
PEP8
I'm sure you've been lectured on this before, but there's an official style guide for Python called PEP8. It states that module-level ...
4
votes
Accepted
Enhancing a Conversion calculator
One of the smartest programmer's I've ever known once told me that code is read way more often than it is written, so optimize for the reader1
While it's true that code should be efficient, it also ...
4
votes
Accepted
Platform-agnostic windowing library
I wouldn't use #define macros. They expose the internal naming convention of your OS dependent functions to the world. Once you send out your library to others [as ...
4
votes
2048 with GUI in C
Since the other reviews have already hit most points, I'll just mention a few not already covered.
Avoid relative paths in #includes
Generally it's better to ...
4
votes
Accepted
C++ Qt simple GUI game
When dealing with Qt 5+ prefer the new connect syntax:
QObject::connect(ui->tiles01, &QPushButton::clicked, this, &MainWindow::tileCliked);
Instead of ...
4
votes
Accepted
C++ Snake game using Qt-framework
Here are some things that may help you improve your program.
Use consistent formatting
It appears that your code uses tabs in some places and spaces in others, making the code appear badly formatted ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
gui × 314java × 115
python × 109
tkinter × 67
swing × 54
python-3.x × 42
beginner × 35
c++ × 30
javafx × 25
object-oriented × 23
pyqt × 20
game × 19
performance × 16
qt × 15
c# × 14
tic-tac-toe × 14
event-handling × 12
multithreading × 10
calculator × 10
android × 9
user-interface × 8
javascript × 7
awt × 7
c × 6
design-patterns × 6