Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify ThermalHouse #940

Closed
sebastian-peter opened this issue Aug 28, 2024 · 0 comments · Fixed by #952
Closed

Simplify ThermalHouse #940

sebastian-peter opened this issue Aug 28, 2024 · 0 comments · Fixed by #952
Assignees
Labels
code quality Code readability or efficiency is improved HiWiStart Good for New HiWis

Comments

@sebastian-peter
Copy link
Member

I'm not sure if these kinds of one-operation commands need to be placed in their own function:

def calcNewInnerTemperature(
oldInnerTemperature: Temperature,
temperatureChange: Temperature,
): Temperature =
oldInnerTemperature + temperatureChange

Especially because this is not understandable at once glance:

calcNewInnerTemperature(
currentInnerTemperature,
calcInnerTemperatureChange(thermalEnergyChange),
)

But this could be, in my opinion:

    val temperatureChange = calcInnerTemperatureChange(thermalEnergyChange)
    currentInnerTemperature + temperatureChange

Same applies to methods calcInnerTemperatureChange, calcThermalEnergyChange and calcThermalEnergyGain. One could add explanatory commentary if and where needed.

@sebastian-peter sebastian-peter added the code quality Code readability or efficiency is improved label Aug 28, 2024
@marvinheintze marvinheintze self-assigned this Aug 29, 2024
@danielfeismann danielfeismann added the HiWiStart Good for New HiWis label Aug 29, 2024
sebastian-peter added a commit that referenced this issue Sep 17, 2024
…lHouse

Simplified methods to values in ThermalHouse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Code readability or efficiency is improved HiWiStart Good for New HiWis
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants