r/learnprogramming • • Mar 07 '23

Is it normal as a junior programmer..

To spend hours looking over the same block of code, trying to sort out ‘why the f*ck isn’t this working!?’, only to realize the error you made is so monumentally, and stupidly obvious that it leaves you feeling like a completely useless moron? Lol

1.6k Upvotes

297 comments sorted by

View all comments

Show parent comments

136

u/chaoticbean14 Mar 07 '23

an IDE saves a ton of time in some of these cases...

Literally big red "You missed a semicolon" or "this variable isn't used", etc.

Once I started using tools like that? My time spent programming dropped through the floor. Of course, my time spent just thinking about the efficiency of the code - went through the roof.

But it's very rare I make those kinds of mistakes now - and when I do time wasted on them is extremely small.

123

u/[deleted] Mar 07 '23

an IDE saves a ton of time in some of these cases...

Sure, but vim puts hair on your chest

/s

15

u/IlliterateJedi Mar 08 '23

For partial chest hair, use IdeaVim

17

u/tukanoid Mar 08 '23

For 65% use helix

11

u/mandradon Mar 08 '23

That gives you a different kind of cred because it's written in RUST!

7

u/[deleted] Mar 08 '23

Blazingly fast

3

u/tallhansi Mar 08 '23

Some primeagen vibes?

3

u/tukanoid Mar 08 '23

Ya caught me, I'm a Rust enjoyer

41

u/UpbeatCheetah7710 Mar 08 '23

Who’s hair?

19

u/cthulhujr Mar 08 '23

I screamed

17

u/a_reply_to_a_post Mar 08 '23

i only vim on prod and copy random stack overflow copypastas into the shell like "hope this works!"

18

u/[deleted] Mar 08 '23

This guy devs

→ More replies (1)

2

u/dysprog Mar 08 '23

Vim: The best user interface that the 1970s have to offer.

2

u/Blaz3 Mar 08 '23

It takes the hair from your head though.

→ More replies (1)

16

u/patternboy Mar 08 '23

I'm experienced with R but a relative novice with python. I've never done any programming without an IDE, but yesterday I was reminded of the limitations of IDEs quite painfully. I spent hours trying to solve a problem with a set of dictionaries not being populated properly using a set of nested for loops. I understand this is a relatively simple task for any professional developer/data person. I'd never done such a complicated set of nested loops before though, iterating through several different lists/dictionaries of different lengths to be consolidated (all originating from a powershell subprocess stdout string).

It turned out that a totally correct line was just indented one loop too deep and this was messing up the loops. Literally a backspace solved the whole thing. But the IDE didn't help any as there was nothing wrong with the syntax. I of course felt the excitement once it finally worked, but also felt frustrated and stupid, and retired to bed at 4am and had recurring dreams about solving problems with key:value pairs that I had already solved.

17

u/chaoticbean14 Mar 08 '23

Yeah, there may be some instances where the IDE doesn't alert you - but I would say for the vast majority of typical issues that catch developers up for hours (sometimes days) an IDE will generally be a huge help. Red squiggles, grey text, lots of visual queues of "something here isn't right" as well as lots of things in the problem pane.

I'm glad you got it solved! Staying up late is almost never worth it, for me personally. A good nights sleep is so helpful to me. Come back in the AM with some coffee and a clear head - I usually have a whole handful of things to try.

7

u/patternboy Mar 08 '23

My immediate thought is why are developers not using IDEs? I genuinely assumed everyone used them, especially in tech. I did a bioscience PhD and we rarely saw anyone use R itself - we opted for RStudio specifically because it was much easier to read and write code, install packages, etc., and helped with highlighting errors and displaying graphs quickly. I've never opened the python app - have always used either PyCharm or VSCode. I thought this was all standard stuff?

But yeah I agree about the sleep. I even started noticing my ability to solve these problems and think clearly just reach somewhat of a stone wall during the night itself. It comes on gradually but I keep catching more of myself zoning out and losing track. I've very rarely had the motivation to stay up so late learning/solving complex problems so have never experienced this gradual onset of fatigue so vividly. It's been a learning experience!

3

u/mandradon Mar 08 '23

Anyone not using an IDE for R deserves what they get! Rstudio is great for what it does. It smoothed the learning process out for me when I was in grad school that I never through of R as a language and just thought of it as a stats package with really poor UI tools.

I've seen people recommend using just the python terminal to learn, or IDLE, but I think those people are insane. I get doing things simple from the start, but text editors and ides exist for a reason.

Also, with Python, it's error messages can be less than helpful for novices, though. A missed closing parenthesis will often throw an error on the wrong line, depending on the version or LSP/linter that's being used. Tab mistakes can take a long time to track down if you don't know what you're looking for, too.

2

u/patternboy Mar 08 '23

I agree with everything you said about R and IDEs. I don't think I'll ever understand why anyone prefers to "start simple" when it opens the door for so many more problems, never mind monotone code with no formatting.

Also I'm so glad you said it - the biggest thing I've found with python is the errors are often really cryptic! And sometimes even if they reference the correct line, it's unclear which part of the line is the issue. I'm just now getting to the point where I can half reliably work out what an error actually means.

5

u/dehin Mar 08 '23

The new Python 10 compiler I believe now checks for some logic errors as well, not just syntax ones. Although, I'm not sure if it would have caught your issue.

3

u/lordheart Mar 08 '23

If I start having to nest to many loops I’ll pull out the inner loop into a function, and repeat till it’s cleared up.

→ More replies (1)

2

u/Majestic-Giraffe7093 Mar 08 '23

The problem is the cases where it is not syntactically incorrect but the semantics are changed. I spent 6hrs of debugging only to find that my colleague had put a comma in a json object where there should have been a colon and it caused all sorts of weird behaviour.

2

u/[deleted] Mar 08 '23

There’s a VSCode plugin called “Error Lens” that helps with that too if you wanna stay relatively lightweight

3

u/chaoticbean14 Mar 08 '23

Yeah, I liked Error Lens when I used VSCode. It was a 'must'. I've been using PyCharm for the past year for all my Python stuff; everything that needed extensions and plugins and configuration in VSCode is just 'baked in'; it might be a little more resource hungry - but I'll take that since it's all "in the box" off the shelf.

→ More replies (1)

2

u/GoldenGrouper Mar 08 '23

Yes sure only when the project is not a huge mess full of dependencies!

→ More replies (3)
→ More replies (7)