You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
- 6Exactly. Stepping through your program with a debugger should, in general, not be necessary to understand your own code - if it is, your code is spaghetti and should be shot (read: uses insufficient abstractions!). Of course you still must do this if something's gone wrong!Lightness Races in Orbit– Lightness Races in Orbit2019-11-03 18:12:14 +00:00Commented Nov 3, 2019 at 18:12
- 2"You should just not use the debugger to understand code, it should be understandable and correct by writing it that way". This is wishful thinking - did you ever try to find a bug in other people's code?Trantor– Trantor2019-11-04 13:56:13 +00:00Commented Nov 4, 2019 at 13:56
- 1This isn't anything particular to embedded computing. Lots of devs just write code for all types of things and "test" it by trying it to see if it works. Success is gauged not by the lack of bugs, but at least simply by them not manifesting during the "test".J...– J...2019-11-04 18:21:39 +00:00Commented Nov 4, 2019 at 18:21
- 1@LightnessRaceswithMonica: arguably "something has gone wrong" is synonymous with "you don't understand your code". At least, it didn't have the effect you expected, and so there's something you don't understand. The only thing worse than it being that I don't understand my own code, is if I do understand my own code and the problem is a compiler/hardware bug... So yeah, if I start out not understanding my own code by default, then something has gone badly wrong.Steve Jessop– Steve Jessop2019-11-04 23:44:55 +00:00Commented Nov 4, 2019 at 23:44
- 2@Trantor You're missing the point. This obviously does not apply to code that is already written and must be dealt with, it applies to active development. Getting things right at a higher level of abstraction prevents errors from cascading and multiplying. Designing code well and then executing on that design will always give a better result that writing any old crap with no idea of whether it will work, and hoping you can catch all the issues with a debugger.Matthew Read– Matthew Read2019-11-05 00:03:03 +00:00Commented Nov 5, 2019 at 0:03
| Show 4 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you
lang-cpp