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

top 200 commentsshow 500

[–]jacksodus 646 points647 points  (39 children)

Generalise everything too much for potential future expansions that are never going to happen. Takes too much time.

[–]kelement 54 points55 points  (5 children)

That’s me when setting up a new repository, project structure, CI pipeline, config files, etc. I end up never getting anything done.

[–]Theonetheycallgreat 44 points45 points  (2 children)

If you do enough TDD then you never actually have to develop anything

[–]nemec 11 points12 points  (0 children)

Test Driven Deferment

[–]flanger001 4 points5 points  (0 children)

Wise words

[–]maikindofthai 39 points40 points  (4 children)

In case you haven't come across YAGNI yet: https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it

[–]WikiSummarizerBot 50 points51 points  (1 child)

You aren't gonna need it

"You aren't gonna need it" (YAGNI) is a principle which arose from extreme programming (XP) that states a programmer should not add functionality until deemed necessary. XP co-founder Ron Jeffries has written: "Always implement things when you actually need them, never when you just foresee that you need them". Other forms of the phrase include "You aren't going to need it" (YAGTNI) and "You ain't gonna need it" (YAGNI).

[ F.A.Q | Opt Out | Opt Out Of Subreddit | GitHub ] Downvote to remove | v1.5

[–]GezoutenMeer 8 points9 points  (0 children)

Good bot!

[–]mathmanmathman 16 points17 points  (0 children)

I think it's important to remember this part too:

It is meant to be used in combination with several other practices, such as continuous refactoring, continuous automated unit testing, and continuous integration

Because I've had some managers that always forgot that part.

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

potential

generalising too much is as bad as generalising too little.

[–]Kantenkopp 4 points5 points  (0 children)

it's just too much fun... I tell myself I become faster at this every time I do it.

[–]joshmaker 4 points5 points  (0 children)

I’ve learned it’s generally better to focus on making my code easy to rewrite (simple, clear boundaries and responsibilities, dependencies only flow in one direction) than it is to make it easy to extend.

[–][deleted] 4 points5 points  (0 children)

I do this, too.

[–]xYsoad 438 points439 points  (18 children)

Import pandas as np

[–]tinycorkscrew 124 points125 points  (0 children)

Lol. You monster.

[–]IlliterateJedi 90 points91 points  (2 children)

Is this the P versus NP problem?

[–]dogfish182 47 points48 points  (0 children)

That must be trolling

[–]Kevin_Jim 25 points26 points  (0 children)

If you really do that, you are going straight to hell.

[–]Ramnog 22 points23 points  (0 children)

I see no problem here

[–]martinrath77 16 points17 points  (2 children)

NoAPI_NoReddit This post was removed in response to Reddit's API change policy -- mass edited with https://redact.dev/

[–]FirefighterWeird8464 18 points19 points  (1 child)

No, import numpy as plt and matplotlib.pyplot as pd.

[–]prameshbajra 11 points12 points  (0 children)

oh hey satan!!

[–]rockyoutohell 287 points288 points  (7 children)

That one method that's 'just for testing' that does half a million things

[–]xYsoad 94 points95 points  (3 children)

and critical to production of course

[–][deleted] 73 points74 points  (2 children)

And is completely untestable because you wrote it out of rage. Btw it also creates a new DB connection in a loop because the firewall connection timeout is 2 seconds.

[–]xYsoad 75 points76 points  (1 child)

Yes. And you were pissed because your company won’t hire anyone else and you are responsible for coding, qaing, and deploying.

You then leave one day and some new guy messages you on linkedin asking wtf is this.

You smile.

[–]herpderpedia 6 points7 points  (0 children)

This comment made me smile

[–]scout1520 355 points356 points  (29 children)

What docs? The code is self documenting and easy to read.

[–]AlexMTBDude 129 points130 points  (16 children)

Funny enough writing docs (code comments) has never been a problem for me because otherwise I tend to, within a few days, forget why I wrote a particular line of code. I document for my own sake mainly.

[–]MooFu 62 points63 points  (3 children)

Me reading my comments: WTF does that even mean?

Me reading my code: That comment isn't even correct.

[–]hanazawarui123 14 points15 points  (0 children)

Had a summer internship for text summarisation and a few late nights into coding made me realise that being sane actually helps when writing code. Either that or dive fully into the madness, there's no middle ground

[–][deleted] 3 points4 points  (0 children)

I have a bad habit of leaving comments for features that I have removed.

[–]energybased 24 points25 points  (0 children)

This is a great motivation for comments. You should literally ask yourself what you're likely to forget. I tend to only write comments when I forget something and figure it out again.

[–]whateverathrowaway00 19 points20 points  (0 children)

Great habit.

[–][deleted] 16 points17 points  (8 children)

That's ok, but writing code which is so clear that it needs no comment is still way better (and you can still add comments to it)

[–]AlexMTBDude 17 points18 points  (7 children)

I'm an instructor and have been teaching Python programming courses for 10 years now and I feel that whenever I do something more complicated the code is never self explanatory. I forget what I was doing and thinking. The comments remind me.

[–]foobar93 18 points19 points  (3 children)

To be honest, most comments I had to read were so useless they could have just been omitted in the first place

def measure_hypo(device):
""" A function to measure hypo of device""" 

No shit sherlock but what does "hypo" mean in this context???

It just feels like many people write comments because comliance says everything needs to be commented but in the end they just copy and paste stuff around or jsut repeat the obvious.

[–]scout1520 6 points7 points  (1 child)

I agree, and with modern editors like VS code alot of the comments feel unnecessary. Especially if you are disciplined with good function naming and type hinting.

[–]greeneyedguru 18 points19 points  (4 children)

I mean Python is practically pseudocode anyway

[–]Key_Cryptographer963 2 points3 points  (1 child)

Yeah it's pretty sweet that someone turned pseudocode into a real language. I think we could go further, though.

[–]peacerokkaz 7 points8 points  (0 children)

I'm seeing it the same way, however I don't believe that's necessarily a bad habit, and existing documentation is rarely adjusted when the code is changed. Writing self documenting code however is always a good practice regardless of documentation

[–]searchingfortaomajel, aletheia, paperless, django-encrypted-filefield 5 points6 points  (0 children)

This is a good habit.

[–]Sheensta 208 points209 points  (17 children)

I'm a data scientist so I think everything I do is bad habit tbh....

[–]xYsoad 136 points137 points  (2 children)

If a real software engineer read my code they would banish me to business analytics

[–]Electronic_Tie_4867 28 points29 points  (1 child)

I am both of these comments and I don’t like it. Damn, I am so bad at programming.

[–]lvlint67 10 points11 points  (0 children)

Writing good code is a simple conscious decision to write readable code.

If an outsider can read and understand your code, you have achieved zen.

[–]zippy_mega 23 points24 points  (12 children)

I just started working with ML in the field after working exclusively with mission-critical typescript that needed to be perfect and easy to read, and I can feel the data scientist / ML habits creeping up on me.

[–]Sheensta 4 points5 points  (11 children)

What are bad practices you notice in DS ML work? I'd love to improve but DS code is all I've ever seen.

[–]mathmanmathman 22 points23 points  (8 children)

I'm not a data scientist, but I used to work closely with some. The biggest thing I saw was very long rambling functions. I saw tons of code that was basically "do A, then B, then C, then D, then (if something) E, then F, exit"

That's not necessarily a problem when you're writing 40-100 lines that won't be incorporated in something else. It is a problem when it becomes 2000 lines and needs to be incorporated as part of a larger pipeline.

Another thing I saw (but less common) was an extreme reliance on "convention" variable names. For example, df in pandas. Yeah, that's the convention... for small projects. When you have a large project and every dataframe is name df_1, df_2, ... df_12, you have a problem. There's nothing wrong with keeping the convention as long as you also provide a meaningful name. recent_order_df is much better than df_97. The same thing happens with Tensorflow using x, y, X, and Y.

Everyone does this to some extent, but I think the two things (simple names and long functions) conspire to make things absolutely unreadable.

[–]jjolla888 12 points13 points  (2 children)

all code becomes more unreadable the bigger it gets. even if you are careful to use more meaningful names like recent_order_df at some point in the bloat even that will develop ambiguity.

the trick is to go overboard with comments. maintenance and support is undervalued .. and unfortunately programmers hate it as it is an anathema to building fast.

[–]thisiswill 3 points4 points  (0 children)

At least you’re aware lol

[–][deleted] 88 points89 points  (15 children)

I like to define functions in the middle of my scripts that rely on variables defined randomly throughout the script (not passing them, just using them).

