You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.
Hey Kemo hope these little finds will help you and your code. Very nice job on it :)
Follow the C++ style guidelines. This will make the code more consistent and easier to read for other developers. For example, you can use camelCase for variable and function names instead of using underscores.
Use const where applicable. For example, you can declare functions that don't modify any state as const. This will prevent accidental modification of state and make the code more readable.
Use std::unique_ptr or std::shared_ptr instead of raw pointers. This will help prevent memory leaks and make the code more readable.
Use more descriptive names for variables and functions. For example, instead of using CreateCheatManager you can use CreateFortCheatManager to make it clear that the function is creating a Fort cheat manager.
Use C++11 features, such as range-based for loops, to make the code more concise and readable. For example, instead of using a traditional for loop to iterate over a vector, you can use a range-based for loop like this:
for (constauto& Building : ExistingBuildings)
{
// Do something with Building
}
Use modern C++ features, such as type aliases, to make the code more concise and readable. For example, instead of using std::array<UFortWeaponRangedItemDefinition*, 6> you can define a type alias like this:
using PlayerLoadout = std::array<UFortWeaponRangedItemDefinition*, 6>;
Use the C++ standard library instead of using C-style functions like strlen and strtoul. For example, instead of using strlen you can use std::string::size like this:
constauto end = const_cast<char*>(pattern) + std::strlen(pattern);
Use more descriptive variable names. For example, instead of using tab
Again this is just a few of the issues you can fix in the code there are more but they are not important to stability Thanks OperativeA115 - C++ / C Programmer
The text was updated successfully, but these errors were encountered:
Hey Kemo hope these little finds will help you and your code. Very nice job on it :)
Follow the C++ style guidelines. This will make the code more consistent and easier to read for other developers. For example, you can use camelCase for variable and function names instead of using underscores.
Use
const
where applicable. For example, you can declare functions that don't modify any state as const. This will prevent accidental modification of state and make the code more readable.Use
std::unique_ptr
orstd::shared_ptr
instead of raw pointers. This will help prevent memory leaks and make the code more readable.Use more descriptive names for variables and functions. For example, instead of using
CreateCheatManager
you can useCreateFortCheatManager
to make it clear that the function is creating a Fort cheat manager.Use C++11 features, such as range-based for loops, to make the code more concise and readable. For example, instead of using a traditional for loop to iterate over a vector, you can use a range-based for loop like this:
std::array<UFortWeaponRangedItemDefinition*, 6>
you can define a type alias like this:strlen
andstrtoul
. For example, instead of usingstrlen
you can usestd::string::size
like this:tab
Again this is just a few of the issues you can fix in the code there are more but they are not important to stability
Thanks OperativeA115 - C++ / C Programmer
The text was updated successfully, but these errors were encountered: