r/learnprogramming • • Jun 27 '21

Random Thoughts Does anybody else spend hours trying to implement something, and later look back and wonder why it took you so long "just to do that?"

Might be hindsight bias, but I've noticed that it takes a bit of a blow on my self-esteem more than I thought. I'd literally spend hours trying to implement a small block of code that's supposed to do one thing, find a solution, spend some more time debugging it, and later I'd look at it and wonder "why the f*ck did this take so long?"

1.9k Upvotes

126 comments sorted by

618

u/dfreinc Jun 27 '21

no. that's just how learning works. if you can do it faster now knowing what you know, that should make you feel good. not bad.

68

u/Contrite17 Jun 27 '21

Even more broadly this is problem solving in general. Solutions are obvious in hindsight, and when working we often tunnel on what we think the correct answer is and get blinded. You look back the next day and suddenly you notice there is a trivial solution you ignored.

28

u/dfreinc Jun 27 '21

it's not a real problem unless you've gotten good sleep on it. that tunnel vision is real. people lose sleep over it. sleep's valuable.

114

u/FoolForWool Jun 27 '21

I'm trying to get used to this :') CEO had to apologise to customer cuz I took too long to deliver something. But I learnt a lot and they said it's alright, now that I know what'll work and what won't, I'll do this quicker and better next time. Felt guilty and good at the same time :')

67

u/dfreinc Jun 27 '21

hey, if you tried hard, don't ever feel bad. you did your best. growth is what's important. šŸ‘

22

u/FoolForWool Jun 27 '21

Thank you so much :') it took me 19 versions of scripts to get it right but I explored quite a few things.

Really appreciate the kind words, thanks again <3

20

u/Doopapotamus Jun 27 '21

Think about it this way: at the end of the day, EVEN IF someone's mad, you learned a good lesson and honestly you tried your best. Sometimes deadlines can't be strictly met, and that's simply life. You can't promise a 100% hit rate because nobody can (and anybody expecting that can get bent or do your job for you).

7

u/FoolForWool Jun 27 '21

I really appreciate your kind words! It was a fun ride and I did learn quite a few interesting things! Took my time but we eventually got there :D

8

u/misterforsa Jun 27 '21

Let me ask this. If it was so critical to meet a dead line, why wouldnt a manager assign some back up personnel to the task rather than leaving you to work by your lonesome? In my eyes, it's not your fault the product was delivered late. Its managements fault for not providing the personnel resources.

3

u/fvkfeels_Bangz Jun 27 '21

It is process, we learn through process

1

u/FoolForWool Jun 27 '21

We do :') thank you! <3

3

u/Wingout Jun 27 '21

Maybe you can give us a brief breakdown of your problem and how your iterations helped you arrive at the most optimal solution?

6

u/FoolForWool Jun 27 '21

Forgive me if it's too vague, I'm trying not to dox myself.

So it was a ETL processes that is triggered every time an event, let's call them errors on a device cuz that's what they're closely related to in this case.

We'd already set up the data pull to add the data to our data lake. Once this file is added to our data lake, this process is triggered.

My job was to get the start and end of each error for each device whenever the file dropped, validate the error to see if it was a false positive and then update it to our database. Needless to say, I had to check if the error was being repeated, keep the error open if it was not closed, update the time and so on. So ya know, quite a few edge cases had to be checked.

The issue I faced was the transformation part. They had, to say the least, an interesting way of formatting the files. Getting the start and end, validating, checking with the db, writing error logs when there was a mismatch and so on took most of my time.

It took me a few versions just to get the formatting right. Halfway through I'd realise how to reduce the two for loops that ran for 13 minutes and boom, something would break and I'd spend time fixing that.

Then I realised it's better to get it running first before optimising it. It ran for 17 minutes but at least it did the right thing. Then it was a little easier after that. Each iteration after that made it run faster. It'd sometimes give the wrong times or mix up the devices or error codes and that took some time to fix.

Spent a lot of time optimization the read from db, the validation process (this was a pain, I had to check for each time when the device was working when there was an error and then add it as a false positive to the logs and I was looping through each timestamp within the time delta to get it)