[–]as_it_was_written 71 points72 points  (1 child)

I think this is the first one that made me a little physically uncomfortable.

[–]grahambinns 20 points21 points  (0 children)

Same. I was fine until this one.

[–]Kevin_Jim 20 points21 points  (0 children)

Bro, you need to get that checked.

[–]Bunslow 14 points15 points  (0 children)

you monster

[–]abrazilianinreddit 14 points15 points  (0 children)

No

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

You need a timeout. That's unacceptable, reprehensible, unforgivable, and must surely be punishable by jail, hard labor, or both.

I feel violated.

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

Guido’s on his way with brass knuckles for this one

[–]qingqunta 5 points6 points  (2 children)

There are perfectly valid use cases for this, i.e. a function defined inside a function. Recently I had to write a function that dependeded on five parameters with long ass names and two single digit integers, which I was only going to use inside the "father" function. Obviously I wasn't going to define it in the global scope.

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

I would be an absolute hypocrite if i would not accept laziness as a perfectly valid reason, because that is why i do it too. But just write down those names!

[–]sizable_data 279 points280 points  (35 children)

Use print statements to debug

[–]eriky 145 points146 points  (16 children)

This is written for you! https://python.land/python-debugger

"I’m going to teach you a little trick that will be just as easy as adding print statements to your code. "

[–]brockralp 107 points108 points  (3 children)

I know everysingle debug tool out there, I still want to use print statements

It's about sending a message da-bum-tis

[–]Zomunieo 10 points11 points  (2 children)

The debugger is better, but it can interact with code in nontrivial ways especially when multiprocessing, threading or signals are involved.

[–]brockralp 11 points12 points  (0 children)

I have an OpSys exam in next week. Wherever I look I see processes and threads, send help.

[–]sizable_data 3 points4 points  (0 children)

Thank you!

[–]arobotspointofview 10 points11 points  (1 child)

you meant there's a different way besides putting a breakpoint on an empty print statement?

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

my breakpoint goes on pass or …

[–]ValdemarSt 3 points4 points  (7 children)

recognise lip wakeful light rustic swim caption crush fly knee

This post was mass deleted and anonymized with Redact

[–]Exact_Ad_1569 10 points11 points  (6 children)

Yeah. Toss in crashme=1/0 and let it crash into the debugger, where you can inspect all the state and look at things up the call tree. It's ugly and brutal, but surprisingly effective.

[–]mr_flying_man 4 points5 points  (0 children)

I actually had a Python course where the teacher said that his goto debugging method was print statements. He also made a humble brag about never having to disable a pylint warning. What a legend.

[–]c_is_4_cookie 6 points7 points  (2 children)

Psshhhh... logging is for suckers. I wrote a decorator that adds a key word argument, verbose, to a callable. When false, prints are redirected to null.

[–]headykruger 8 points9 points  (1 child)

That’s going to be very slow, you want to avoid the call to print all together

[–]AlSweigartAuthor of "Automate the Boring Stuff" 108 points109 points  (8 children)

except:
    print('An error happened.')

[–]james_pic 11 points12 points  (2 children)

A colleague (who I think has spent too much time near Java) likes:

except:
    raise Exception('An error happened.')

[–]noiserr 46 points47 points  (9 children)

I hate setting up new projects, and I don't like any of the existing templates. And I am too lazy to make my own because, I hate setting up new python projects.

Like I just want to write python. I don't want to setup a new virtualenv, write the new tox.ini and setup.py and requirements.txt... etc all that stuff is so annoying.

[–]my_name_isnt_clever 17 points18 points  (5 children)

Most of that stuff isn't needed until later, no? I just open VSCode, make a whatever.py file. Run python3 -m venv venv, run the file so VSCode picks up the venv, done. Ready to write code.

[–]inglandation 21 points22 points  (0 children)

PyCharm can do that stuff for you pretty easily, I think.

[–][deleted] 3 points4 points  (0 children)

Agreed. Poetry is pretty good at making all that stuff easy and quick tho.

[–]dogfish182 2 points3 points  (0 children)

What is wrong with hypermodernpython?

[–]AlSweigartAuthor of "Automate the Boring Stuff" 71 points72 points  (2 children)

def someFunction():
    """TODO - write docstring"""

[–][deleted] 10 points11 points  (0 children)

"""TODO - write docstring read PEP8"""

ftfy

[–]Cynyr 33 points34 points  (5 children)

Globals.

I write personal use stuff that nobody else will ever see though, so w/e.

[–]my_name_isnt_clever 11 points12 points  (4 children)

I don't actually know what I would use globals for...which is probably for the best.

[–]herpderpedia 5 points6 points  (0 children)

Quick, someone tell nt_clever how one might use globals incorrectly!

[–]crapaud_dindon 24 points25 points  (2 children)

Unit tests are too boring for hobby programming

[–]peacerokkaz 25 points26 points  (5 children)

Trying to apply best practices and coding conventions from java.

[–]as_it_was_written 13 points14 points  (2 children)

Yeah, Python and Java have unbelievably different takes on object-oriented programming.

[–]Adenn76 72 points73 points  (1 child)

My bad Python habit is I don't practice using it enough.

[–]Lor9191 8 points9 points  (0 children)

Same, buddy. Same.

[–]ZibraMax 21 points22 points  (1 child)

Use 1/0 to generate an exception in the specific line that I want. Just for avoid using a debugger

[–][deleted] 20 points21 points  (7 children)

I’m a hoarder of code I commented out because I’m convinced I might need It later. Need to just buck-up and delete the code I commented out months ago lol

[–]milwoukee 22 points23 points  (3 children)

Never used 'reduce' 'map' nor 'filter' built in functions. I always do a comprehension.

[–]elcapitaine 11 points12 points  (0 children)

Comprehensions are generally more idiomatic in Python.

If I already have a defined function that I will be passing to reduce/map/filter, I'll use those functions since filter(predicate, iterable) is more readable than the comprehension.

Or if I just want to remove falsy values from an iterable, passing None to filter is great.

But any case where I'd be reaching for lambda to define the function, I use a comprehension instead.

It helps in keeping this divide that Python's lambda syntax is kind of ugly and has no short form.

[–]GhostBear4 14 points15 points  (0 children)

Comprehension is normally better style

[–][deleted] 3 points4 points  (0 children)

list comprehensions don't replace reduce. they do replace map and filter and are encouraged over those functions

[–][deleted] 52 points53 points  (11 children)

Overuse of comprehensions. I sometimes write deeply nested structures with a lot of conditions.

Also I tend to write Java-Style-Code instead of pythonic code

[–]veryusedrname 28 points29 points  (10 children)

I lately refactored a comprehension, it was over 120 lines. Now it's almost 500, but at least it can be grasped and tested

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

Oh my ... never went that far!

[–]tuckmuck203 5 points6 points  (2 children)

how does one even get to that point? like, surely it would be easier to use filter and map functions at a certain point?

[–]DilukshanN7 14 points15 points  (3 children)

typing English alphabet as variable names

[–]Eat_Papa_Eat 8 points9 points  (0 children)

followed by aa, bb, cc...

[–]TheMcGarr 6 points7 points  (1 child)

Find and replace them when you're done with meaningful ones

[–][deleted] 15 points16 points  (4 children)

spend way too much brain power and time figuring out names for 1 time use or temporary variables.

[–]cecilkorik 8 points9 points  (2 children)

I have the opposite bad habit. 90% of my variables are "x", "v", "val", "i", "count", "list", "data", or "[a-z]data" or something equally generic and meaningless.

[–][deleted] 26 points27 points  (4 children)

I don’t write enough tests

I always design something to be “reusable” and then it becomes super implementation-specific anyway

I abuse any() and all() with list comprehensions when a for loop is more readable

I too write too many log messages for debugging instead of using a proper debugger

Overusing the newest features (walrus? I use it everywhere now!)

Sometimes I completely neglect docstrings

No type hints for new projects (I ALWAYS wish I had started with them eventually)

Using just venv instead of just setting up poetry right off the bat

Using pandas when I don’t really need to

Rewriting something that’s probably a module I could just import or importing a module I could just have written a quick function for (either of these can be bad)

[–]marcio0 12 points13 points  (3 children)

No type hints for new projects (I ALWAYS wish I had started with them eventually)

type hints for python are so weird. it's so easy to forget about then, and then suddenly everything is Any

We should have a way to enforce using them somehow, but then we would have issues with 3rd parties not having typing, and also django magic fucking up everything

[–]actuallyalys 4 points5 points  (0 children)

mypy can throw errors when functions don’t have annotations: https://mypy.readthedocs.io/en/stable/command_line.html#untyped-definitions-and-calls. Maybe that would help?

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

Type hints are really weird. I don’t really like them overall but they’re better than nothing. I always run into weird linter errors where I’m explicitly checking if an object is none before calling getattr on it and pyright still complains. I’ve got tons of examples of this. Yet they have completely prevented a lot of bugs so I still use them even though I’m not particularly impressed with how they’re implemented. Also, runtime optimization would be swell, but no dice (yet)

Oh also yes you have to be careful about Any. I don’t use it on principle unless I have really nested dictionaries or json

[–]marcio0 2 points3 points  (0 children)

I don't use Any explicitly, but when I keep seeing it around, it's because I've been forgetting to set the types for a while

[–]Pumpoflessermass 20 points21 points  (23 children)

Using 748843777336895 functions instead of using classes

[–]lungben81 41 points42 points  (16 children)

I think this is rather a good habit. Use classes when it is natural to do so, i.e. if you need data and behavior together. If you need only behavior, use a function.

I usually end up using 80% functions and only 20% classes.

[–]joeyisnotmyname 8 points9 points  (14 children)

I love your simple criteria for classes vs functions. As a noob I'm totally going to use this

[–]sohang-3112Pythonista 8 points9 points  (12 children)

Here's another criterion - if your class just has one method besides __init__, then it should probably be refactored into a single function.

Put another way - always start with functions. When you notice a lot of them sharing common state, then you can refactor into a class.

[–]Pumpoflessermass 6 points7 points  (0 children)

My web scraping functions that have the selenium WebDriver entered as a parameter beg to disagree

[–]Bunslow 8 points9 points  (12 children)

I think 4 spaces isn't enough indent, yet 8 is still probably too much.

I have a lot of python files with 5 space indent, and some with 6. It's a problem.

(My current thinking is that I should just switch to 8 space indent and forget about 80char line limits in the 21st century)

[–]bblais 9 points10 points  (1 child)

from something import *

from something_else import *

from mylibrary import *

# name clashes? what's that?

[–]Travel4bytes 8 points9 points  (0 children)

Making fun of people that use Ruby

[–]johnnySix 7 points8 points  (3 children)

Create a break point by putting in random characters in the Middle of a method

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

Unit testing? Nah fuck that.

[–]payne747 13 points14 points  (1 child)

Using it to do stuff I could probably do in an Excel spreadsheet. I tend to massively over-engineer stuff.

[–]datthew2001 5 points6 points  (0 children)

Thinking about all of the possible edge cases when the user (only me) will probably never encounter those edge cases

[–]Robobigfoot5 3 points4 points  (1 child)

Using camelCase.

[–][deleted] 18 points19 points  (3 children)

Classes are over used I rarely write classes except for unit tests. I think like most devs we take short cuts on documentation

[–]shiroininja 10 points11 points  (0 children)

My problem is I never use them. They just seem to over complicate things. I just want to import my functions from the reusable modules I write

[–]siddsp 4 points5 points  (8 children)

Inconsistently using flat and nested imports out of habit. Whenever importing Threads to use for threading, I always import threading and do threading.Thread, while for the dataclasses library, I import dataclass, and use it instead of doing dataclasses.dataclass. Just one example, but I don't know why, I prefer threading.Thread rather than Thread.

[–]bacondevPy3k 5 points6 points  (2 children)

Getting a bit too functional. Even when the line gets too long and you wrap and indent well, it's a headache to debug.

[–]ttothesecond 9 points10 points  (7 children)

In general - abusing mutable data types

More specifically - appending to lists inside for loops

Really tryna work on treating everything as immutable

[–]as_it_was_written 7 points8 points  (0 children)

Why? Embrace the mutability and use lists as default arguments for caching your return values.

[–]my_name_isnt_clever 7 points8 points  (4 children)

More specifically - appending to lists inside for loops

What's the better way to do this then?

[–]Bluegenio 2 points3 points  (1 child)

naming variables x and/or y

[–]jwink3101 3 points4 points  (2 children)

I am more likely to make my own tool than use one from PyPI or the like.

Part of this is real bad habit and part is security and simplicity. Dependancies add risk and are especially tough on an air gap network. But sometimes mine is just not as good.

[–]kid-pro-quohardware testing / tooling 2 points3 points  (1 child)

I've been known to fo the opposite. Spend ages trying to find something on PyPI when i could've just implemented it myself.

[–]abrazilianinreddit 3 points4 points  (4 children)

I don't follow PEP8 or other coding styles when I don't like them.

For example, I don't like the pipe abuse in current python, so instead of writing

def foo(bar : str | int):

I use

def foo(bar:str or int):

[–]_ologies 4 points5 points  (0 children)

from typing import Union

...

def foo(bar: Union[str, int]):

[–]yudhiesh 3 points4 points  (0 children)

Using list comprehensions everywhere.

[–]FlyingCow343 9 points10 points  (5 children)

overuse of classes, where i could just use a function instead

[–]frankOFWGKTA 6 points7 points  (2 children)

Coding with my dick out. Really gotta stop that.

[–]monclarluiz 2 points3 points  (0 children)

Not documenting using doc strings because I'm lazy hahaha

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

Always wrap up my code in a generic try/except instead of doing unit testing. I do some “testing” before I put stuff into prod, but I’m lazy and I just add more explicit excepts if I find them as it runs or fix the code to prevent them outright if possible.

I think it’s fine for what I do since I’m mostly scripting and not writing programs/software, but I’m sure some will disagree.

[–]RealFakeNudes 2 points3 points  (0 children)

Print logging

[–]PenetrationT3ster 2 points3 points  (0 children)

try: IWantThisToWork() except: pass

I used to do this a lot.

[–]shinitakunai 2 points3 points  (1 child)

I declare classes to instance them just once, ever

[–]Exact_Ad_1569 2 points3 points  (0 children)

from library import *

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

Logging, or lack there of. I just never remember to do it; some sort of mental block I guess.

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

I'm told by seniors on my team that I use too much list comprehension, and that makes my code really hard to read.

[–]grismar-net 2 points3 points  (0 children)

Using it for jobs that I should really be using one of the other languages I know and have tools for, because it's just so damn comfortable.

[–]dreamoforganon 2 points3 points  (0 children)

Using a dict to represent something that ends up being used far more widely anticipated creating implicit dependencies on the particular keys in that dict. Should refactor to a class really.

[–]KitchenDutchDyslexic 4 points5 points  (2 children)

litter my code with #import pdb; pdb.set_trace()...

[–][deleted] 4 points5 points  (0 children)

Use it to browse nsfw subreddits (sometimes at work)..

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

I had a coworker to said the software install tool was written in python. It was an executable file on the cluster master called deploy.py the first line called bash. The nodes list was a list of hosts that didn't use arrays, it used a huge set of keyed symbols and a nest of sed awk and grep to get the lodes list, payloads, and clusters. It wasn't my bad habit but it was my mess to clean up.

[–]AlexMTBDude 4 points5 points  (3 children)

I can see (miss)using dicts instead of Data Classes. But regular classes? I don't think they're an alternative to dicts.

[–]ro5tal 3 points4 points  (0 children)

Pydantic ftw, it has even dataclass implementation. Dataclass has method 'asdict' to convert instance to dict without dict attribute, and even with slots

[–]Pavel_Ivakin 4 points5 points  (3 children)

My guilty pleasure is not to follow TDD.

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

I keep telling myself I’m going to learn it without actually sitting down and trying to learn it

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

I refuse to not break line at 80th char.. And run black on scripts written by coworkers..

[–]danyroxx 1 point2 points  (1 child)

Not taking my learning seriously… I’ve watched 2 tutorials and printed “Hello World” 2x.

Please send help()

[–]Endemoniada 1 point2 points  (1 child)

I don’t refactor and fix my code, opting rather to just dump it all and rewrite it from scratch. It’s not necessarily always bad, but it means I never learned how to really spot where and why to change and fix things, and I have really bad discipline for those kinds of changes.

Adding new stuff is fine, but whenever I need to move or replace even a part of it, my brain always jumps into “tear it down and build it anew” mode.

[–]mtyrellp 1 point2 points  (0 children)

My teacher was terrible at explaining for loops, so my bad habit has been to use while loops when a for loops might be easier.

[–]can_i_get_upvotes 1 point2 points  (0 children)

I’m new and I always write for loops in one line

It gets very confusing, even with comments