-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
A little more about the spirit of the project??? #772
Comments
The posted example is definitely simpler and easier to read. However, all the GoTos may make it harder to debug or follow the program flow. One of the goals is to use good, modern coding practices and the Gotos don't fit there. Other programs are longer and more complex and may not fit in a single screen view. Not a VB expert, so can't comment on the other points. |
In the main project guidelines:
Note in that last bullet: the goal is to teach programming in the target language . Which I interpret as: the conversion should demonstrate the practices that you would like your students to follow. |
I would say we want the project to reflect modern coding practices, so essentially convert the gotos to subroutines would be preferable versus a "straight" port. |
There is a few things in the python one that could do with some simplification. The mugwump one for instance uses map(). I mean, cool and all, but as a 30+ year coder, this one had me paused for a bit, since its a very unstandard way of doing things. m, n = map(int, input(f"Turn {turns} - what is your guess? ").split()) Like, ok we're splitting a string into two strings with a space, then kinda hack casting those both into integers. But that map(int) thing introduces function passing, casting, string splitting and finally returning tuples. Thats a lot of lesson for a single line of code, and its worth keeping in mind that map()'s use can be controversial in some sectors of python, with Guido Van Rossen being a fan of removing it from the list of reserved word commands, although it never was. Its recent more common use is mostly a product of JS coders migrating to python. Its not a bad command (I use it a lot), but its a weird command that never felt quite at home in python due to the fact you tend to need to stop for a moment and figure out what the heck its trying to do. Personally I would have had that thing replaced by something like
Sure, its longer, but every line expresses one concept (or two in the. case of int(input()) which can be explained to a child easily. Honestly I would also probably have used string concatenation instead of interpolation too, but thats a pretty easy to explain thing. Also x,y is the standard for coordinates in cartesian geometry, not m,n. Generally we ought teach to use words for variables (Or even things like word_word , wordWord etc, but hey KISS) except when that single letter abreviation is well understood. x,y is common enough that most people know what it means (and you can explain it to a kid pretty easily) but with m, n I had to scan over the code a couple of times to grok what these letters meant. |
I'd just make a pull request for that |
Sure @shayneoneill if you are up for it a pull request is very welcome! Thank you! |
OK, so I'm looking at (specifically) the VB (.NET) conversion done for Acey Ducey and was left wondering the overall spirit of this project. Certainly, the conversion done is VB, but it also increases the complexity of the program significantly by introducing a lot of extra concepts. It's already bad enough that VB has a lot of "boiler plate" that many could argue is not necessary for some types of projects... literally this one being a perfect example of such. I'm not criticizing the conversion, that is totally not my intention. Rather I'm trying to wrap my head around the overall goal/intent.
One could argue that this is a chance to "show off" VB's capabilities or, to my thinking, this is more of an exercise of simplicity... taking what was, no pun intended, pretty basic and show how that could be done in a more modern implementation / platform.
To that end, I took a stab at a translation that a) attempts to stay VERY TRUE to the original, b) KISS and c) attempt to keep everything in view by either remaining in the same (or smaller) number of total lines of code (without, of course, straying too far from item a).
Now with an actual example to illustrate more of what I'm asking (wondering), what is the goal (or goals) related to conversions - most likely a very specific set of question(s) for VB as there are a lot of things VB is capable of doing that still harkens back to the early days of MBASIC?
Thanks.
(Also, if there are any errors in this posted example - please understand that I threw this together in about 20 minutes.)
The text was updated successfully, but these errors were encountered: