lunduniversity / introprog

Teaching material for "Introduction to Programming using Scala" at Lund University, LTH. http://cs.lth.se/pgk/
142 stars 178 forks source link

Example issue with rollover #592

Closed M0R60TH closed 3 years ago

M0R60TH commented 3 years ago

Several pieces of code used in the examples for week to have a slight issue when run through sbt. The use of print instead of println is creates rollover between smileys and the sbt output that are confusing to read in the terminal. Println is already used for some of the smileys.

image

Should this be changed (or is is to minor an issue and I'm just being pedantic?)

Husenap commented 3 years ago

I think that it's a pretty minor issue, but it's still good to have consistency in the example code.

Using println and print in this snippet doesn't make much sense

if highscore then println(":)") else print(":(")

So I don't see why it shouldn't be changed, go for it 🚀

fritjof-b commented 3 years ago

It might let the person writing and running the code reflect on the difference between println and print. If you're used to programming I guess it is more clear, but maybe not for the eyes of a new programmer. At least for me it wasn't all that clear in the beginning that small differences could have large effects.

Edit: we could add some note that highlights this difference. I agree that overall consistency is a good thing.

bjornregnell commented 3 years ago

fixed by #591