[Cuis-dev] Would like to contribute
Damián Ortiz
damyortiz19 at gmail.com
Fri Sep 13 16:47:07 PDT 2024
Hello,
I am Damian, a student in my second year of computer degree in Universidad
de Buenos Aires. Right now I am taking a class called "Software
engineering" whose professor is Hernan Wilkinson and we use cuis university.
While I was doing my homework which is about getting repeated code out, I
got a problem when I had repeated code in which the only instance variables
that changed were the ones called: active and suspended. I decided to
parametrize that code in another method in which both suspended and active
were replaced by category, and category was a parameter. So the previous
code was replaced by two lines, one calling the method with active, and the
other with suspended.
However, you can not extract that variable as an argument. So I had to do
it manually, change all active and suspended, one by one.
I think the fact of being able to parametrize a variable as an argument,
and also be able to parametrize it as an argument that already exists (When
it asks you for the name of the label, it detects if there is already an
argument called by that, it is parametrized as that already-existed
parameter).
I would like you to tell me what you think about this change, and maybe
give me a hint to try to implement it. I do think this would help to
extract different-named objects/variables as a single parameter, and also
extract variables as parameters.
Thank you for reading.
I attach the code I talk about here (The given and the desired ones)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240913/f12320b3/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: method desired to solve.png
Type: image/png
Size: 38936 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240913/f12320b3/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: code given.png
Type: image/png
Size: 34761 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240913/f12320b3/attachment-0003.png>
More information about the Cuis-dev
mailing list