question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Two-Fer exercise recommends against input validation.

See original GitHub issue

My solution to the Two-Fer exercise included a test for isinstance(name, str), and the analyzer states that conditionals are used unnecessarily. This could be a completely preferential thing and I’m just over-engineering, but I feel like input validation shouldn’t be considered “unnecessary.”

If I’m wrong about this, at least I’ll have learned something haha

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
piccolosercommented, Dec 28, 2021

I think that should do it; I appreciate the info and quick response!

0reactions
BethanyGcommented, Dec 28, 2021

@piccoloser

You are most welcome!. And all that being said – I can clearly see why you’d want to be suspicious if you were taking in “random” user input. (users are creative and terrible engines of chaos!). Certainly something to think through if this was part of a larger program or was a method designed to interact with an entry screen. Also something to really think through if the string you are building and passing back is intended for a downstream process to act on. That recent log4J bug is no joke – and neither are un-sanitized DB inputs. 😉

When I used to mentor this problem a lot, I would refer to this post on Real Python, I love how he breaks down the reasoning behind the different string formatting options and goes over benefits and pitfalls.

Thanks again for logging this. I will keep it open for a bit and then close – unless you have other questions or issues?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Two-Fer exercise recommends against input validation. issue ...
My solution to the Two-Fer exercise included a test for isinstance(name, str) , and the analyzer states that conditionals are used unnecessarily.
Read more >
Community solutions for Two Fer in F# on Exercism
Explore other people's solutions to Two Fer in F#, and learn how others have solved the exercise.
Read more >
exercism/problem-specifications: Shared metadata ... - GitHub
Repository for practice exercises to be used across tracks. This includes both problem statements available as markdown and test data as JSON described...
Read more >
Input Validation - OWASP Cheat Sheet Series
This article is focused on providing clear, simple, actionable guidance for providing Input Validation security functionality in your applications.
Read more >
NHSCR REGISTRY REPORT - Geisel School of Medicine
validation and completeness on year 2017 cases. The validation component ... to use it as the basis for the NHSCR Data Collection Manual....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found