r/learnpython • • May 06 '21

What are some programming tools that every beginner programmer should know about?

Example, today I learned about Git and GitHub and it felt incredible.

480 Upvotes

190 comments sorted by

204

u/mutual_coherence May 06 '21

The debugger in their IDE.

6

u/Vietname May 06 '21

Id add learning pdb to this as well

4

u/TheFrogWhoHatesFlies May 06 '21

pdb?

9

u/PinkFlyingElephant May 06 '21

The python debugger, Google for 'python pdb'

13

u/vectorpropio May 06 '21

Prolapse data base

6

u/synthphreak May 06 '21

Now I'm afraid to ask what ipdb stands for...

-9

u/puttestna May 06 '21

Pirate Data Bay

3

u/[deleted] May 06 '21

Who needs pdb when you can be a printy boi?

1

u/[deleted] May 06 '21

try: 1number = 0/0 except: print("hrllo is me p\rinty boi")

1

u/Vietname May 06 '21

Hey now, pdb has a p button.

58

u/TaranisPT May 06 '21

As someone still fairly new to coding, this has been such a blessing for me. Knowing what makes the program crashes instead of just messing around with what you think crashes it is really helpful.

165

u/greasycilantro May 06 '21

And yet I still use the good ole "let's put a print statement here and see what happens" method lmao

37

u/shinitakunai May 06 '21

On some languages like python that is most of the times enough (not always). For other languages debuggers are more mandatory.

9

u/O_X_E_Y May 06 '21

Yeah in C I've found that the program will just give an exit code and do nothing when I don't use a debugger unfortunately :p

6

u/BenjaminGeiger benjamingeiger May 06 '21

Try fprintf(stderr, ...) instead.

stdout tends to have output buffering enabled, so if the code crashes before the buffer gets flushed, then the contents of the buffer can be lost. stderr gets dumped to console immediately.

2

u/O_X_E_Y May 06 '21

Hmm interesting, I'm very much a beginner there still and not familiar with all the intrinsics, so things like this definitely help!

2

u/BenjaminGeiger benjamingeiger May 06 '21

In fairness, I haven't really used C much since early grad school. I just remember running into that precise issue.

8

u/frapa32 May 06 '21

Me too, "print debugging", lmao

4

u/Topikk May 06 '21

It’s a really effective strategy for the kind of bugs I often find myself battling.

2

u/Windows_XP2 Shitty Programmer May 06 '21

It especially helps if you need to check if your program is running specific blocks of code. I use print statements all the time for debugging. Sometimes I also break my programs on purpose for debugging.

2

u/frapa32 May 07 '21

There are two types of programmer: those who use a debugger and those who don't.

10

u/[deleted] May 06 '21

same here lol

5

u/MyPythonDontWantNone May 06 '21

I try really hard to import logging before I need print statements. It allows me to leave the print statements in and just set a different log level. It is a better way to use the print statements. Plus it tracks the debugging if someone else runs the program.

2

u/Gh0st1nTh3Syst3m May 06 '21

How would that look if implemented?

5

u/dnswblzo May 06 '21

logging.debug('This is a debugging message')

https://docs.python.org/3/howto/logging.html

2

u/MyPythonDontWantNone May 06 '21

I'm on mobile, so I don't know how to add a code block. Here's a paste bin link with a toy example.

https://pastebin.pl/view/a4dc4f48

Try changing the 10 inside the function to something else (such as an empty dictionary {}) to see what an error does. Also, try changing the level parameter to logging.DEBUG or logging.ERROR to test the output.

Feel free to ask me questions. I'll attempt to help, but I'm self-taught and I've always been a solo dev. People working in a more structured environment are likely to have some insights that I lack.

3

u/The3rdWorld May 06 '21

Yeah, I would say doing it that way the most useful things you can get used to are the tools like .type() , .len() , .shape() , dir() , help() and similar.

They can make it so much clearer what's happening, when problems start happening I just shotgun my code with lines like

print("got to lol function ", x.len(), max(x), min(x)) 

and it becomes very obvious what isn't doing what it should be.

3

u/[deleted] May 06 '21

My old friend,

print("This should work")

and the classic,

print("If you can see this, you ballsed it right up")

1

u/unbirthed May 06 '21

That's the only debugging method I know, sadly.

1

u/Windows_XP2 Shitty Programmer May 06 '21

Usually if I'm trying to debug my code I will either break it on purpose to check if it's running that specific block, or add a print statement.

print("If you're seeing this that means the code is working.")

What's the fun of using proper debuggers?

4

u/Poddster May 06 '21

Knowing what makes the program crashes instead of just messing around with what you think crashes it is really helpful.

It sounds like your missing a crucial step. It's an important step you need to use even when using a debugger: Thinking.

