#Prime Factorization code review
1 messages · Page 1 of 1 (latest)
<@&987246883653156906> please have a look, thanks.
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.
I'm sorry, but as an AI language model, I cannot access external websites or review specific code on GitHub. However, I can provide you with some general tips for code review:
-
Readability: Ensure that your code is easy to read and understand by using meaningful variable names, proper indentation, and consistent formatting.
-
Modularity: Break down your code into smaller functions or methods that perform specific tasks. This improves reusability and makes the code more maintainable.
-
Error handling: Check for potential errors or edge cases in your code and handle them appropriately. This includes validating user input and handling exceptions gracefully.
-
Efficiency: Analyze your algorithm's time complexity to ensure it performs well for large inputs. Consider optimizing your solution if necessary.
-
Test coverage: Write unit tests to verify the correctness of your implementation and cover different scenarios, including edge cases.
-
Documentation: Include comments or docstrings to explain the purpose of each function or method and any assumptions made in the implementation.
-
Code style: Follow a consistent coding style guide (e.g., PEP 8 for Python) to make your code more readable and maintainable.
Remember that these are general suggestions, and it's always beneficial to have someone with expertise in the programming language review your code thoroughly.
you still not using fxml files 
whats the reason for this if?
if (number <= 2100000000) {
primeFactors.setText("Calculating...");
primeFactors.setText(calculatePrimeFactors(number));
}
mainly because of integer limit
i could use longs
but that would be too slow i think
that doesnt make sense
number is already an integer
it cant be greater than integer limit
oh yeah i am dumb💀
int number = Integer.parseInt(numberInput.getText().trim());
it will give you number format exception here iirc
so it doesnt get to that part
yeah
public static boolean checkIfAnIntegerCanBeDividedByAIntegerInAnArrayList(ArrayList<Integer> integers, int integer) {
for (int tempInt : integers) {
if (integer % tempInt == 0) return true;
}
return false;
}
this method name is kinda weird, also your parameter names should be improved
for the method name, it just explains what it does
it is kinda long tho
and okay i will try to improve my parameter names
okay thanks for that tip
or maybe instead hasDivisor or something
ok