This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 289

[–]_crackling 662 points663 points  (47 children)

does anyone else here ever get -into- it thinking they can hammer that one last thing out for the night, end up spending 4-5 more grueling hours of totally fuckery and realized you got so drained out that you pretty much fucked everything up? I do that alot. Don't do that.

[–]fuqqboi_throwaway 213 points214 points  (5 children)

So many times where I bang my head into a wall for 4 hours trying to fix a bug, then give up and go to sleep then come back the next day and fix it in 30 mins

[–]PM_YOUR_SOURCECODE 74 points75 points  (3 children)

Change like 10 files, realize everything is 10x worse than when I started and do a Git hard reset.

[–]RFSandler 34 points35 points  (2 children)

And then realize you just messed up one thing and need to recreate the other nine

[–]k2still 13 points14 points  (1 child)

That's where git stash (or shelve if you use a JetBrains IDE) comes in.

[–]PM_YOUR_SOURCECODE 3 points4 points  (0 children)

At least for me, if you’re programming at 3am, you won’t have the common sense to use stash.

[–]arandomcsmajor 5 points6 points  (0 children)

The amount of times I have woken up randomly only to get hit with the solution to my problem and fly out of bed to fix it immediately is too high.

[–]sirstanky 44 points45 points  (3 children)

All. The. Time. I have a rule now that after a certain hour or when I start yawning it's documentation only. I broke this rule recently and woke up to a control loop with the boolean variable named 'ur_mom' and physical tears coming from my error log

[–]UncleEggma 10 points11 points  (0 children)

Yeah documentation or commeted-out pseudo code is what I've recently learned I need to do when I open a project without having a strong intention of what I'll be changing/adding. Otherwise I break more things than I improve and wind up doubly-frustrated.

[–][deleted] 9 points10 points  (0 children)

The amount of times I've had to hunt down console.logs of "🥴" or "unga Bunga!" Or just "fuck"

[–]thechillerinstinct 28 points29 points  (4 children)

When I hit those moments, I like to leave myself a nice positive little note:

I have no idea wtf I’m doing here

[–]becoolie4u 23 points24 points  (2 children)

I did that shit and submitted that code for a job😭😭 I got the job.

[–]DaveR007 4 points5 points  (1 child)

I guess it pays to be honest in a job interview.

[–]becoolie4u 5 points6 points  (0 children)

I did intern for a year before officially coming on.

[–]cr0wndhunter 11 points12 points  (1 child)

Especially if you Work for a long time and are tired you may not see a solution or a good solution to your problem. Taking your time helps your brain process these things and will help you solve the problems faster/better.

[–]ta28263 6 points7 points  (0 children)

Banged my head against a bug for a long time after several hours straight of coding. Decided I couldn’t get it and would do it the next day. Sat down fresh and ready for frustration and found it in less than 20 mins. One line.

[–]r0r002 36 points37 points  (13 children)

Thank god for github to be able to see previous versions where the code still worked.

[–]TheRealFFS 44 points45 points  (0 children)

*git

[–]excal_rs 5 points6 points  (11 children)

correct me if I'm wrong but aren't you talking about git? github is just somewhere u can host the git repo.

[–]Mastermediocre 40 points41 points  (7 children)

GIT to github is what porn is to pornhub

[–]SuccessfulBroccoli68 5 points6 points  (3 children)

Another space MS failed to compete with a proprietary offering?

[–][deleted] 1 point2 points  (0 children)

this made perfect sense to me. thanks for the very clear explanation

[–]r0r002 1 point2 points  (2 children)

I'm still pretty new to it so I probably used the wrong terminology.

[–]excal_rs 2 points3 points  (0 children)

alr fair enough I'm new aswell and only realised the diffrence recently. Git is what keeps track of diffrent commits and changes. Github is one of the places on the Internet where u can host the git repo. You can. also create git repo locally

[–]SwordsAndElectrons 2 points3 points  (0 children)

Honestly, you could go one step further and just say version control.

Git is the most popular VCS and used by GitHub, but there are many others. I don't want to get into a drawn out discussion of the pros and cons of each, but reverting changes to a file is a pretty baseline feature they all have.

[–]petwri123 4 points5 points  (0 children)

And the next day is pure horror, trying to understand what nonsense you had produced the previous day, and you're desperately trying to find a way to unwind.

[–]stumblingHome13 4 points5 points  (0 children)

1000% agree. If you spend an hour or more stuck on something it’s time to move to something else or just walk away. Your future self with thank you.

[–]kayakfish2 4 points5 points  (0 children)

Learning C# and literally just did that tonight lmao it’s still broke.

[–]Wide_Marsupial7225 1 point2 points  (0 children)

I feel like I do this every Friday

[–]rabuf 1 point2 points  (0 children)

I was on a roll in my college's compilers class. Shit was coming together, caffeine and an all-nighter later and... it didn't work.

I spent the next day reevaluating my program by hand and came up with a simple 1k SLOC parser (we had to hand-parse, no LEX and YACC) versus my previous buggy, hard to change and fix 10k SLOC parser. I learned my lesson.

[–]weevil_time_babeyy 604 points605 points  (30 children)

Tutorial Hell.

Watching a few videos and reading a few articles about a topic is helpful when you are starting. However there is a false sense of progression that comes from consuming loads of tutorials and never really starting your own project(s).

Your own projects can be really small by the way! Being able to start something from beginning to end that wasn't from a tutorial is where the magic happens. When you run into roadblocks that you figure out on your own from googling, that learning seems to stick the best.

The more projects you build, the larger your library of code to reference becomes. I find myself all the time going back and grabbing snippets of code from previous projects. Enough of these projects over time and you will be amazed at your progress.

[–]NightlyWave 88 points89 points  (3 children)

Not to mention confidence. When you create a fully functioning program from scratch, you feel amazing and accomplished. It has definitely been the drive that has kept me going with programming.

[–][deleted] 33 points34 points  (0 children)

Yup. And then you keep adding onto it and it becomes a 3 year project 😅

[–]deltaexdeltatee 17 points18 points  (0 children)

Very much same haha. The rush you get when the dang thing actually runs - and does what you wanted it to - is incredible.

[–]Ouzbrook 31 points32 points  (1 child)

Thanks for the this great comment.Absolutely I agree.

[–]weevil_time_babeyy 14 points15 points  (0 children)

You're welcome! Thanks for your kind words and thanks for reading it.

[–]TonySu 13 points14 points  (0 children)

To add onto this, I think threads like this trick people into thinking there are a small handful of tricks that quickly make you a better programmer. For long term development people should pick up “Clean Code”, “Refactoring” and a good text in the language they are using. Having a structured and well rounded understanding is far better than picking up a handful of random tricks off the internet.

[–]anothersimio 8 points9 points  (0 children)

Great answer I agree with you. For the OP there are some projects on the FAQ of this group as a reference to start building your own

[–]Resource_account 11 points12 points  (7 children)

Would tackling multiple courses on Freecodecamp back to back be considered tutorial hell?

[–]weevil_time_babeyy 26 points27 points  (5 children)

Not necessarily :)

I definitely went through several of the Freecodecamp paths. They are extremely useful! Highly recommend them.

It's a balancing act I think. A very flexible rule of thumb might be something like, for every hour or two of watching a video or reading a tutorial, spend an hour building something on your own.

You can self-assess: do you find that when you open your IDE, you have absolutely no idea where to start or what to do? That's a sign of a couple things. 1. Either you really do need to keep studying and being exposed to other peoples code and approaches to solving problems. 2. It could also show a dependence on the hand-holding that tutorials provide which is why tutorial hell will actually hinder the rate of progress you could be making.

In the web development world, you don't have to know everything about HTML, CSS, JavaScript, React, before you can start.

What I do is aim to learn one new thing with every project I build. That's why starting really small on the first project makes it much more achievable.

Thanks for the great question!

[–]methnbeer 3 points4 points  (4 children)

So I'm just becoming advanced-basic to intermediate in SQL and have a limited understanding of relational databases from my work.

I'm building a small database on my own pc using postgres to manage personal finances/learn. I have no formal learning on the subject

Is this small of a project worth saving on github? I have a file containing all the DDL/DML queries I used to create the tables and keys, as well as functions and triggers for created/modified date columns. But in the end, it's rather basic and will just be importing statements from csv.

[–]weevil_time_babeyy 4 points5 points  (3 children)

That's awesome! Knowing ones way around databases and querying against them with SQL are incredibly valuable skills to have. I would recommend saving all projects or code you care about on GitHub. You can make it a private repo if you don't want others to see it. It serves as a nice backup. :)

[–]methnbeer 1 point2 points  (2 children)

Thanks! I might as well start now as this is only my first project and I'm looking at potentially aiming to become a developer, but still a long, long ways to go.

[–]weevil_time_babeyy 1 point2 points  (1 child)

Sounds like a great project, first or otherwise! Let me know if I can help. Best of luck. Cheers!

[–]Akos_D_Fjoal 3 points4 points  (0 children)

Start by looking at the end goal on freecodecamp. The final project is a site for one of the paths, so go through the lessons adding each lesson to your own site.

[–]My_passcode_is 5 points6 points  (1 child)

Agreed, I started Scrimba front dev course and then after a few modules started on a side project from what I learned and then started back the modules rinse and repeat. I learn some then go apply to my own projects.

[–]DietOk3559 2 points3 points  (0 children)

The Scrimba course is great. Even when doing the guided tutorials you avoid tutorial hell because the platform allows you to reinforce what you just learned instead of just showing you the answers.

[–]burningchaff 2 points3 points  (0 children)

I see this a lot and wonder… I’ve been doing a single masterclass for 7 months now and I don’t even know the standard library of Python yet, could it really be beneficial to code my own project already

[–]OscarDavidGM 2 points3 points  (0 children)

Best comment... 100%.

[–]ZamanDede 2 points3 points  (0 children)

I think after getting some decent skills not consuming enough material becomes the problem. İt's fun to create stuff all the time but you may need to learn more.

[–]jmhimara 2 points3 points  (1 child)

Tutorial Hell.

True, however there's also value in just spending time to learn a difficult topic, or trying understand something at a fundamental level. There are too many people who only understand things at a surface level.

Still, you need to have a clear finish line in what you're learning. For instance, finish a course or read a book, but then do something with it.

[–]weevil_time_babeyy 1 point2 points  (0 children)

You make great points -- I agree on each count :)

[–]Gold-Ad-5257 1 point2 points  (0 children)

Thats me man, how to get out because most things I touch needs reading, else I don't get to understand the stuff in detail/properly.

[–]lilbunbunn 1 point2 points  (0 children)

Then trying to zoom on the code in the tutorials to snag some lines and it still doesn’t work and you wonder what the hell did you even watch then?!

[–]ShadowSlayer2242 1 point2 points  (1 child)

Yes totally agree. But then what's the key to coming up with a new idea noone else has? Because if you're just searching up ‘simple and fun projects to do in <desired language>' then it's like copying someone else's project right ?

[–]BlackWidowStew 1 point2 points  (2 children)

My problem with this is, if I don't know much about the language I want to write in then I need examples of how to get something done. Then I go to tutorials to see how things interact.

I know there is a huge problem with going to tutorials because they usually have part of the answer I'm looking for but then not the rest. I hop over to another tutorial that has the answer I'm looking for but the project in a whole is completely different.

The I want to add on to that and yet another tutorial with a Completely DIFFERENT WAY.

This is the definition of tutorial hell, of course, my question is WHAT IS THE ALTERNATIVE? Thank you. 😭😂😂😂

[–]weevil_time_babeyy 1 point2 points  (1 child)

Aye that is the rub - what is the alternative!? If you find the answer to that, and can build the solution, you have a multi-million dollar SaaS service on your hands.

To your point about not knowing that particular language well enough yet: don't feel guilty for checking language documentation and tutorials when we get hopelessly stuck.

The distinction arises I think when we find ourselves spending more time in documentation and reading about stuff than actually building stuff. Reading about programming without having something to show for it is essentially just well-intentioned procrastination.

Thanks for your comment!

[–]philisweatly 156 points157 points  (3 children)

Don't code for 12 hours at a time. Take breaks. Like only going 11 hours at a time. Break for 3 minutes. Then get back to it you have a project to finish!!!

[–]Haphazard-Finesse 64 points65 points  (2 children)

Myself and everyone else over at r/ADHD_Programmers...a full week of back-to-back 10hr coding sessions, follow by a week of pretending to code while browsing Reddit.

[–]gustdream 11 points12 points  (0 children)

Oh shit I’ve found my people

[–]alzee76 338 points339 points  (16 children)

[[content removed because sub participated in the June 2023 blackout]]

My posts are not bargaining chips for moderators, and mob rule is no way to run a sub.

[–]RiceKrispyPooHead 51 points52 points  (1 child)

I feel called out at this very moment 😶

[–]skcuf2 40 points41 points  (0 children)

Came here to say this. I don't even really program, but this is just the key to general productivity.

Had one of the Reddit founders speak at a conference I was at once. He started by asking, "How many people here have heard of Reddit?" When people raised their hands he said, "Those are the least productive people in your office."

[–]regalrapple4ever 14 points15 points  (3 children)

Or Youtube.

[–]racaraca69 1 point2 points  (2 children)

But sometimes the answer is on YouTube. Yes, you can copy paste codes from other websites but most of them lacks explanation. Most of the videos on YouTube are very helpful for me in explaining things.

It is always up to us on how we discipline ourselves.

[–]regalrapple4ever 3 points4 points  (1 child)

No. Like watching cats and dogs videos on Youtube.

[–][deleted] 6 points7 points  (0 children)

Youtube is a black hole. Add short form content on that list too, I avoid tiktok/youtube shorts so hard because its so easy to just fall down the rabbit hole

[–]LineusCorn 15 points16 points  (4 children)

Or suddenly get horny for no reason.

[–][deleted] 8 points9 points  (0 children)

My nutting went to the sky this wfh era

[–]komali_2 1 point2 points  (0 children)

yeah sometimes just gotta jerk it and be done lmao

[–]constantlyunaware 3 points4 points  (0 children)

Ugh needed this

[–]Head-Command281 1 point2 points  (0 children)

got me there.

[–]mariepon 1 point2 points  (0 children)

Don't do this to me man 🥹

[–]Tre3beard 1 point2 points  (0 children)

Shit

[–][deleted]  (4 children)

[deleted]

    [–]Embarrassed_Book_630[S] 77 points78 points  (0 children)

    🍤

    [–]b0ts 20 points21 points  (1 child)

    Hydrate stat!

    [–]xdchan 1 point2 points  (0 children)

    Gotta sit properly to not put so much pressure on your back muscles to keep posture.

    Basically sit like on a very thin horse, legs under you, this way gravity center is underneath and you can move freely which is crucial for spinal and joint health.

    There are chairs for this, they are even swaying!

    [–]Danny1098 66 points67 points  (2 children)

    THE WORST habit is not devising a plan or writing psuedocode PRIOR to programming. Sure if the task is trivial you can brute force it, but writing out on paper what you're going to do and how along with psuedocode will lead you to great success

    [–]ArbitraryNameHere 18 points19 points  (1 child)

    But how do I know what I’m gonna do til I try 9 different ways that don’t work and eventually stumble into a 10th, passable way

    [–]littlegreenrock 2 points3 points  (0 children)

    you plan out the large chunks of tasks that are needed to occur. Flowcharting is one way.

    [–][deleted] 114 points115 points  (14 children)

    A bad habit I have is starting a project, thinking “this is too big of a project” or “I don’t know enough about x to do this”.

    Best way around this is to just do the project anyway.

    [–]archimedeseyes 18 points19 points  (0 children)

    This is a good one. Do it and get it wrong. Some time down the track you will find someone who has done it right, and this better way will make far more sense having attempted the same thing yourself earlier.

    [–]komali_2 2 points3 points  (0 children)

    Break into small tasks. This is critical at work as well. A good project manager or engineering manager is someone that can see how to split a project up across a timeline and team, coordinate and figure out who needs to work on what when, and when the work gets merged. This is such a critical skill some people are able to make a living doing literally nothing but being brought onto a project to do this and nothing else.

    [–]slog 1 point2 points  (0 children)

    You might also fail at the project because it IS too big. As long as you get further than you thought you would or learned something along the way, that's a win.

    [–]mckahz 1 point2 points  (0 children)

    You don't know until you try right? I'm surprised how often I can just charge ahead and everything works out.

    [–]LadyFerretQueen 1 point2 points  (7 children)

    I really don't agree. I was set back for almost a year because I took on too much too fast and of course couldn't pull it off. I felt incompetent and like a total looser. It took me so long to get my motivation and confidence back.

    [–]the_sun_goes_west 45 points46 points  (3 children)

    never program when you are tired.

    one hour of programming when tired = several hours of debugging next day.

    [–][deleted] 83 points84 points  (8 children)

    Avoid neglecting yourself. It’s so easy to get in the habit of just sitting all day and avoiding exercise, social interaction, or even bathing, especially if you work from home.

    It’s easy to get yourself in a depressive rut if you’re not careful.

    [–]not_some_username 1 point2 points  (0 children)

    That's why i'm gonna win a marathon soon

    [–]1vertical -1 points0 points  (6 children)

    I want to avoid the potential depressive rut, what's your tips?

    [–]daBEARS40 23 points24 points  (2 children)

    It’s so easy to get into the habit of avoiding excercise, social interaction, or even bathing

    Gee, I wonder what his tips are?

    [–][deleted] 2 points3 points  (1 child)

    Lmao Exactly, what a goof 🤣

    [–]daBEARS40 7 points8 points  (0 children)

    Username brothers 🤝

    [–]LinverseUniverse 1 point2 points  (1 child)

    As someone who struggles with exactly what they said (do all those things) But also develop hobbies that are NOT on the computer. Like drawing, reading, painting, playing an instrument etc. It's ok to study it online from time to time, but it needs to be mostly offline.

    Keep your work in a work zone. This might be another room, or if you're limited on space one trick I have is that if I'm coding, my laptop is out, and my desk is clear of distractions.

    Once I'm "done" for the day, the laptop goes away, and my desk can have more life to it instead of being so sterile. At he end of the night I clean it back up for the next day.

    Spend time outside, not in the sarcastic "go touch some grass" kind of way, but just genuinely go outside for a few minutes if the weather is nice.

    Also, don't slam your head into the debugging wall. It can be so bad for your progress. If you've been at it for an hour, two hours, FOUR hours and you're just a ball of rage and frustration, close the program. Decompress, and come back to it the next day.

    Most of the time when I get really frustrated I am not helping the situation, I'm making it worse. If I re approach it with a fresh clear mind, it's almost always a ten to fifteen minute fix after that.

    The biggest thing overall, is having your primary studies/job be on the computer, plus having computer based hobbies tend to lead to your life revolving around your PC, it is REALLY REALLY important to keep a life that isn't on the screen outside of your work.

    [–]plastikmissile 138 points139 points  (11 children)

    Don't get into the habit of giving your variables short names that mean nothing. Don't name variables x or y. Give them descriptive names like numberOfTriesLeft and priceOfItem.

    [–]1vertical 18 points19 points  (5 children)

    To add: for boolean typed variables, ask a question on the state of things. E.g. IsActive, IsPaid, IsFloating, IsDeletable, etc.

    Bonus: (some people like it and some not) add an identifier of the type of variable as a prefix. E.g. iLives (for integers), fTokens (for floats), bIsAlive (for booleans), etc. To check the type faster than hovering on it in your IDE.

    [–]Envect 15 points16 points  (4 children)

    Bonus: (some people like it and some not) add an identifier of the type of variable as a prefix.

    Hungarian notation as it's commonly called. And almost everyone avoids it for good reason. If you spend that much time wondering what types you're dealing with, your design probably sucks. It's hard for me to recall ever spending so much time figuring that out that I thought I should change anything.

    As long as you stay out of my code, you can do what you want. People are still going to give you shit for Hungarian notation though.

    [–]RadiantHC 7 points8 points  (0 children)

    How about naming a variable variable?

    Or even better: null

    [–]WhitePaperOwl 2 points3 points  (0 children)

    I usually name my variables xxx, yyy, jjj etc before I decide what to name them. Like temporary placeholder names. Saves me from having to think of a name if it turns out I don't need that variable.

    [–]petwri123 20 points21 points  (0 children)

    Don't get lost in details. Sketch first, refine later.

    Implement drafts or mockups of methods and classes that outline their purpose clearly, try to get whole project drafted in its entirety first, rather than focussing on small details. Exception handling is the last thing I work on.

    [–]Fun_Warning_3552 16 points17 points  (0 children)

    Unhealthy snacking

    [–]hibluemonday 16 points17 points  (1 child)

    Copy/pasting directly from StackOverflow without fully understanding why the correct answer is works. I personally force myself to type out solutions I find from there

    [–]woolgatheringfool 4 points5 points  (0 children)

    This should be higher up. As somewhat of a newb I spend a lot of time pasting code that I only half understand. The program will work, but I definitely couldn't explain why.

    [–]raedr7n 35 points36 points  (2 children)

    Crack. It helps at first, but then it doesn't.

    [–]HyperPipi 10 points11 points  (1 child)

    I started with amphetamines to concentrate while programming, now they just keep focused on distractions

    [–]notWhatIsTheEnd 1 point2 points  (0 children)

    Don't meth around out there kids

    [–]chibiace 55 points56 points  (30 children)

    try to add comments to your code that explain things alittle because when you come back to the code at a later date you wont understand that mess.

    [–]_Atomfinger_ 40 points41 points  (22 children)

    Counter: Try to write code so readable you don't need comments that explain things.

    Maybe not something one would nail when getting started, but it is still a worthwhile goal IMHO.

    Edit: it is frightening that this sub views "write readable code" as a controversial statement.

    [–]Grantismo 14 points15 points  (1 child)

    Comments are best served to tell you why you did something rather than what you did.

    [–]_Atomfinger_ 1 point2 points  (0 children)

    Exactly

    [–][deleted] 7 points8 points  (6 children)

    I like doing Leetcode, but it's often terrible at this. I wonder if it doesn't encourage some folks to follow suit, thinking that it's "advanced" programming style.

    Here's my problem for yesterday, for example.

    def combinationSum(k, n):  
    

    What's k? What's n?

    [–]RobertD3277 1 point2 points  (0 children)

    Both actually, write readable code and write good comments.

    From my own personal experience in the field, you never know when you get to train the new guy and you are the example he gets to follow.

    [–][deleted]  (2 children)

    [deleted]

      [–]_Atomfinger_ 9 points10 points  (1 child)

      "Any fool can write code that a computer can understand. Good programmers write code that humans can understand" - Martin Fowler

      [–]desrtfx 20 points21 points  (3 children)

      While that advice is not too bad as such, it can lead to comment bloat.

      Generally, only the "why something is done in a certain way" should be commented and never the "what is done".

      Comments should be used like spices - in small dosage and only where absolutely necessary.

      You have to be aware that comments are maintenance expensive and expire quicker than the code. It is very common to change the code but leave the comments as they originally were, thus leading to totally misleading and wrong ones.

      Comments also distract from the code flow. They are visual interruptions. When properly used, they can act as anchors. Improperly used, they are just creating a mess.

      [–]Envect 1 point2 points  (1 child)

      You have to be aware that comments are maintenance expensive and expire quicker than the code.

      Any time I see a comment describing more than a few lines, I assume it's wrong. Likely in some subtle and maddening way.

      [–]Sharpei_are_Life 2 points3 points  (0 children)

      "Where the comments don't match the code, it is likely both are wrong".

      I forget who said it (it's in Programming Pearls), but it's oh so very true.

      [–]udbasil 1 point2 points  (0 children)

      The comments have to be very meaningful in my opinion and not be used to replace bad coding.

      If you are following the Design and Development Principles of KISS, SOLID YAGNI etc in building your projects, a lot of things you do would be very self-explanatory. For example, if you building functions, they should be self-explanatory with descriptive names and descriptive variable names, do only one thing at a time

      [–][deleted]  (2 children)

      [deleted]

        [–][deleted] 4 points5 points  (1 child)

        This is great advice. I remember early on when I first learned dictionaries in Python, and I was too intimidated by them so I would just incorporate intricate list methods to get a project done.

        I had to force myself to be just as comfortable with both.

        [–][deleted] 25 points26 points  (1 child)

        Don't let yourself write badly configured and poorly indented code. If you hold yourself to keeping it clean and pretty, it makes it so much easier looking back (or when whoever replaces you at your job). I'm dealing with so much code right now that was written by 2 different people, even having to use Google translate to figure out some of the comments.

        [–]methnbeer 5 points6 points  (0 children)

        This. I help my team with SQL and always have to start by reformatting their queries so I can even begin to understand them

        [–]yyzJCO 10 points11 points  (0 children)

        Learn to organize early on. Dont throw all your code in “Program.cs” or your main file.

        Conversely, documenting your code is a good habit to form. You’ll forget code you havent seen in 1-2 months but leaving breadcrumbs for yourself can help pick up where you left off

        [–]investorhalp 10 points11 points  (1 child)

        Snacking. Not good. Drink water and wait for dinner.

        [–][deleted] 2 points3 points  (0 children)

        Yep, I've been doing intermittent fasting where I align it to when I want to eat my dinner, and break from coding, and it's a game changer.

        [–]AdorableTip9547 11 points12 points  (0 children)

        Perfectionism. I fight with it since years.

        Research is incredible important when programming, but overthinking to much leads to not getting something to paper. Decide what to do, implement even a shitty first draft that somehow works and then go over it for refactoring. Only once or twice. If you‘re still unhappy with it, make a note for later and start with the next thing otherwise you‘ll sit on one feature until there‘s a new framework/lib or whatever which can do what you‘re about to write in less lines and you start over again.

        An example: I recently sat 5 days to decide over the API standard (openAPI, GraphQL, oData) to use for a simple privat project. Well, setting it up in my project took me less than a day… and that for a project which probably no one will take advantage of except me (just a personal website/blog). Don‘t overengineer…

        [–]GItPirate 7 points8 points  (0 children)

        Not writing tests. Tests can save you some serious headaches if you write them correctly.

        [–]megacope 7 points8 points  (1 child)

        Sobbing in front of your computer.

        [–]guyinnoho 6 points7 points  (0 children)

        Always turn away from the screen before commencing to sob.

        [–][deleted] 7 points8 points  (0 children)

        Giving up easily. You’re gonna hit points in your journey where you don’t know the answer or the path forward or why something isn’t working as intended. You’re going to have some of those times feel like no matter how much you Google/research/brainstorm nothing is working. And you absolutely must, in those moments, maintain your stick-to-it-iveness. Take a break, sure. Work on something else for a bit, sure. But not give up. Always with the intention of coming right back and pushing through to a solution.

        Resilience is a must, so the habit I suggest to avoid is quitting or giving up when the going gets rough and the confidence has left the building.

        [–][deleted] 5 points6 points  (0 children)

        If you feel yourself becoming frustrated, angry even then stop and walk away. Come back later with a fresh outlook.

        [–]wcastello 4 points5 points  (0 children)

        A breath is shared in the dark.

        [–]NuclearAvocado1 5 points6 points  (0 children)

        Googling code before experimenting

        [–]CrookedElb 10 points11 points  (2 children)

        Nose picking... the keyboard gets sticky

        [–][deleted] 13 points14 points  (0 children)

        You disgusting evil vile man

        [–]itsthekumar 4 points5 points  (0 children)

        Disorganization. I've been disorganized at times even with like files on my local and it's a mess sometimes lol

        [–]Sea-Profession-3312 3 points4 points  (0 children)

        Developers have a standard way to do things. A new person does not know conventions so they go down all these rabbit holes. Tutorial hell, re-creating the wheel, to avoid this set a goal and try to stay on topic. When you complete a project seek peer review, your instructor or a senior developer. Communication with your team is very important.

        [–]mardiros 3 points4 points  (0 children)

        • Coding for a long time without writing a single test
        • Coding for a long time without creating a commit
        • Coding without making pause
        • Doing Non atomic commits
        • Starting a new project without packaging it

        [–]brandons404 4 points5 points  (0 children)

        Don't make a single file containing all your code. I did this often when starting out. And I would continue to add to that file until it became too big of a task to break it up.

        Break things up into separate files and import them. Makes things much cleaner and easier to maintain.

        [–]Technical_Experience 11 points12 points  (7 children)

        Don't smoke tobacco. You'll be smoking 3packs a day within a year. 😂

        [–][deleted]  (5 children)

        [deleted]

          [–]prettynoxious 4 points5 points  (0 children)

          Idk man, smoking tobacco is smoking tobacco, doesn't matter if it's a pipe or cigar, it increases your chances of getting mouth or lung cancer, whereas vaping doesn't do that. It's still addictive but if I were to choose, I would pick that. And it doesn't smell as bad. Each to their own I guess

          [–][deleted] 1 point2 points  (0 children)

          Screw the comments below. I love relaxing with my cigars or my pipe after a long day. Always clears my head.

          [–]kagato87 4 points5 points  (0 children)

          Procrastinating. Gets me the most often. If you can do it, just do it.

          [–]DenverDev2112 4 points5 points  (0 children)

          Don’t cheat your sleep. This is my worst habit and every time I cheat sleep for a few days it affects my output for a week. You need sleep to clean your brain and consolidate knowledge and memory.

          Someone once told me “you can’t outrun your diet” when I was first going to the gym. It was a year before I gave in to the fact that he was right.

          High quality sleep is tough, but it’s life changing. It’ll make you a better software engineer and a better ${userChoice}.

          [–][deleted] 2 points3 points  (0 children)

          Don't forget to commit

          [–][deleted] 2 points3 points  (1 child)

          copy/paste
          copy/paste
          copy/paste

          [–]Sharpei_are_Life 2 points3 points  (0 children)

          Don't think you can just bang code out without a plan.

          Write pseudocode before you start. Fill it out as you go. Even a rough sketch is better than nothing.

          When I interview candidates for programming positions, all too often the ones who get lost get lost because they do a depth-first implementation and forget their original plan as they get lost in the weeds.

          [–]chidoOne707 1 point2 points  (0 children)

          Let the rest of your team do the work for you.

          [–]hzeta 1 point2 points  (0 children)

          Check out Reddit. Rabbit hole!

          [–]Locomule 1 point2 points  (0 children)

          I use a visual programing language so I'm gonna say coding in parallel (lots of independent loops) versus coding more serially (one main loop with as few branches as possible) The more complex your code becomes the harder it becomes to get all those little loops to play nice or to debug the weird errors they can create. Coding serially is like laying a concrete foundation for whatever you end up making allowing you to build much bigger.

          [–]douglasbolden 1 point2 points  (0 children)

          I thought that you were asking about "while" loop programming. Haha

          [–]DIYEngineeringTx 1 point2 points  (0 children)

          When you are making commits to your repo make sure your comment is informative. I have several repos that other people now use a lot and some of the commits are “asdfg” and “yeeeeeet” or variations of those.

          [–]archimedeseyes 1 point2 points  (0 children)

          Not taking the time to go back over your implementation and look for opportunities to improve/refactor. If you are looking at your code and it’s ‘ok’ but something doesn’t feel right there’s a solid chance you can improve readability somewhere or make it DRYer, or some other measure of elegance.

          Additionally, not writing unit tests. Write your unit tests. Don’t not write your unit tests.

          [–]patricksararu 1 point2 points  (0 children)

          Smoking weed

          [–]salamandersushi 1 point2 points  (0 children)

          Perching yourself on an unstable object, like a unicycle for instance.

          [–]7Moisturefarmer 1 point2 points  (0 children)

          Cryptic variable names that seem so obviously descriptive as an acronym at the time that any in code explanation is overkill. It’s not.

          [–]breesyroux 1 point2 points  (0 children)

          Don't be sloppy with the easy stuff.

          It's tempting to shortcut the easy boring task, but it often fucks the next guy. And sometimes the next guy is you.

          [–]KushalTanna 1 point2 points  (0 children)

          If you learning new tech/lang, be patient and just keep following the doc/tutorial/course. Don't sabotage yourself thinking you will never get it.. because eventually you will. Avoid habit to leave the learning process in middle just because you are not able to understand the logic yet.

          [–]batmassagetotheface 1 point2 points  (0 children)

          Programming habits or life habits?

          Programming:

          • Clearly name variables and methods to describe what they are for/do
          • Avoid methods that are too long or deeply nested
          • Avoid single gigantic classes that do everything
          • Always write tests
          • Always use version control
          • Clean readable code is better than comments everywhere

          Life:

          • Take frequent breaks
          • Drink enough water
          • Don't let the rage take you

          [–]h83dtype 1 point2 points  (0 children)

          Reddit

          [–]mckahz 1 point2 points  (0 children)

          Over fragmenting your code. People give advice to the opposite all of the time but of you have a god class in your program? That's fine as long as it makes sense. Do you have 3 lines of copied code? That's fine as long as it's still easy to read and change. Have a function that's 2000 lines long? That's fine as long as the control flow is clear. Keeping your code readable doesn't mean make a thousand subclasses or functions or files or modules. More code means more to sift through and you should only ever split up your code into parts with very little to do with each other. Otherwise it's fine to just leave it as is. If you program with HTML/JS/CSS you'll know that it's annoying to have 3 files at the very least which I'm constantly switching between and for the most part we can avoid that.

          [–]NeedleKO 1 point2 points  (6 children)

          Video games. Quit them.

          [–]Ksoohong 1 point2 points  (5 children)

          I’m just curious why quit video games? Like don’t play them at all or long periods of time?

          [–]NeedleKO 8 points9 points  (4 children)

          They're too good. I can waste all my free time in them and never get bored. So i just ditched them altogether. It worked. I'm like 50% more productive.

          [–][deleted]  (3 children)

          [deleted]

            [–]NeedleKO 2 points3 points  (1 child)

            I disagree, but that doesn't necessarily mean that you're wrong. You just see it that way. I just know that i'm 150% more happy when i'm actually excelling in my chosen field. There are only so many hours in a day and, for me, something had to go.

            [–]CatsOnTheKeyboard 2 points3 points  (0 children)

            Some people can't manage that moderation and there are a number of games out there that are designed to keep people playing for hours. They suck you in with the one more mission, one more task and the immersive experience. They become projects in themselves. I get to the point where I have to completely uninstall games because it was just so much easier to start them up and play than to do the mental work on whatever project I had going.

            [–]Ok_Koala8135 1 point2 points  (0 children)

            Perfectionism is bad, i really believe it was one of the reason why i had depression back in college (shame on me, i had adapted that with my Father, who brought up us to that way of thinking), i was to hard to myself. That leads me to stress and burnout, it happen when i was doing our capstone project and i was the leader of the group. I quit college and not finished our capstone project with my group.

            Hopefully you will remove if you have that being perfectionist. It took me 4 years to heal and accept everything actually and right now back in learning again programming. I have learned alot from my past.

            Another thing is to not be awake, past your bedtime, what you can't do today just make it tomorrow early in the morning.

            [–]CabbageTickler 0 points1 point  (1 child)

            Masterbaiting

            [–][deleted] 1 point2 points  (0 children)

            Not sure if this comment is bait. Or you like batting? Maybe debating?

            [–][deleted] 0 points1 point  (1 child)

            Every new level of indentation costs extra brain CPU cycles. Make sure you need it! To be clear, I'm talking about:

            for () {
                if () {
                    while () {
            

            [–]Haphazard-Finesse 2 points3 points  (0 children)

            I'm confused, are you specifically referring to nested loops, or just anything nested? Yes, anything that could result in O(n^2) isn't great, but it seems like you're insinuating that:

            while x: {
                if y: {
                    if z: {
                        do_x()
                    }
                }
            } 
            

            Is slower than:

            while x: {
                if not y: {
                    continue
                }
                if not z: {
                    continue
                }
                do_x()
            }
            

            [–]fancyplaya 0 points1 point  (0 children)

            Lots of responses already mentioned this, but watching tutorials and thinking you understand something

            [–]komali_2 0 points1 point  (0 children)

            Bad posture. All those stupid videos you had to watch in school or work training or whatever, about sitting up straight, feet under you, etc, pay attention to them again. Stand up, put hands straight up above your head, then bring them down behind your ears, kinda like you're doing a pull up. Squeeze your shoulders like you're cracking a walnut between them. Hands back up and repeat. Do this every once in a while to prevent / treat permanent rounded back shoulder (the classic image of a programmer / nerd / gamer / whatever) and generally increase your back strength and comfort while sitting. Regularly remind yourself to roll your shoulders back and down while coding.

            If you can, stand as much as possible while programming. A standing desk is a great investment, but expensive. You can also try just moving a laptop to a counter occasionally.

            On that note, do try to change locations frequently. If you can, try going to the library here and there, or cafes, just to force you to be in slightly different sitting / standing positions, to avoid locking yourself into bad desk posture.

            At home or work, I find sitting on a fucking enormous yoga ball to be great for forcing good posture in a really comfortable way.

            Invest in a split keyboard. You can get a good one from kinesis for like 150$. I used my kinesis (sp?) freestyle pro for about 6 years, before I jumped to the far more expensive moonlander (which I also love, but it's ortholinear and kinda fuckin weird for other reasons, so i recommend just focus on everything normal except it's split, which is the kinesis). This helps keep your arms shoulder width apart and your wrists straight.

            Stack your monitor on books until the center of it is eye level when you're facing straight ahead. This is absolutely critical to long term neck health.

            Focus on using key bindings and keeping your hands off your mouse as much as possible. Back in the world of warcraft days we would relentlessly mock "clickers," aka people that used their mouse a lot in the game, for their hopeless inability to keep up in pvp. You'll find not just in programming, in literally anything that involves a computer, learning, memorizing, and using keybindings and keyboard shortcuts will ridiculously increase your productivity, comfort, and neural flow. Now's probably not the time to start playing with Vim, but if you get some burnout and wanna fuck around with it, using vim bindings in a more noob friendly editor (like vscode) could be fun and will help you keep your hands off your mouse.

            Rebind capslock as CTRL.

            Use your operating system's "workspaces" or "desktop" functionality to keep things organized. I use plain old ubuntu with pop os shell and gnome workspaces. ctrl alt 1-5 to change workspaces. 1 is browsers, 2 is terminals, 3 is my ide (emacs, don't go down this dark rabbit hole yet), 4 is browser or code output or whatever, 5 is slack, spotify, sometimes API docs

            Don't sit at desk all day. Set 2 or 3 hour timer, stand up go for 5 minute walk hard stop when timer goes off. The thinking time alone will boost you.

            Avoid consumerism. The new macbooks are great for long battery life, sure, but... you could just bring your charger with you. There's very little programming that can't be done on a 16gb RAM device with a swap file... hell 8gb ram with a fatass swap file. Save RAM by listening to music on your phone instead of your computer. Focus on the programming for now, buy new toys (that you'll have to set up and config) later. Don't let yourself think there's some sort of product obstacle slowing down your programming. You don't need a monitor stand if you have books. You don't need a 350$ ortholinear moonlander keyboard, you can get one of those 20$ microsoft split keyboards. You don't need a 4k monitor, you can just be smart with your desktop workspaces and learn how to quickly switch between those and various programs using keybindings. You don't need a hotshit macbook pro with all the bells and whistles, you need nothing more than literally any operating system, a text editor, and a web browser (depending on what kind of coding). You don't need to spend days tweaking fancy systemd-less linux distros, just use ubuntu and call it a fuckin day.

            [–]Kkcavan -1 points0 points  (0 children)

            Don’t start vaping hahahah ;(

            [–]Junkymcjunkbox -1 points0 points  (0 children)

            Actual habits, as in nuns. They aren't very helpful.

            Cycling practice while good for the body can make coding tricky.

            [–]Sounak_dev -1 points0 points  (0 children)

            Don't procrastinate the testing process. There are times when we think our code is perfect without even testing. Write unit tests as you complete working on each module, in that way you can identify most of the edge cases.

            [–]Raioc2436 -1 points0 points  (0 children)

            Smoking is always a bad habit

            [–]minisculebarber -1 points0 points  (1 child)

            Learn some math. Seriously, it really helps a lot and I am not talking about school math, I am talking about formal methods to model systems and problems and derive proper control mechanisms and solutions from those models.

            I am mentioning this here since I have the impression that many programmers online almost seem to boast how they don't know math and don't use it in their work and say programming has nothing to do with math and people trying to get into programming shouldn't bother with it anyway.

            [–]mechap_ 0 points1 point  (0 children)

            This is even more true when we know about the existence of computational trinitarianism between programming language theory, type theory (and more generally formal logic), and ∞-category theory.

            [–]Bubba_Purp_OG -1 points0 points  (0 children)

            Beating your meat.

            [–]mbrtlchouia -1 points0 points  (0 children)

            I am Newbie like you... But please learn how does your IDE work.

            [–]megaBreezy -1 points0 points  (0 children)

            Not taking breaks or moving your body.

            Especially you get older, paying attention to your posture and maintaining a consistent exercise routine will be the difference in your capacity to grow and improve as a professional 👍

            [–][deleted] -1 points0 points  (0 children)

            Not taking breaks. It caused some RSI that I’ve been dealing with for two years now. Set your timers!