You shouldn't be messing around with random stuff. You should think:

  1. What did the program actually do?

  2. What did I intend for it to do?

  3. Where's the gap there?

1

u/TaranisPT May 06 '21

Yes I understand that, and it's mostly how I use the debugger. Maybe I expressed myself incorrectly here, but what I meant is that before I learned how to use it, I would go over the section of code that seemed to misbehave basically by trying what I thought was wrong without actually knowing if it was the problematic thing. Keep in mind that at that time I was even more beginner than I am now and had a very vague idea of what I was doing. Now I understand the logic behind the code much better and have a better idea what I should look at when a crash/bug arises. Just resorting tonthe debugger if you have no clue what's going on is not going to help you much, I completely agree on that.

3

u/mutual_coherence May 06 '21 edited May 06 '21

I remember the first time I learned about it. It would take me hours to do what I could do with the debugger in a few seconds. It was life changing, I went from hating to code to actually enjoying it

Edit: Spelling

3

u/Astrokiwi May 06 '21

And before that: to actually use a proper IDE rather than a text editor with syntax formatting.

1

u/[deleted] May 07 '21

do you have a specific text editor in mind?

1

u/Astrokiwi May 07 '21

There's a lot of good ones, and they have their place. I use BBEdit myself, which is more Mac native, others prefer Atom or SublimeText which are more linuxy, or Notepad++ on windows, and then there's the emacs/vim/etc crew.

But you can save so much energy using an IDE that can fully build a project, propagate name changes, auto-complete, give more thorough warnings etc. I use PyCharm for Python and I think it's NetBeans for C++, because I run most stuff on university research servers and it has good remote editing support.

1

u/SolomonIsStylish May 06 '21

I've been using Thonny for a while now and the debugger is quite intuitive. I switched to VSC lately and god I'm so bad at debugging I'm really not comfortable with it.

1

u/serverhorror May 06 '21

Or how to write tests

141

u/[deleted] May 06 '21 edited May 06 '21

'MIT missing semester' is a college course that they filmed and uploaded to Youtube. It has 10+ hours of instruction about essential programmer tools and knowledge that perfectly cover the sort of things that beginners would find useful and would also struggle to find on their own. It covers so many great topics. I highly recommend it.

EDIT: Added link to videos. Also wanted to chime in and say that learning Linux-style shell commands is probably the single best thing any beginner programmer can do. You'll learn both what their computer is actually doing under the hood, and you'll gain an intuitive understanding of what kinds of things computers can automate. There are even ways to get similar shells on Windows (WSL or GitBash) and Mac (Homebrew) so there are no excuses. You won't regret learning it.

1

u/j0hnnyrico May 06 '21

I second this.

1

u/poa-seigne May 06 '21

THANK YOU SO MUCH OMG

1

u/[deleted] May 07 '21

Any particular resource you'd recommend for learning Linux-style shell commands?

2

u/[deleted] May 07 '21

i3wm lol

In all seriousness, watch the first MIT video to get a rough idea about what can be done in a terminal, then force yourself to only use the terminal. I had a weekend project with a remote headless raspberry pi (absolutely no gui, not even a desktop. Just a terminal, a power cable and an internet connection) and I had to develop and run code by remotely connecting to the server's terminal. After the second day of doing that, I was finally fully broken in.

Beyond that, the MIT series videos 2 and 4 are nice extensions to the first video. The 3rd and 5th videos may also be worth your time, although I'd say that videos 1 and 4 are by far the most important tools to have in your toolbox.

1

u/[deleted] May 07 '21

Okay, I appreciate your feedback and honesty. That's good to know, thank you! I'll give that a go.

1

u/JohnnyCincoCero May 06 '21

This guy f*cks.

167

u/DallogFheir 🐍 May 06 '21

Google

79

u/gocard May 06 '21

But that's only to find the correct Stackoverflow page

35

u/pconwell pconwell May 06 '21

Now that's a trick all by itself, too. Google relevant question, find SO post with exact same issue posted 3 months ago. Closed as duplicate question and links to a slightly similar question from 7 years ago that uses a completely different version of the programing language that includes breaking changes. Keep searching and find another post from 2 years ago that almost matches your question but there are no answers, just comments stating "you shouldn't be doing it this way, you should be using xyz instead" with no other explanation. You decide to risk upsetting the SO gods, so you post your question. Within 27 seconds, it's closed as a duplicate and linked to another post that isn't even close to what you are asking.

3

u/Gus_Bodeen May 06 '21

Thanks for the chuckle. Every once in a while the SO gods will blink and you can actually sneak a post in, getting your question answered by 5+ people!

2

u/pconwell pconwell May 06 '21

I have a decent rep on SO, but only because someone had posted an answer but my solution required a tiny tweak. Instead of letting me post a comment, SO's draconian rules would only let me post a new answer because i didn't have enough rep at the time. So i had to post a basically duplicate answer that someone else had found.