Finally pulled it down to 10-25 seconds for one month of data (on a good month, boy, I couldn't even count the numbers on df.shape). That many seconds are a lot, I know, but once it's there in the cluster, it's just a matter of reading it from there. So the customers get what they instantaneously.

2

u/Wingout Jun 27 '21 edited Jun 27 '21

Thank you for the quick reply, I appreciate the insights you gave in working through problems like these.

2

u/FoolForWool Jun 27 '21

I hope it helps! The biggest takeaway I got when working on this was solve the problem before optimising it. :')

2

u/jk_can_132 Jun 27 '21

If the CEO and customer took that as well as you say then you have found a golden combo of a place to work.

3

u/FoolForWool Jun 27 '21

Ikr! Everyone's so supportive, it's almost like a dream. I'd left my previous job cuz of toxic management (to the point they called and screamed at it a few hrs after I dropped my resignation). Never thought I'd be blessed with such a wonderful place.

14

u/DestituteDad Jun 27 '21

that's just how learning works

That's just how coding works. I learned how to program in 1969. Every programming task takes longer than it initially seems it will, with very few exceptions.

We used to laugh at this but there's a ring of truth to it.

How do you do software estimation? Come up with an estimate of how long it will take to complete a task?

  1. Think about it

  2. Write a one-page memo about the solution, highlighting uncertainties and possible problems

  3. Come up with your estimate

  4. Double the number and go to the next larger unit of time. LOL

So the task you think will take 2 hours takes 4 days, and the task you estimate will take 4 days actually takes 8 weeks.

Good luck!

8

u/haberdasher42 Jun 27 '21

Oh jeez. The last thing I thought would take me 4 days actually took 6 weeks. This system isn't far off.

1

u/singdawg Jun 28 '21

What about the times that I estimate will take 8 weeks but then take the afternoon?

2

u/haberdasher42 Jun 28 '21

Then you've got two choices, 8 weeks of Reddit and looking busy, or having a manager that will trust you after you tell them you've found a brilliant work around and won't proceed to second guess all of your estimates.

4

u/singdawg Jun 28 '21

14 weeks of reddit... 8 weeks was an underestimate

121

u/Debbie237 Jun 27 '21

Yes, happens all the time when coding and also doing math. I'll frequently spend hours writing some unnecessarily convoluted code only to realize that there's a library function that does exactly what I want. There have also been so many times where I've spent multiple days working on a single math problem, I write a correct proof that spans several pages, and then I realize a few days later that I could have proven it in like 3 sentences.

The good thing about it is that, after having experiences like this, you're a lot more likely to remember the easy way in the future.

1

u/janman27929 Jul 15 '21

i put that in my online dev course ...We build a solution to convert a csv to a sqlite database with basic CLI interface ... and then I show them CPAN, where there are libraries and hundreds (thousands) of other practical libraries

54

u/Lopsided-Suggestion Jun 27 '21

Everytime, when you know the answer to a puzzle the puzzle always looks easy

6

u/foxer_arnt_trees Jun 27 '21

And if you put more effort in you might even find a simpler solution

4

u/[deleted] Jun 27 '21

Isn't programming all about finding the most elegant solution?

12

u/gakule Jun 27 '21

Perfect is the enemy of good

3

u/[deleted] Jun 27 '21

Took me a second but so true

6

u/foxer_arnt_trees Jun 27 '21

No, that's academia

2

u/[deleted] Jun 27 '21

My hero academia?

1

u/haberdasher42 Jun 27 '21

You spend on as much time as you can looking for the most elegant solution until you've got just enough time to get it done with the tools you have.

2

u/[deleted] Jun 27 '21

Lol right, that feeling that you've been wasting time like OP said is a good motivator at the last minute

1

u/[deleted] Jun 28 '21

Well yes, and no.

Yes. Programming, ideally, includes the process of building efficient algorithms.

No. Software Development is about building products and products don’t always have efficient code. For a LOT of good and bad reasons.

1

u/[deleted] Jun 28 '21

Yeah the real world is always gray like that, eh? Thank you

1

u/Ahajha1177 Jun 27 '21

Something something P and NP.

26

u/sfmerv Jun 27 '21

Welcome to coding

21

u/[deleted] Jun 27 '21 edited Jun 27 '21

Yeah this happens all the time and it’s not necessarily a bad thing. I’ve designed entire solutions and written classes and methods and interfaces only to come back on a Monday and scrap the whole thing because I read an article over the weekend on a vastly more efficient way of doing x or had some eureka moment on how to better handle async or threads or IPC or RPC or ORM or whatever. I’ve learned to embrace it because as long as I’m getting the job done and learning it’s all just a good time.

It’s also directly proportional to your sleep, your nutrition, endorphins, caffeine intake, life stress, fulfillment, etc. You can have day where you just tank and debug for 6 hours with no luck and want to toss your stuff out the window, rest up have a good meal, play with your dog, and then come back the next day and solve all the problems that plagued you the day prior in an hour. That’s just the balance of it, ebb and flow; yin and yang if you will.

7

u/El_Glenn Jun 27 '21

This is real. Yesterday me is such an idiot. Good thing he got got replaced with superstar today me.

18

u/[deleted] Jun 27 '21

Sometimes you just can't see the forest for the trees.

21

u/kbielefe Jun 27 '21

There's a paradox about code where the easier it is to read, the easier it seems it would be to write, but the opposite is true. It takes a lot of work to come up with solutions that look simple.

8

u/the_smollest_bee Jun 27 '21

haha yeah! i was working on implementing a rgeneration system for a mana bar in a game, it's simple just update every 180 ticks (3 seconds) and 5 mana, if mana is full don't do anything and it took a whole day to get it to work when the only thing i was doing wrong was calling the function in the wrong area lol

5

u/rubenlie Jun 27 '21

This was basically my entire internship, they did hire me in the end so its not a problem I guess

5

u/[deleted] Jun 27 '21

I once spent 1.5 hr figuring why my constructor throw an error when i try to define it outside the class just to realise i forgot to declare it .

4

u/Intiago Jun 27 '21

That realization is a good thing. Its what learning is and why to actually learn programming, you need to write programs. Getting better only comes with practice!

3

u/ivannovick Jun 27 '21

Yep, it happens everytime

3

u/Omkar_G Jun 27 '21

Think it as a investment for similar future tasks

3

u/grooomps Jun 27 '21

i look back on my code before i knew how to properly use array methods. so many loops :(

3

u/etc_shadow_ Jun 27 '21

It often happens with every programmer. Whenever I realize I'm stuck, I take a 10min break and when I come back, it's way easier for me to solve the problem.

3

u/nextProgramYT Jun 27 '21

That’s good! That means you learned something

3

u/Blando-Cartesian Jun 27 '21

Constantly. Coding is nothing but details that need to be just right, so no wonder everything takes time. I think it actually gets worse with experience. You write up a solution, think of a an edge case where it doesn’t work, fix and repeat. While you are at it, you find more bugs elsewhere.

3

u/Mathsgeniuss Jun 27 '21

I think it's common. It always happens in every problem solving subject like physics , maths or Cs.

2

u/makejullins Jun 27 '21

That’s what we’re paid for

2

u/[deleted] Jun 27 '21

I’m very new to coding (learning basic JavaScript, html, and css at the moment). But I’ve spent nearly a decade learning tennis and nearly two and a half decades drawing. Drawing in particular gives a similar feeling of ā€œwhy did this take me so long?ā€ I used to have to draw a million lines to get the right one. Now the right line just comes to me, and if it doesn’t the second definitely does.

I’m very patient with myself when it comes to my current predicament of trying to teach myself JavaScript because I’ve been through the beginners journey so many times now, it’s like I already know I’m going to run into walls and male mistakes and look back on these days with that ā€œwhy did it take me so longā€ feeling.

Everything in life kind of goes like this if you care enough about it. Passions are both love and hate intertwined, frustration is just part of the process. Just don’t get hung up on it and you’ll waste less time ruminating on how you could have done it better.

2

u/[deleted] Jun 27 '21

You also get tired. Solving problems the next day is always easier.

2

u/[deleted] Jun 27 '21

Dude I would take hours for simple shit it’s the learning process

2

u/cruciod Jun 27 '21

Yes, and it feels great. Makes me feel proud of my skills, notably so if I've been feeling especially dumb.

2

u/tehkitryan Jun 27 '21

Thats called "getting better"

2

u/TheBenevolentTitan Jun 27 '21

A TLB cache look-up for any process is almost always a miss the first time. It's only the subsequent lookups that generates a hit.

3

u/YellowFlash2012 Jun 27 '21

It takes so long because it hasn't yet become a habit.

Have you ever seen a sculptor sculpting? A painter painting? They look like geniuses, right? But have you seen their beginning?

Have you ever seen a baby struggling to stay balanced on their 2 feet and then put 1 foot in front of the other? But you, you don't even think about, you just stand and start walking.

The learning curve is the same for babies and adults. It takes repetition for it to become a habit. From then, you can do flawlessly & look like a genius.

Conclusion: every master was once a disaster.

1

u/nawakman Jun 27 '21

I love this sentence, it's full of wisdom

2

u/Cunicularius Jun 27 '21

Usually it means you had to learn something new.

2

u/JBlitzen Jun 27 '21

The easiest time to start writing a book is immediately after you finish writing it.

2

u/ethanfinni Jun 27 '21

Every.Time.

But next time I have to do it, I am significantly faster. This is also known as the "learning curve".

2

u/doughlas01 Jun 27 '21

A few months back i was trying to scrape a website for some data but for that i had to bypass user authentication and a captcha every time

I was using selenium with python

i spent 6 hours on google , stack overflow and mozilla developer documents just when i was about to give up i decided to give it a final try after few more minutes of brainstorming and google searching a video of selenium with java recommend on my youtube home page after watching that video i optimized that java code for python and it took me only 3 fu#king lines of code and 5 minutes to complete the rest ot the project

But when my code ran and completed the task the feeling was priceless

2

u/53-44-48 Jun 27 '21

If your management understands how estimates work, you'll never truly have a problem. In software, we estimate how much time or effort it will be to do something that you haven't done before. Sometimes you'll be faster and sometimes you'll be slower...the true tests of your ability are whether you got it working and whether the next guy will understand what you did when they encounter it.

2

u/redditorTestorusus Jun 27 '21

As almost everyone else said, but to emphasize it: That's how learning works! And also always remember as how often people say "It's not that hard. You simply have too...", when their doing something great/seeming very hard and being asked how they've done it. Everything is easy so as long as you know how it works/what to do!

2

u/[deleted] Jun 27 '21

Yes, that's called learning. Don't sweat it - I've been developing professionally for 15+ years and as a hobby for 30 and I still get this.

From the outside, generally speaking people will still think you've done it fast because they only see the output, not the effort and mistakes you've put in. If you work at a place that consistently belittles you for this, it's probably a sign that you're in a toxic work environment.

2

u/[deleted] Jun 27 '21

Also, one thing I always tell people I'm mentoring - if you're struggling with something, take a walk. It's amazing how often I leave my desk for 10 mins and solve the problem instantly by looking with fresh eyes.

2

u/yusatreddit Jun 27 '21

That's totally fine. Now you're also learning more about the process instead of just knowing the result. People make mistakes and our growth is what's more important. Had you didn't believe in yourself and burdened by the words from other people, you wouldn't find the solution :)

2

u/pranay_bathini Jun 27 '21

Did you say hours. I read it as days*. And to answer the question, yes sometimes it does when you do something for the first time. With time, everyone will start to do better. That's the reason experienced Devs are paid more.

2

u/throwaway1_x Jun 27 '21

Happens way too often :(

2

u/Grubzer Jun 27 '21

If you are trying to find a path in a labyrinth with a map in your hands, it is easy to find an exit path and take it. But in real life in many tasks you get this map only when you find an exit by yourself, and map out all dead ends, shortcuts, and looparounds. When you finally reach the exit, shortest path is clear and self-evident, but it is only because you have a map of the labyrinth. Past-you did not have it, and what seems clear now was unknown to past-you.

When you are doing some task first time, you dont know what paths are right, what are wrong, what paths are faster than others. But when you complete it, it is easy to look back and see the path that took you to desired solution, forgetting about how many paths you had to try and check out before finding the right one.

2

u/TechnoGeek423 Jun 27 '21

In my course there was a loop pattern program that literally stumped me all night. Finally, I hunkered down and forced myself to get it done.

I got it done and it was 100% correct. When I look at the code now it’s only about 20 lines. However there was a LOT of logic and thought process in those 20 lines.

Sometimes it’s not about how much code but about the quality of your thought processes.

2

u/agorism1337 Jun 27 '21

When you feel this way, you really just want to stop wasting time on this and move on.
But you shouldn't move on. These moments are big opportunities.
You should reflect on what went wrong in your programming that caused you to waste time. Maybe a simple change in your programming habits would prevent this kind of thing from happening again.

2

u/Sekret_One Jun 27 '21

Yes. This is normal starting point. I've had these exact same fears and anxieties. But I found a way past it.

Note- this doesn't really go away- or not in the way you're probably expecting. You won't achieve some unwavering confidence and just in a straight line write what you need to write. This is a delusional expectation, produced by people that don't program, or picked up accidentally say by watching tutorials and seeing them breeze through (overlooking that they've literally been practicing this precise thing to show it to you).

So- the reality is you'll be uncertain, and that's okay, and you'll clear away the uncertainty.

What's the Sherlock Holmes' quote? Remove that which is impossible and the truth will be all that remains? Same basic idea.

So, the change in strategy is not to be preoccupied with the 'right way' but learning how to quickly try things, gauge them, and then adjust. You won't "not make mistakes" but rather make and move away from mistakes so quickly you end up at the solution way before someone crippled with the need to get it.

Some mental imagery that might help you loosen up. A lot of times, people think of programming as building . . . but perhaps better to frame it as seeking. You're looking for something, which means it's okay to search in places it's not- you want to hone your seeking ability.

Like if you were a detective and searching for evidence; there's no reason to feel like a fake or you're too slow because you looked in a spot and didn't find anything relevant. In fact, it's incredibly important that you thoroughly exclude things. Sure, you'll learn improvements, but it would be insane to expect that you'd always know where to look in advance. That's expecting prescience or perfect guessing.

1

u/Evol_Etah Jun 27 '21

It's normal. Don't you remember how long you took to solve a BODMAS problem? Look at us now.

1

u/FrostedNoNos Jun 27 '21

That's just my process

1

u/Odd-Frame9724 Jun 27 '21

Yes. All the time

1

u/geekgeek2019 Jun 27 '21

Then I'm gonna compare myself to my colleagues and feel shit about how slow/less proficient I'm

1

u/ridingduc Jun 27 '21

Like every assessment I have ever had to do ever.

1

u/kstacey Jun 27 '21

Dude all the time.

1

u/stillragin Jun 27 '21

Living on the knife's edge of dumb and discovery every day. That just how it is.

1

u/the_monkey_of_lies Jun 27 '21

Things are always obvious once you come up with the answer, but rarely before. Don't worry, this is completely normal.

1

u/DefiantFrost Jun 27 '21

I understand where you're coming from where you say it's a blow to yourself esteem, however I have some advice.

How about instead of looking at it and thinking "Why the fuck did this take me so long?" why don't you look at it like "Man this is so much easier now, I'm getting better".

It's like going to the gym, if you do a 100 kg deadlift or something for the first time you don't think "why did this take so long", no no, you're pumped that you're getting stronger.

What you're describing is tangible evidence that your skills and knowledge are improving, why lament this, celebrate it.

1

u/[deleted] Jun 27 '21

Not at all, not anymore anyway. I used to until I had an epiphany a few years ago. Learning a new skill or task always takes a little longer, it does not reflect how smart or clever you are, so don't let yourself go to that negative place.

1

u/[deleted] Jun 27 '21

Nope, happens all the time and it's the best way to learn things and progress :)

Don't be hard on yourself! If you need more tips and just reassurance - you can message me. I've been working for 5 years now in a known hightech company and I feel like I've grown out of having the impostor syndrome to actually feeling like I'm valuable.

1

u/[deleted] Jun 27 '21

Yes its most often when I am writing statically typed language. I work a hour to implement thing and when I look back it was just 30 lines of code. I also rewrite few times to make things work. This happens to me mostly when I write static languages like rust maybe because I fully don't understand it šŸ˜…. But I didn't feel bad. But I just told what I noticed.

1

u/OliveMission Jun 27 '21

Thanks for bringing this up, I have been struggling with this feeling all week after completing a project for school. Now that I’ve finished, I feel dumb that it took me so long to figure out how to do it, and I feel even worse that I didn’t do it a different way to begin with šŸ¤¦šŸ¾ā€ā™€ļø

1

u/donkeypooper Jun 27 '21

Something something about standing on the shoulder of giants

1

u/spark-c Jun 27 '21

Would you believe I spent hours writing systematic regex code to convert a 6-column .txt data file into usable format?

"Wow," I thought, "strange that they would just dump all this data into a .txt... Weird."

I realized after the fact that the file was, in fact, formatted as a .tsv (csv but with tabs instead of commas) but just had the .txt extension.

Hours spent. I felt like a NUMPTY!! I had used this opportunity to write my first fully type-annotated Python script though, so it was a good exercise regardless.

1

u/Shipwreck-Siren Jun 27 '21

Yeah but for me it’s because I’m learning to do something for the first time.

1

u/[deleted] Jun 27 '21

All the time, and I've been doing this for 30 years. You just have to learn to be pragmatic about it--there's times when that feeling is indeed a good prompt to take some time and try to see if there's a better way of doing whatever it is you're doing, but oftentimes it's just self doubt being noisy.

Also, the fact of the matter is, even seasoned professionals find themselves looking at work they've done, shaking their heads, saying "it took me how long to do this?!" Sometimes you just screw it up pretty bad, or you get hit with some Daffy Duck-level bad luck and stuff just ends up taking way longer than you think it should have. That happens, you learn what you can, if there's anything to be learned, and move on

The important thing is to not get too far into your own head about it. If there's a good lesson to be learned, or a process that you can improve, then do that. If it took a long time because every other step you took resulted in you getting smacked in the face with a rake or exploded by a landmine; or that's just how long it took then there's nothing really to worry about because that's just how things are. You see a lot of stories like that when you read stories written by developers who worked on various significant software projects. You'll have other times when you will start working on something thinking that is going to be really tough and you end up breezing through them.

You see funny stories about it in game development a lot, where thanks to some clever method something that seemed really hard was miraculously completed in one very long but productive day, but then some mundane thing ended up taking an inordinate amount of time for some comically absurd chain of reasons.

1

u/[deleted] Jun 27 '21 edited Jun 27 '21

Have you ever heard of the windmill problem?

Famously, it proved a fundamental fact about learning.

If you don't already know the correct answer, there are an infinite number of wrong answers, and therefore an infinite amount of time can be spent trying to find it. It could potentially be impossible to solve.

If you already know the answer, it is impossible to gauge how hard the problem is for people who don't know.

This holds true even amongst the smartest people in the world. (the windmill problem was originally observed in a math olympiad.)

1

u/evilplantosaveworld Jun 27 '21

Oh man this happens to me all the time, then tack on when you spend hours figuring something out using loads of code to do it, then in a tutorial a week later someone just casually uses a function you never heard of and didn't know the name of to look up, to do what your thirty lines of code does in like five.

1

u/BigBrotato Jun 27 '21

Sometimes your brain just feels exhausted. During those times, all you need is to get your mind off coding and get some rest and approach it again with a fresh mind.

I remember trying to tackle a particularly challenging little problem for hours and not succeeding, and then getting a good night's rest and getting it right first try.

1

u/Lord_emotabb Jun 27 '21

It's always so clear when find out how to do it... like it was there all along

1

u/Niku-Man Jun 27 '21

I always find myself wanting to understand something completely or just see what's possible before I finally do the thing I need to do. Like I'll try fifty different inputs, different variables, try writing it more efficiently, all of which ends up taking a long time when I could've finished in 5 minutes. It does give me better understanding of things but it can feel like I'm out of time too often

1

u/CringeName Jun 27 '21

That feeling is one of the main things that drives me to continue. When I look back at something past me struggled with and future me can do it no problem, that's progress. That's learning.

1

u/Keep_IT-Simple Jun 27 '21

As an amateur myself. Idk if you mentioned that you wrote out your code or not prior to actually coding. But that is something I learned the hard way that you need to do.

Don't just think like a programmer. Think like an engineer.

1

u/redknightrises Jun 27 '21

I think it is like the solving the shortest path algorithm with breadth first search. You just looking a lot of ridiculous thing and once you get the destination, you just backtracking easily with feeling how this took so long. But it is a necessary procedure for learning

1

u/[deleted] Jun 27 '21

Nah. That's just how it is sometimes. 2 hours to figure out you needed to delete a comma in your json doc.

Best solution I've found to this though - unit tests and modular programming. So many people roll their eyes about unit tests, but if you can isolate a problem to one section of code, you cut your debugging time by hours. I'd say I don't know how anyone programs any other way, but I do know - badly, and with much frustration.

1

u/the_stuffit_inn Jun 27 '21

No. If you read the documentation and implement and it doesn’t work it’s the library/bug. ā€œJust do thatā€ is a hack until the developers fix the BS

1

u/sephrinx Jun 27 '21

I used to do this a lot especially in the early stages. I'd do some overly complex convoluted bullshit, and then a eek later realize I could have just done X instead and save 300 lines of code and 4 custom methods and other bs.

It's good to have done it as it gives good experience and trouble shooting. Knowing shortcuts and time savers is always nice, however.

1

u/[deleted] Jun 27 '21

Yup...setting up my own build-system for different languages in Sublime text

1

u/Blackwingedangle Jun 27 '21

When you're building a game on AMD a6, 4gb ram and no graphic card, then yes everything is too long

1

u/RisickWinters Jun 27 '21

Youre describing my normal work day.

1

u/Blackhaze84 Jun 27 '21

It happened to me the first time I used classes inheritance. I tried for hours call a parent method from child object. No way. That day I learned how construct functions calling work (php)

1

u/Naetharu Jun 27 '21

Solving a puzzle is often much more difficult than verifying a solution is correct. Which can make it seem "easy" once we see a solution in place.

Thus is quite normal.

For more thoughts on this dig into the P vs. NP issue which cuts to the heart of why this is the case.

1

u/CryptographerMore926 Jun 27 '21

Its the ikea furniture effect. My mentor told me this one and it helped me frame these moments more positively. The first leg of you ikea table takes the longest. You look at the picture. You try to assemble, maybe it works, maybe you look at the picture again, you finally get it and attach the first leg... then you proceed to simply assemble the next three. The first route on my restful api in js took the longest. I had to figure out try catch, I had to learn async await. The next one I just did.

1

u/MakeThingsGoBoom Jun 27 '21

All the time. I'm working on a project that i had thought i could use a few different code bases on and in the end i had to stick with one and figure out the rest of the implementation my self. Sucks!

1

u/ZukoBestGirl Jun 27 '21

Imagine the opposite. You spend mintues to implement something, then you look back and say "there's no way that's right".

Does that sound like progress?

1

u/mrchaolee Jun 27 '21

It's happening all the time, I guess it's just an imposter syndrome.

1

u/janman27929 Jun 27 '21

I hit code sideways like a bull in a china shop. Don't be afraid to blow shit up .... build it up, break it down and then build it up again...Have fun with it ..."twist it, bop it ...."

Get up on Test Driven Development (TDD) and start small and build up ...30 second cycles between working code and failed code ... gives you a shot in the arm when you are feeling discouraged.

Use your debugger for good. Learn how to set breakpoints in simple programs. Examine all the variables around it ..start tweaking ...blow shit up and figure out why... then wrap code around it to prevent it from happening in real world

Get up on CleanCode... only hit variables thru a sub...u will appreciate it when u get to mocking..Your subs are only 5 lines long max... braces are bad ... replace code in braces with a sub.

No docs, just descriptive subs and var names...Check out Bob Martin, Uncle Bob, and his clean code series of books. His videos are gold, expensive but worth it. Not for beginners but should be ...learn it right from the start.

Get up on Kata's ..simple small program which acts like calisthenics when u got to drag yourself to the keyboard ..." I will do this for just 5 minutes. ...."

"Where there be loops, there be tracers" ... always drop prints before, during, and after any loop, ensure the prints display interesting variables

Remember small is king, don't be cheap with classes and have unit tests for everything ... even starting out

Sorry if this is too off topic but I hope this helps

1

u/viperjay Jun 27 '21

yes!!! I notice this also in driving to and then back from a destination. Why does it seem so much quicker going back home?

1

u/[deleted] Jun 28 '21

Practice makes perfect and deliberate practice makes excellence.

Yup, some things take a ton of time. But over time you get quicker. It can still be challenging though. You’re not always gonna be quick. It’s a tough balance.

I have a similar worry because I’m an ā€œolderā€ dev and I don’t want people to stereotype me if I’m slow. The industry is rife with ageism. So I tend spend my spare time learning and practicing coding. On average, I’ll dump like 20 hours additional, each week into learning how to do things quickly. Because it worries me a lot if I’m slow.

Young and slow = they can learn.

Old and slow = can they learn?

It’s tough but necessary. If you’re young, don’t worry too much about it. If you’re older… (40+) keep in mind, the industry has a very heavy bias against you.

-1

u/[deleted] Jun 27 '21

These regions need to control there population growth rate as resources are going to be scarce especially egypt

60

u/[deleted] Jun 27 '21

[removed] — view removed comment

4

u/Wingout Jun 27 '21

I like this, interesting perspective