r/AskReddit • • Feb 08 '17

Engineers of Reddit: Which 'basic engineering concept' that non-engineers do not understand frustrates you the most?

5.8k Upvotes

4.5k comments sorted by

View all comments

Show parent comments

320

u/isfturtle Feb 09 '17 edited Feb 10 '17

90% of the time, though, it's not an error in my logic; I just missed a semicolon somewhere or didn't capitalize a letter I should have. Though finding those errors is an important skill.

EDIT: I mean 90% of the errors I make are typos. Not that 90% of my time is spend looking for them.

215

u/Warrlock608 Feb 09 '17

I once spent hours and hours and hours trying to figure out what the hell was wrong with my program. Finally found a for loop with condition a>c rather than a<c and thus the code never entered the loop due to the zeroing of the counter. My god I hated my life that day.

140

u/uranus_be_cold Feb 09 '17

I recently spent 40 frustrated minutes to figure out that I spelled appplication with 3 p's in an XML configuration file...

0

u/[deleted] Feb 09 '17

[deleted]

5

u/11111110001110000010 Feb 09 '17

It's been a couple hours, he's figured it out by now.

→ More replies (3)

3

u/Cherlokoms Feb 09 '17

Do you guys code on blocknote or what?

→ More replies (5)

16

u/ekfslam Feb 09 '17

I can't believe you didn't use the old school print statements to test that.

17

u/laidlow Feb 09 '17

Using the debugger is better than littering code with print statements. It seems daunting at first but it will save you so much time troubleshooting bugs.

10

u/Strasza377 Feb 09 '17

Depends on the problem and what sort of environment you're in imo.

4

u/that_how_it_be Feb 09 '17

Having used both extensively print statements are often a lot simpler / faster, especially in the world of concurrency.

→ More replies (3)
→ More replies (1)

4

u/cryptoengineer Feb 09 '17

I swallow my pride, drag over a colleague and walk her through the problem. About 2/3 of time, she'll point directly to the bug. The other 1/3, in explaining it to her, I find it.

I feel stupid, but the bug is fixed.

12

u/zaismussen Feb 09 '17

over a colleague and walk her through the problem. About 2/3 of time, she'll point directly to the bug. The other 1/3, in explaining it to he

I've been programmer for almost 20 years now. Early on, the VP at the very small company I was working for, was an absolutely amazing person. When I'd get frustrated, he come into my office, grab a chair, and tell me to explain the problem, and what I was trying to do. He could barely use a computer let alone understand what I was doing, yet every time, I'd find the solution while I was explaining it. He taught me that just attempting to explain the problem, especially to someone who might have a difficult time grasping it, can force you to see what you're missing. To this day, when I get stuck, I go find some random, unsuspecting soul to render hopelessly confused, and I can't think of a time when it hasn't worked.

9

u/KajiKaji Feb 09 '17

I hear that even works if you try explaining it to a rubber duck.

→ More replies (2)
→ More replies (25)

99

u/iterator5 Feb 09 '17

This is why IDE's exist.

7

u/RecklesslyAbandoned Feb 09 '17

If you get the chance look into linting (cpplint, pylint, jslint, etc). It's what your Idea is doing under the hood there. The name is language dependent obviously, but you can find tools fit for basically all programming languages.

The other thing that may be useful is static analysis, which runs and analyses code to check for uncaught error conditions.

→ More replies (2)
→ More replies (14)

6

u/janyk Feb 09 '17

What fucking compiler or interpreter are you using that doesn't inform you of syntax or unbound identifier errors?

3

u/Ascott1989 Feb 09 '17

I have no idea. This guy isn't a professional software engineer that's for sure.

5

u/Cherlokoms Feb 09 '17

Seriously dude, if you spend 90% of your time hunting for semicolon, there is something wrong with your workflow. I'm not saying anything about your programming skills, which I'm sure are perfectly fine. But you are probably using the wrong tools.

I don't know what language you are using but it's very likely that someone developped a linter for it or, there is an IDE that has it already. A linter will check your code for this kind of mistake. If you want global code comprehension, try an Intelligent Code Completion module if it exists for your language. For example, I can import a class from another module and if I create an object with this class and add a dot right after, it suggests me the attributes and methods of this object. I don't have to switch from file to file to check for eventual typo.

3

u/carlmango11 Feb 09 '17

Exactly. It can definitely happen where a slight typo actually forms valid code that only throws off the flow of execution slightly but it's very rare in my experience.

→ More replies (2)

4

u/ikorolou Feb 09 '17

Holy shit yes, I have literally spend all day very slowly walking through every tiny bit of an OS my team was building for a class, only to find out that we forgot to uncomment a single line out. Literally 5 minutes before the deadline to turn in our code, it was fucking amazing when it worked.

3

u/RagingNerdaholic Feb 09 '17

This is what error logs are for.

3

u/Wonderdull Feb 09 '17

90% of the time, though, it's not an error in my logic; I just missed a semicolon somewhere or didn't capitalize a letter I should have.

These generate a compiler error at the spot.

In C, a missing } is worse. The compiler will detect an error elsewhere, often just an "unexpected end of input".

3

u/Viltris Feb 09 '17

"Parse error on line 312." But my code only has 311 lines...

3

u/BenderRodriquez Feb 09 '17

Syntax errors are easy to find. The compiler even tells you where they are. Semantic errors are the difficult ones, eg adding instead of subtracting somewhere. Code that runs fine but gives the wrong answer can be a nightmare.

→ More replies (26)