Comments (4)
Addressed with PR #107
from go.
I'm reopening this per the discussion here: exercism/exercism#1910
Summary: The definition of "not defined" means anything could happen.
from go.
Undefined behavior is not idiomatic Go. I'm against removing the error return. Actually I think this is an excellent problem to introduce the error result. The problem is fairly simple, and the error condition is both intuitively clear and trivial to detect. (Queen-attack uses the error return and is currently ahead of Hamming in config.json, but I'm not sure it should stay there. I expected most people would find Queen-attack a harder problem.) Anyway Hamming is currenly 17th in config.json. The error return is such an funcamental part of Go that I would actually be happy with introducing it return earlier!
I know I tried to make this thing happen with introducing error handling with the Binary/Octal/Hex sequence but that turned out a little strange. I think there are now four problems that require error handling before Binary. In Binary, the concept was to put the error return in the API but not check the value in the tests. We could do the same here for Hamming but really this is kind of strange thing to do. Go doesn't allow variable assignment unless the variable is used. Requiring a return value that is never checked is close to the same thing.
With the current README, we could add a comment to the test file explaining to return an error for unequal lengths but I think the API and tests are okay the way they are.
from go.
Undefined behavior is not idiomatic Go.
Yeah, you're right. I think that here the language trumps Wikipedia, and that creating a contract makes sense. I'm going to close again.
I do think that hamming would make sense earlier in the series.
from go.
Related Issues (20)
- Enable test runner v3 UI for all concept exercises
- Ensure package names are unique
- Adding concurrency concepts to the syllabus HOT 3
- Community contributions are paused for this repo
- Outdated information in the 'Randomness' section HOT 1
- ErrStop and ErrInvalidBase not defined in the test file. HOT 1
- Booking up for Beauty: Better explanations for tasks HOT 1
- Update go version to 1.21 in go.mod across all or subset of problems? HOT 1
- Remove check for short test in benchmarks
- Hello world: Error: not in workspace HOT 1
- Building a training set of tags for go HOT 22
- Bug: instructions for kindergarten_garden do not match requirements HOT 2
- Define more test cases for resistor color HOT 1
- Expanding test cases for Vehicle Purchase exercise in the Go track HOT 1
- Need for speed exercise CanFinish tests do not validate start with distance travelled HOT 1
- Inaccurate information for the "Runes" Concept HOT 1
- First Class Functions: task 5 misleading test? HOT 4
- Duplicated link in `parallel-letter-frequency` documentation. HOT 1
- Minor correction to instruction text for animal-magic instructions.md HOT 2
- TDD and the Golang track HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go.