For whatever unknown reason, my answer got up voted several times - even more than the original answer i plagiarized. Whatever... SO it's very fickle.

5

u/[deleted] May 06 '21

It can be such a viper's nest of neckbeardedness sometimes though.

Q. What is 2+2?

Top Answer: Why do you need to know this? What is the context? How can you arrive at 2 before going through 1? What about 3+1? <347 Upvotes>

Like, just answer the question that has been asked, man.

2

u/ivanoski-007 May 06 '21

sometimes reddit pages are more useful

9

u/frapa32 May 06 '21

Man, I came here to comment with "google". Too late... but seriously learn to use search engines and you're > 50% done becoming a programmer 😁

2

u/AbbassMk94 May 06 '21

Exactly.... πŸ‘πŸ‘πŸ˜

17

u/kdaniel2410 May 06 '21

DuckDuckGo anyone?

5

u/mahclark May 06 '21

I like how ddg gives stack overflow previews e.g. when I search pyplot background color (on desktop not mobile)

https://duckduckgo.com/?q=pyplot+background+color&t=ffab&ia=web

4

u/frapa32 May 06 '21

Ddg here. I admit using g! When the search does not turn up anything useful.

0

u/[deleted] May 06 '21

[deleted]

3

u/dieek May 06 '21

That is some peak introspection there my dude. Thanks for the perspective.

2

u/[deleted] May 06 '21

Google just be like "get the pages on Virtual Environments ready. He'll be asking next week."

2

u/omnia_sine_deo May 06 '21

Startpage is a good one too, the results are more relevant

1

u/crysanthus May 06 '21

the first and foremost!

1

u/bono_my_tires May 06 '21

I wish this answer was acceptable for interviews. I absolutely SUCK at live coding and remembering small syntax pieces that take me 5 seconds to look up and get right and move on with my problem. Like, I know exactly what I need to look up and how to fix it, I just can't seem to remember these small pieces over time and be able to do it by memory

0

u/Fid_Kiddler69 May 06 '21

You spelt duck-duck-go wrong

0

u/[deleted] May 06 '21

[deleted]

8

u/HasBeendead May 06 '21

But they are beginner so thats normal af.

-4

u/Poddster May 06 '21

But they are beginner so thats normal af.

They're a beginner at python, not a beginner at thinking for themselves, or a beginner at researching things. So the behaviour is not excusable simply because they're a beginner.

3

u/adonutforeveryone May 06 '21

Knowing who to ask is as important as what to ask. Google is just a sea of stupid offered up to fill pages...you end up having to decipher others efforts anyway and can very easily be led down a rabbit hole of happy ignorance.

6

u/[deleted] May 06 '21

Good, lets close this Community , why stop here, lets close reddit because all you need in life you can google. Only Community we need is " How to ask right questions ? " and " How to use google ?" :D

139

u/BullCityPicker May 06 '21

'grep' for finding bits of code. (If you're on windows, download "AstroGrep").

Also, they're a pain to learn, but learn regular expressions.

47

u/mutual_coherence May 06 '21

Oh jesus I always forget about regex but they are so damn useful.

45

u/frapa32 May 06 '21

Have a look at www.regex101.com

0

u/[deleted] May 06 '21

[deleted]

6

u/TheKingElessar May 06 '21 edited May 06 '21

For regex, https://regex101.com/ has been so useful for me. It lets you easily test out your pattern and visualize the matching. All the regex I’ve learned comes from using that websiteβ€”it’s amazing.

10

u/Drited May 06 '21 edited May 06 '21

I recently learned more Regex and wanted to share a few tools that really helped:

Automate the Boring stuff chapter on using regex in Python: https://automatetheboringstuff.com/2e/chapter7/

Tool to write your expression and see how to works for target text that you can copy in: https://regexr.com/

Regex in Python cheat sheet https://github.com/tartley/python-regex-cheatsheet/blob/master/cheatsheet.rst

Anki spaced-repetition flashcard decks for learning and remembering Regex:

Basics: https://ankiweb.net/shared/info/1348500400

Ultimate deck (includes much that doesn't work with the standard python Re module - many will work with Matthew Barnett's regex module however) https://ankiweb.net/shared/info/284568815

For learning python there are a bunch of Anki decks available: https://ankiweb.net/shared/decks/python

2

u/Fid_Kiddler69 May 06 '21

Regular Expressions are a coding super-power

2

u/arkster May 06 '21

I became really good at regexes by reading 'mastering regular expressions' by jeffery friedl. Amazing book.

1

u/Big_ifs May 06 '21

Seconded. Great read

1

u/Redbeardybeard May 06 '21

Can you elaborate?

1

u/[deleted] May 06 '21

Not op, but if you are asking about why learning regular expressions (regex) is so important, regular expressions help simply searching for text patterns. As an example, I was told to find all the phone numbers in a large document. My options were to read the whole document and hope I catch each phone number, control+f the document trying "(x" where x is a number 2-9, or use a regular expression:

pattern = r"((?\d\d\d-?\)?\s?-?\d\d\d\s?-?\d\d\d\d)"
text_data = filepath/filename
phone_numbers_found = []
for line in text_data:
    match = re.search(pattern, line)
    if match:
        phone_numbers_found.append(match.group())

This was supposed to be one of those "it will take you a couple of days" assignments, that got done in 2 minutes. I turned it in a couple of days later, but you know.

1

u/[deleted] May 06 '21

I'd add to diff to your suggestion of grep.

Regex kicked my arse for far too long, but I'm a more efficient programmer for learning them.

1

u/rotterdamn8 May 06 '21

I was gonna say regex. I have done regex for a long time as part of automation and parsing data. I feel like it's not terribly complex if you do it enough, you get used to it.

0

u/[deleted] May 06 '21

[deleted]

2

u/inglandation May 06 '21

Honestly I can't remember most of the rules, but if you google them in small bits to build your expression it usually works. Also I use a website like Pythex to check if my expression is correct and use the cheatsheet.

34

u/[deleted] May 06 '21

Keyboard shortcuts; both for your IDE/apps and OS. Cut down on using the mouse and you'll find that your productivity goes up by leaps and bounds.

Not a tool, but this is a required skill to learn with all tools: learn how to ask questions. With enough experience Googling and Stack Overflow'ing - you'll learn how to ask questions in a ways that lead to answers. Sometimes people don't Google and instead post their question on a site because they couldn't find it, but if you're a beginner - 99.9% of the questions you have have already been answered, possibly even years ago.

8

u/xbno May 06 '21

Agreed, and IMO if you’re good enough at searching you’ll never need to ask, somebody always has the same problem as you. The most validating questions land you on an open issue in a repo

3

u/[deleted] May 06 '21

I can often find the same question asked by somebody else. The problem is usually understanding the answer!

24

u/[deleted] May 06 '21

I haven't seen it mentioned yet - using a code formatter (black) and a linter (flake8) makes it a lot easier to keep the code looking good and not having things like unused imports, unused variables etc.

If you're still learning it would be good to pay attention to code style in any case, but having these tools helps with having good final results.

4

u/mutatedllama May 06 '21

This needs more visibility. When I read code that doesnt pass flake8 I feel sick. I'm currently rewriting a lot of code done by grads at my job and it's painful (not just linting problems but that's a part of it).

22

u/ikothsowe May 06 '21

If you need to work with REST APIs, Postman can save you hours of frustration.

8

u/inglandation May 06 '21

Upvote for Postman. It's indeed very useful for developing REST APIs.

2

u/trizcon97 May 06 '21

Very useful for testing as well. Just did a project for work with it and it saved us at least 2-3 weeks

19

u/fence0407 May 06 '21

Stackoverflow, Google, YouTube and your ability to search for exactly what you need help with.

12

u/ffrkAnonymous May 06 '21
  • Basic vi, for occasions where only a terminal is available (eg servers)

  • dictionaries. Instead of trying to force lists.

  • doctest module

1

u/Aidandb1994 May 06 '21

Dictionaries are the shit. I once tried to make two lists before i knew about them.

19

u/gapspark May 06 '21

Environment variables. Never hardcode secrets (like passwords). You could use direnv to automatically set these environment variables when you enter the directory of your project.

How to create virtual environments. So you can have different versions of dependencies per project. I use the built-in venv module, but there are other ways to achieve it.

Learn to use your desired GNU/Linux distribution. Most Python projects and libraries work best on Linux, so it is helpful to know and use it. Mac OS is similar but has small differences that can get to you. For Windows I suggest using Windows Subsystem for Linux (WSL) with a distribution like Ubuntu.

3

u/bono_my_tires May 06 '21

but aren't those secrets hardcoded when setting the environment variables? I guess I don't quite follow this one

7

u/johnnymo1 May 06 '21

The point is that if some script uses an API key, you don't want an API_KEY = "12345wxyz" sitting in your GitHub commits. Whereas API_KEY = os.getenv("API_KEY") doesn't expose the actual value to others.

EDIT: I assume by hardcoding, the person you were responding to meant "never hardcode secrets into version controlled public source code."

2

u/dtf4bieks May 06 '21

Interesting. How does one set that getenv variable?

3

u/johnnymo1 May 06 '21

Depends on your system. I use Ubuntu where it's export API_KEY=yourapikey to set it for the current shell (and processes started from it), and you can set it permanently by putting it in your .bashrc file. I also use conda which supports environment variables that you can only see within a specific project's environment either by setting conda env config vars set API_KEY=yourapikey or setting it in the environment.yml file when you create the environment. I'm sure if you google "set environment variable" and your OS you'll find the version for whatever system you're on.

1

u/gapspark May 07 '21

Indeed, thanks for clearing this all up. The goal is niet to have secrets in your git repo. They still exist somewhere in a file in your machine if they are to be loaded automatically, but that file will have to be added to the .gitignore file to prevent it from being committed to git by accident. So rather than having secrets sprinkled throughout the source code, they are neatly contained in a single file, making it easier to take care. And indeed there are many solutions for automatically setting environment variables, just pick your favorite.

25

u/xelf Elf May 06 '21

There's already been some great suggestions. I'm going to toss this out there: learn a programmable editor as well. For me I went with emacs. I still use emacs regularly alongside Visual Studio and VSCode. There are times where having a programmable editor just offers you additional options.

Don't be intimidated by people that say there's a steep learning curve, it takes 15 minutes to learn the basics and to be able to manipulate things.

Sure you can spend a lifetime learning to master it, or writing your own lisp code for it, but the basics are really, well basic. Cut/paste, search, upcase region, capitalize word, record some key strokes, repeat those keystrokes 50 times. Open a shell window and compile and execute code.

It's a small investment in time for what could be a huge pay off over the next several years of use.

6

u/gapspark May 06 '21

Indeed. I came back to Emacs through the Spacemacs distribution. It has a lot of presets for different languages. Things I wouldn't take the time for to configure when I had a plain Emacs setup. I also use other editors when I feel it makes sense.

3

u/wonteatyourcat May 06 '21

Is there a point to learn eMacs if you don’t program in Linux? In 4 years of programming python (on windows) i never used it, even though I know how to. Even when I program for my raspi. My IDE and notepad++ are both more convenient and easier to use, especially with multiple files. It seems very server-centric.

4

u/vectorpropio May 06 '21

Is there a point to learn eMacs if you don’t program in Linux?

Emacs is your OS.

3

u/xelf Elf May 06 '21

I use it on windows mainly. So I guess, yes? =)

It's one of those tools where knowing how to use it can save you a ton of hassle that one time you need it, and suddenly it was worth it.

I also like having it as the default text editor instead of notepad for any text file format.

3

u/wonteatyourcat May 06 '21

I understand you like to use it, but can you give me an example of the one time it saved you a ton of hassle? Not bashing, I'm trying to understand why I would switch to it when pycharm and notepad++ do everything I need and more.

2

u/xelf Elf May 06 '21

I don't recommend switching to it. It's just an additional tool to add to your toolbelt.

Most of the things I find easier to do in it are basic text editing:

  • upcase/downcase/titlecase region/word

  • regex replace

  • record a macro ^x( type many keys ^x) and then execute the macro a bunch of times. Very handy when manipulating text files that are in a broken format and each line needs the same treatment.

5

u/wonteatyourcat May 06 '21

All of these are one shortcut away in notepad++ so I still don't see it being useful for me, but thank you for your answer :)

2

u/xelf Elf May 06 '21

Like I said, adding a programmable editor is a great tool to have access too. It doesn't have to be emacs. If you can already program macros in notepad++ and then execute them an arbitrary number of times then you're probably already in good shape.

One other thing I mentioned in another response was I like how cross platform emacs is, whether you're running it in a dos/cmd/bash shell, or as a window on linux/mac/windows whatever.

If you're only ever going to use windows then notepad++ is probably fine.

1

u/[deleted] May 06 '21

Learning the basics is easy, but if you're only going to learn the basics there are much better editors out there.

To get the full potential of Emacs you really have to configure it. That can be confusing and time-consuming, since the documentation is so fragmented and arcane, and you need to have a decent grasp of elisp. I use Emacs everyday and it's definitely worth the investment, but it's a pretty high investment.

2

u/xelf Elf May 06 '21

And this is the point I disagree on.

You don't need to get the full potential out of it. To get a positive advantage out of using it, basic text editing and record and execute macros is going to be close to enough.

Sure you can learn a LOT more, there is so much more that it can do, but just a minimal amount is enough, that's why copycat editors like jove were so popular, minimal perks of emacs in minimal size.

Add the fact that it's highly cross platform! I don't think there are many editors out there that are as cross platform, run in a window or in a dos/bash shell, and handle trivially programmable macros.

Place I've run emacs:

  • as a window in windows

  • as an X window on windows and linux

  • in a variety of linux shells (bash/etc)

  • in a dos/cmd window

  • on a mac

  • on an amiga

  • on andriod (it's been a long time, it might have been an emacs clone)

I'm happy to be shown alternatives though! =) As I said, I think picking up any programmable editor is a good tool to have, it doesn't have to be emacs.

1

u/[deleted] May 06 '21

This, but for a modal editor.

-1

u/antiproton May 06 '21

Vim and Emacs are tools exclusively for people who want to learn (and say they use) Vim and Emacs.

The vast, VAST majority of functions you need are supported by Notepad++ or Sublime.

If I need to do anything that even comes close to data editing, I throw the information into a spreadsheet and do it that way. It takes no time, and I don't have to waste space in my brain for the arcane collection of keyboard chords required by these tools.

Some people have a contact allergy to mice. I get it, we all have our idiosyncrasies. But beginners have enough to deal with without feeling like they're going crazy trying to understand Emacs.

2

u/xelf Elf May 06 '21

I hear good things about sublime. Notepad++ is good if you're only ever using windows.

It doesn't really matter which one you get, but it's typically worth it to learn an advanced editor.

But beginners have enough to deal with without feeling like they're going crazy trying to understand Emacs.

I really think you're misrepresenting here. It takes only a few minutes to pick up the basics.

Vim and Emacs are tools exclusively for people who want to learn (and say they use) Vim and Emacs.

And this is just Trolling at best, or perhaps mean spirited. We're having a nice discussion here, and the suggestion of learning any editor that supports recording and executing keyboard sequences is a good point.

I'm not advocating people drop everything and switch to emacs, I'm suggesting that having access to something like it is a good tool to have access to.

Your idea of notepad++ (& some plugins) or sublime supports my point.

7

u/[deleted] May 06 '21

Search engine (Google if you must) with format: β€˜language, error message’ (eg Python 3.9 Module not found)

12

u/iapetus-11 May 06 '21

0

u/[deleted] May 06 '21

[deleted]

1

u/iapetus-11 May 06 '21

Before one of my friends told me about poetry, I never used virtual environments because they seemed so complex and I didn't want to learn how to use them. Poetry has made development of multiple projects so much easier, and packaging of some of my packages too!

1

u/serverhorror May 06 '21

Any project without some form of virtual env:

  • step (0) β€” virtual env (whatever the current flavor is)

17

u/0dte May 06 '21

Docker

12

u/bozdoz May 06 '21

Maybe not beginner but absolutely important otherwise

8

u/pconwell pconwell May 06 '21

I'm not exactly sure what you mean by "docker", like if a beginner comes into this thread and sees "docker", I don't know if they would know what they are supposed to do with it. Can you expand?

For me, I use docker as my dev environment for python. It can be a little painful sometimes, but when I start a new (large-ish) project, I create it's own python docker container to house the environment. In my mind, there are two advantages to this system. One, it keeps everything clean because it's all contained in that particular container. If I no longer need/want that project, simply delete the container and done. Two, it makes it really easy to set up the environment on another workstation. For example, if my computer dies, I can have my finicky project environment up and running in a few minutes on my new machine.

5

u/LingStuffs May 06 '21

Kite, if you're not using an M1 :(

It's a tool for autocompleting your code using machine learning and also for showing the documentation of the function you're trying to use for most popular Python packages. It's really neat and I think the pro version is still free for students these days. For everyone else it's the cost of a Netflix subscription for a really nice boost to productivity :)

5

u/Fid_Kiddler69 May 06 '21

Vim! Not saying it's for everyone, nor that everyone should use it. But you should be aware of its existence

3

u/jmeppley May 06 '21

I love vim personally, and with some setup you van get it to do lots of cool things for python (code completion, error checking, etc).

Pros: Powerful. Can have the same setup on any platform (*nix, mac, win). Just as powerful with no GUI (command line). Really fast if you're a good typist (everything can be done from the keyboard).

Cons: Hard to learn and setup.

In general, find a text editor/IDE that works for you. There are a bunch out there. (Sublime, Idle, MS Visual Studio, ...). It should do code highlighting and code completion at a bare minimum.

2

u/anh86 May 06 '21

Even if it's not your favorite thing to use, you have to at least know the basics. At some point you're going to need it for a quick config file edit.

5

u/FakePixieGirl May 06 '21

I don't know if this applies to Python as much (my main language is Java), but the skills I really missed during my internship were knowing how logging works, writing tests, and writing parallel/asynchronous code.

8

u/[deleted] May 06 '21

To quit vim, you press ESC and then :q

2

u/bono_my_tires May 06 '21

and if you made an edit but actually don't want to save it then you might need to :q! instead

4

u/bneac May 06 '21

Not a tool, but how to Google for the correct docs, read the docs, and get the basic info from the docs. Documentation is an incredible wealth of information, but oddly organized, and sometimes overwhelming. Learning how to skim the docs to find what is actually useful for you and where that is in the docs for your language/library/tool can make solving problems or learning something new a breeze.

4

u/asphias May 06 '21

I hate how all the answers on here are "google for stackexchange", when they should be "google for the official documentation and api reference".

Stackexchange is only the second step in your quest for knowledge

4

u/adragon857 May 06 '21

Keyboard shortcuts for moving your cursor around. Look them up and start using them. It saves time and your wrists in the long run.

4

u/[deleted] May 06 '21
  1. Using Google efficiently.

  2. Using stackoverflow.com

  3. Placing debugger points and using IDE debugger.

  4. Placing WriteLine(), Println(), Printed() etc in source code for good debugging.

3

u/Fernando3161 May 06 '21

Is print() something that pros use? I use it and feel like a newbie!

3

u/klikka89 May 06 '21

We call it stone age debugging at my firm. And it has it uses, at least when writing async code that is hard to debug

3

u/[deleted] May 06 '21

Yeah, writing async code. it's very useful while

4

u/freeononeday May 06 '21

Black / Pylint - scrolled all the way to see it. Set it up to auto run in pycharm or run separately. It is the best way to learn how to make your code more pythonic. Shoot for a Pylint score over 7.5

4

u/Phyan May 06 '21

Learning to create and maintain virtual environment for different projects.

There is Pycon video on Modern Developers Tool Kit. It may not be for beginner but good to know tools.

PyCon US 2020

3

u/thedjotaku djotaku May 06 '21

Every year I write a blog post about the programming tools I'm using: http://www.ericsbinaryworld.com/2021/01/13/software-i-used-for-programming-in-2020/ hope that helps some of you!

3

u/Shriukan33 May 06 '21

Git (Github) is a must, it's way more complicated than it looks but you really can't avoid it

3

u/aqjo May 06 '21

The book The Pragmatic Programmer by Thomas and Hunt. It truly changed the way I think about and write software.

https://www.amazon.com/Pragmatic-Programmer-Anniversary-Journey-Mastery/dp/B0833FBNHV

3

u/menge101 import functools May 06 '21

How to write tests.

3

u/anh86 May 06 '21

Trade in your basic text editor for PyCharm if you're not already using it. It takes a little bit of time to get your bearings but it does SO much for you.

3

u/IlliterateJedi May 06 '21

For Python specifically everyone should be familiar with help() and dir()

5

u/MoniaJ May 06 '21

Jupyter notebook

3

u/jmeppley May 06 '21

I %100 agree.

Jupyter is lots of things, and one of these is a great place to try out code.

  • You can write snippets, functions, and or classes and run them immediately.

  • You can export code to python files

  • Jupyter has built in profiling so you can see why your code is slow

  • Jupyter automatically saves your work, so you can go back to old code (Put them i Dropbox, Google Drive, or Github for easy backup!)

  • It allows you to format inline comments, so you can remember what you were doing more easily

It's easy to get started:

  • Google Collab is basically jupyter notebooks saved in Google Drive

  • Anaconda gets you set up quickly and easily (It's a little bloated with lots of other scientific tools, though)

  • Installing with pip or conda is really easy, too

4

u/Fernando3161 May 06 '21

Some things that changed how I code:

Learn anaconda prompt

Learn Git and Github/Gitlab

Lear how to configure eclipse IDE for python

Learn how to break code and debug.

1

u/an_actual_human May 06 '21

Learn anaconda prompt

Why?

1

u/Fernando3161 May 06 '21

I allows me to easily create environments, and integrate them with jupyter notebooks for quick deployment of code and documentation.

1

u/Diggy696 May 06 '21

Any recommendations for git? Been programming for almost a year but have 0 clue how to use it but it seems like everyone loads their code up there.

2

u/Fernando3161 May 06 '21

https://docs.gitlab.com/ee/gitlab-basics/

I am preparing a git tutorial for my coworkers in the coming month. Hit me up if you want a hands on guide.

1

u/Peterj504 May 09 '21

Brad Traversy has excellent courses on just about anything. Here's his Git intro:

https://www.youtube.com/watch?v=SWYqp7iY_Tc

2

u/Jeklah May 06 '21

git is fucking amazing. it is my favourite tool without a doubt. get a command line prompt with git status in and you'll feel godly.

it took me a while to realise github and git were two seperate entities also.

learning vim is worth while. getting a good vim setup is also worthwhile, but would take ages if you don't know what you're looking for. and a while to set up. i've been using spf13 for a while which is a preconfigured vim setup. lots of nice plugins.

I recently found Kite, which is amazing.

It's auto complete for python, but it uses machine learning to scan your code base and provide useful, contextual multi line completions. it is very nice.

ipython is a nice interactive python shell too which i usually use to debug, although I should probably use a proper debugger.

2

u/solve-it-yourself May 06 '21
  • saves post, hopes to remember to check it later *

2

u/ivanoski-007 May 06 '21

visual studio code

2

u/thebasementtapes adam-goodrich May 06 '21

Linting and prettier. Can help newer programmers see what well formatted code looks like.

2

u/gnex30 May 06 '21

I wish I knew about source control/GIT when I was in college. Better yet, learn about branching and merging strategies, there are a lot of different ones and it's good to see the advantages of different ones.

2

u/[deleted] May 06 '21

Makefiles

3

u/jmeppley May 06 '21

If you like makefiles and python, check out snakemake. It's great for combining python and non-python programs into coherent workflows/pipelines.

2

u/ToothpasteTimebomb May 06 '21

This site helped me a ton when I had just started out: Python code execution visualized

2

u/ddouce May 06 '21

Notepad++ is an open-source text editor with some useful tools. I use it a lot for formatting code

2

u/[deleted] May 06 '21

I would say learn the 'culture' and etiquette of stackoverflow, because in my experience no one can help you as much as they can.

Just keep in mind that their internal search function sucks.

2

u/pekkalacd May 06 '21 edited May 06 '21

yeah i'd say git is a good one. postman is another for rest apis. in python, the help() function. in c++, preprocessor directives. not really a tool, but an idea, "separation of concern" - specific, short, simple functions that do 1 thing. not a tool again, but documentation standards for their language of choice. unix bash syntax & commands. this site for regex https://regex101.com/

5

u/[deleted] May 06 '21
  1. stack overflow

  2. stack overflow

  3. stack overflow

3

u/DannyckCZ May 06 '21

No one mentioned Vim? It's a text editor that will let you fly through code without the use of mouse. Increase your speed insanely if you put the effort and go beyond the initial frustration.

All IDEs have Vim extension, so you can use it together with your IDE tools. And in case you work on a server with only a command line, you'll feel like home when you need to edit some text.

3

u/Exiex May 06 '21

Vim is really great, and in addition to editing the code quickly, you also have macros, if you need to edit a repetitive code part.

2

u/CCIE_14661 May 06 '21

Sublime text or Visual Studio Code. I find Sublime to be more multiuse since I also write complex network infrastructure device configurations, take notes, etc., along with coding.

1

u/jasonbourneJb May 06 '21

recursion and dynamic programming, its a hard concept to understand but very rewarding

1

u/TicketOk1217 May 30 '25

Great question! For beginners, having the right tools makes a huge difference: Start with VS Code as your versatile IDE, learn Git & GitHub for essential version control, and master your IDE's built-in debuggers. Always rely on Official Docs for language-specific help. Also, consider AI Coding Tools – a game-changer for beginners and non-programmers. Tools like Click-Coder are excellent; they let you describe ideas in plain language to generate code, dramatically lowering the entry barrier and helping you start coding faster

1

u/Decency May 06 '21

p4merge for resolving conflicts is excellent. It only starts to become necessary when you start working with a team on a shared codebase, but when it's needed it's a huge help.

1

u/[deleted] May 06 '21

Anaconda navigator

1

u/bono_my_tires May 06 '21

isn't anaconda navigator just a collection of other apps? I use it without really knowing what I'm doing with it, I really only use it for Spyder - I love how it has the input & output screens side by side, and allows you to highlight specific code you want to run

2

u/[deleted] May 06 '21

It is but it has all of those apps in library with description on how each can help so kind of all in one. for me as a beginner it’s great as gives easy and quick access to so many useful tools

1

u/tastes-like-chicken May 06 '21

Nothing to add, just thank you for posting this and to everyone who replied!

1

u/[deleted] May 06 '21

Spyder ide and conda compiler

1

u/CodeCocina May 07 '21

Keyboard shortcuts , not trying to memorize everything( use google) and make projects , don’t get stuck in tutorial hell

1

u/ringohoffman May 07 '21

Definitely an IDE. I like VS code. Also jupyter notebooks.

1

u/Ottstar May 07 '21

Brrakpoints. It's really useful to go through your program step by step and see what it's actually doing

0

u/[deleted] May 06 '21

[deleted]

11

u/tasteslikeKale May 06 '21

These tools are all pre-Linux but you are absolutely right about their power.

0

u/[deleted] May 06 '21

[deleted]

3

u/Brian May 06 '21

Eh, MacOS is a unix, and there are probably a fair few learning programming there.

4

u/KW__REDDIT May 06 '21

as an intermediate/advanced python user I must admit that I absolutely hate regex and would never advise anyone to learn it as a beginer or in general that is. You should know that there is such a tool and know vaguely how to use it but to learn it... Nah I'd never do that.

You are right bout the git and the linux tools tho so you got my upvote :-).

0

u/[deleted] May 06 '21

[deleted]

1

u/KW__REDDIT May 06 '21

definitely seems like you do haha. I remember that when I was doing automation I did everything I could to work around working with regex so there is also that. Now I do mostly DS and simulations and regex is used exactly 0% of the time.