-
Notifications
You must be signed in to change notification settings - Fork 0
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
Think about the Single Responsibility Principle #9
Comments
sergiomrebelo
added a commit
that referenced
this issue
Jan 26, 2023
sergiomrebelo
added a commit
that referenced
this issue
Jan 26, 2023
sergiomrebelo
added a commit
that referenced
this issue
Jan 26, 2023
sergiomrebelo
added a commit
that referenced
this issue
Jan 26, 2023
sergiomrebelo
added a commit
that referenced
this issue
Jan 26, 2023
sergiomrebelo
added a commit
that referenced
this issue
Jan 26, 2023
sergiomrebelo
added a commit
that referenced
this issue
Jan 26, 2023
sergiomrebelo
added a commit
that referenced
this issue
Jan 26, 2023
sergiomrebelo
added a commit
that referenced
this issue
Jan 27, 2023
sergiomrebelo
added a commit
that referenced
this issue
Jan 28, 2023
sergiomrebelo
added a commit
that referenced
this issue
Jan 28, 2023
sergiomrebelo
added a commit
that referenced
this issue
Jan 28, 2023
sergiomrebelo
added a commit
that referenced
this issue
Jan 29, 2023
sergiomrebelo
added a commit
that referenced
this issue
Jan 29, 2023
sergiomrebelo
added a commit
that referenced
this issue
Jan 29, 2023
Merged
Merged
sergiomrebelo
added a commit
that referenced
this issue
Feb 2, 2023
sergiomrebelo
added a commit
that referenced
this issue
Feb 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In general, SOLID is a, well, solid methodology for software engineering. There are others, but this one contains a good set of principles to work on. The S is the single responsibility principle. It basically says that a function, class, module should do a single thing. This allows for loose coupling, independent testing, but a better "defensive" programming that saves you trouble when you have to refactor (which you will, sooner or later)
This:
evo-poster/src/index.js
Line 72 in efaaaaa
has several issues:
if
inside and it changes behavior. Here:evo-poster/src/index.js
Line 78 in efaaaaa
you're calling
sentenceTokenizer
. That means that it's actually a flag to work in a different way; it will tokenize the sentence or not depending on that. It's got two responsibilities then: classify, and tokenize.sentences
has two responsibilities. If empty, it's a flag that will tell you wether to tokenize or not. If not, it will skip some functionality.Error
. ThatError
will be captured at a higher level, and interpreted in terms of the intended API, either REST or otherwise.As I said in #3, every issue should describe a problem. This describes a very general problem indeed. It's up to to you to decide on the solution, either piece-wise (focus on the file, functions mentioned) or general (think about user journeys, user stories, and how to start working on this specific funcitonality -- analysis -- responding to user's needs).
We can talk about it tomorrow anyway.
The text was updated successfully, but these errors were encountered: