#Refactoring tips maybe
1 messages Β· Page 1 of 1 (latest)
Whatever you like, if its a screen shot just make sure it includes line numbers
as long as I dont have to do any work to see it fine with me
yupp
assets => terminal
is the only relevant folder
the lib and "readonly" annotation is for the editor that i dont change it accidentaly
So your making a sort of computer terminal the player can type in
Oh yea i actually watched that yesterday
i posted a new one π
default commands is a mess, i have to give it more love so that one not now XD
argumentparser => list interpolation and property searching
is a problem
the history class... if you see it you will cry π
its code from an asset that is 10 years old
Thats ok. Old code isnt inherently bad because of age
I dont really see any glaringly wrong with it
its small, clean, does what it does ant not much else
mkay
shell is rated from vs code analysis very bad
only 70% on code maintainability
my default commands has 50% but i know that XD
Does VS Code give reasons, tips?
Because i would take VS Codes analysis with a grain of salt
Trash in what way
luΓΆ
Whatsd the metric
Theres needs to be a reason to refactor, not just because the Text editor says to
```Maintainability Index - Calculates an index value between 0 and 100 that represents the relative ease of maintaining the code. A high value means better maintainability. Color coded ratings can be used to quickly identify trouble spots in your code. A green rating is between 20 and 100 and indicates that the code has good maintainability. A yellow rating is between 10 and 19 and indicates that the code is moderately maintainable. A red rating is a rating between 0 and 9 and indicates low maintainability. For more information, see Maintainability index range and meaning.`````
i also want to use new stuff, which i dont know
as i work as java dev
linq and so forth are not common to me
Are you a web dev?
no backend server
mm
only UI i use is javafx and swing
everyhting else is just backend
but at home unity always π
I gotcha
it could be also advises
Im trying to learn enough to break into software development myself, no idea what path though
instead of refactoring
That snippet you pasted is worthless lol
100 is a higher number and therefore better. 0 is lower and worse.
great......
tahts the official microsoft web page ..ofc its uselss π
Well I honestly think you may be able to refactor, but it doesnt look that bad to me at all.
Classes are handling what they should, readability is fine
Maybe im still too new
i had the 10 years old asset
with the terrible code as example
and tried to make the same logic
in my one
so i didnt have to think about logic at all
Periodically ask feedback on your code. Refactoring a codeblock requires readability by other developers. Does your code make sense for what it does? If I call your method, does it do exactly what the method describes to do?
Consider making your code easy to read and maintain is where you'd achieve the end of refactorization.
then i ask you for feedback π
asset => terminal
Sadly, I don't have time right now. I'm in between jobs and helping part time.
oww
you got time later?
to have a look?
im the next 24 hours awake
so i got tiem π
I would pick a particular section of your code you think needs alot of work and paste that in the #archived-code-general or #archived-code-advanced and ask
I love the new input system
as you said
i used it first time when i was new... its hell .. when you dont even know what method references are
if you have knowledge its easy
Ah yea I waited till i was comfortable with the fundementals
that is the context extension
I can see what you mean tho
i only needed the trigger
on button down
so i wrote context extension
to react on InputAction.Callbackreceiver
that it doesnt send each frame
only when pressed one single time
is that teh way to go?
it works
Make sure it works in all cases you can think of, and if so, its a solution
See if it quits working on edge cases maybe
how you mean?
Theres a line you have to walk between gettings things done, and improving
If you are never satisfied with a solution or product you are making, youll never finish
If it functionally works, sometimes its best to move on and continue to finish whatever
prob should do that
You can Always come back and refactor more
if you keep learning ya know
Sometimes we stay and try to make something the "best"
When its impossible
i can do lot of stupid stuffs with the terminal allready
but a terminal needs to allow stupid stuff π
Can it make tea?
no π¦
Needs more work then
gimme 1 min
You need to hook that up to some robotics that deliver tea to your desk via a network command