From 4f4100b00a36ce743a11f952a484b7d064a6d81e Mon Sep 17 00:00:00 2001 From: jlewismith <36462205+jlewismith@users.noreply.github.com> Date: Fri, 19 Oct 2018 13:57:57 -0600 Subject: [PATCH] Fix typos "witht" and "spaguetti" (#21649) --- guide/english/cplusplus/clean-code-guidelines/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guide/english/cplusplus/clean-code-guidelines/index.md b/guide/english/cplusplus/clean-code-guidelines/index.md index 6671a8039f..9b8c38da10 100644 --- a/guide/english/cplusplus/clean-code-guidelines/index.md +++ b/guide/english/cplusplus/clean-code-guidelines/index.md @@ -35,10 +35,10 @@ int cucumber; // global variable "cucumber" ## Using goto, continue, etc. This is an usual discussion among programmers, just like global variables, these types of statements are usually considered bad practice. -They are considered bad because they lead to ["spaguetti code"](https://en.wikipedia.org/wiki/Spaghetti_code). When we program we want a +They are considered bad because they lead to ["spaghetti code"](https://en.wikipedia.org/wiki/Spaghetti_code). When we program we want a linear flow, when using those statements the flow is modified and lead to a "twisted and tangled" flow. -Goto was used in the past when while, for, if functions, however, witht the introduction of those structured programming was created. +Goto was used in the past when while, for, if functions, however, with the introduction of those structured programming was created. In general avoid using goto unless you are sure it will make your code cleaner and easier to read. An example might be using it in nested loops. The usage of break and continue are practically the same. Use them in switches and try to make functions with an only purpose so you only have one exit point.