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
This issue is to collect ideas for additional normalizations that the representer could make so that more student solutions would get a matching representer comment in the future.
Some things to keep in mind:
The admins currently tend towards the idea that it would be ok if the analyzer would comment on something and the representer would then normalize the same thing. So just because something is listed below does not mean the student would not get feedback on it.
The mentor that writes a representer comment would see a list of normalizations that are potentially applied and should therefore not be commented on.
Some normalizations might not be worth the effort coding them as they will not significantly decrease the number of unique/rare representations. It is a bit hard to tell which ones those are exactly and where to draw the line so it is ok to collect all ideas for now.
The normalizations that are currently applied can be found in the README.
Ideas for additional normalizations:
variable declarations, e.g. var a string vs. a := ""
variable increment, i++ vs. i = i + 1 vs. i += 1
make without capacity and length vs. non make version (slices/maps)
new(someStruct) vs. &someStruct{}
unnecessary variable declaration before return
x := someFunction()
return x
Single import with and without brackets
import "fmt"
// vs.
import (
"fmt"
)
Named return values but the names are unused
func myFunc() (y int) {
return calc()
}
Remove example tests that a student might have written
len(someString) == 0 vs. someString == ""
expressions where the order does not matter, e.g. simple math expressions like return 2*x vs. return x*2
constants with unnecessary type definition, e.g. const x int = 40 vs. const x = 40 (not sure it is possible to know when this normalization is ok to do though)
slice[0:n] vs. slice[:n]
> x-1 vs. >= x when x is int/uint
(Some items on the list are taken over from #10. Note that some others listed there were already implemented. Other items on the list are from looking at distinctions that appear between the current representations.)
If you have additional ideas or are interested in implementing one of the normalizations, please leave a comment below.
The text was updated successfully, but these errors were encountered:
This issue is to collect ideas for additional normalizations that the representer could make so that more student solutions would get a matching representer comment in the future.
Some things to keep in mind:
The normalizations that are currently applied can be found in the README.
Ideas for additional normalizations:
var a string
vs.a := ""
i++
vs.i = i + 1
vs.i += 1
make
without capacity and length vs. non make version (slices/maps)new(someStruct)
vs.&someStruct{}
len(someString) == 0
vs.someString == ""
return 2*x
vs.return x*2
const x int = 40
vs.const x = 40
(not sure it is possible to know when this normalization is ok to do though)slice[0:n]
vs.slice[:n]
> x-1
vs.>= x
when x is int/uint(Some items on the list are taken over from #10. Note that some others listed there were already implemented. Other items on the list are from looking at distinctions that appear between the current representations.)
If you have additional ideas or are interested in implementing one of the normalizations, please leave a comment below.
The text was updated successfully, but these errors were encountered: