3 ms·
I'm like you. I prefer books. I suggest Python and to a lesser extent Jupyter for now. Julia is better, C is faster, but Python is so ubiquitous that someone h
by anigbrowl 4y ago
I'm like you. I prefer books.
I suggest Python and to a lesser extent Jupyter for now. Julia is better, C is faster, but Python is so ubiquitous that someone has already had your problem and written about it. Lots and lots of scientists (including mathematicians) use Python, and there is a huge ecosystem of tools for it.
It matters what you want to make. If it's games, then disregard the above and maybe try Godot, but it sounds more like you want to be a swiss-army-knife kind of programmer that uses code to solve problems vs a pro software developer.
You should probably roll with Anaconda, despite its flaws. It's an OK system for managing your programming environments/dependencies without being completely overwhelmed in the first month. Python package/dependency management out of the box is ass so unless you enjoy screaming at the command line you should outsource that task.
You'll need a decent IDE. You might like Spyder which is aimed at Scientists. I like PyCharm (and its cousin DataSpell) from Jetbrains. You'll feel a bit overwhelmed at first because there are over 9000 features you don't need in the early days, but you do want something that can grow with you. Some people love VScode but they are wrong and also bad. The two IDEs I like are both installable via Anaconda and despite its flaws that's the easiest way to get rolling.
Get familiar with SciPy, which is a suite of scientifically oriented python librarys including a computer algebra system (SymPy), vectorized computation (NumPy). You will probably find yourself using the latter a lot because Python is slow as mud by default so intense computation requires optimized libraries, usually written in C and given a Python interface.
You will need a good Python language reference book. I like O'Reilly books for most purposes, Learning Python by Mark Lutz is boring and tedious but a good complete reference for the early stages. You can safely ignore all the stuff about Python 2, most of the world has moved on and you probably won't have to struggle with trying to convert code from Python 2 to Python 3.
Get a book or print out a cheat sheet on the Python standard library. It's huge and getting a top level familiarity will save you a lot of time reinventing the wheel - although reinventing the wheel in pure Python is not that hard, doing it well is another thing, so often you'll implement something for your own understanding, realize your implementation is not very good, and then have to make a decision between betting better at a very narrow task or going with the much-better-written library that already exists. C programmers will deride you for this because C is the kind of language where you start out with a hammer and use it to make your own nails. (I actually love C but it's kind of a desert island language and you will get frustrated if you want to to anything remotely complex/user-friendly until you have much more experience).
Do you wanna do 'data science'? Probably, because that's the hot word for waving your arms around and making the computer do stuff that isn't easy to do in Excel. You'll want Python for Data Science by Wes McKinney. This is a bit about Python, a bit more about NumPy, and a whole lot about Pandas, which he invented. Pandas is somewhere between a spreadsheet and a database. It's verbose and not fun until it is and then you start opening .xls files in pandas because you can get stuff done faster than you can in Excel. It's not hard, but it's like its own second language that sits on top of Python at right angles. You need to know it because it's so widespread that even more clever replacements aim to be compatible or at least similar to it.
If you just wanna make hardcore graphs you might get on great with Matlotlib, which is a Mathematics Plotting Library. It's quirky but accessible, also ubiquitous. But it's also too quirky ofr a lot of people and has a lot of competitors on the output/user interface/dashboard side. The big two are Bokeh (gorgeous visuals) and Plotly (slightly less gorgeous, but more extensible).
You'll want some sort of output library to make pdfs, user interfaces, or web dashboards. Your main choices are Streamlit and Dash. Dash is from the makers of Plotly. It's harder than Streamlit but not much, and better.
You should get used to doing stuff int he cloud, with stuff like Python Anywhere (part of Anaconda), AWS, or Google Colab. Otherwise you will be like me, running almost everything on your local machine and doing a bad job to pushing it into the outside world, while you instead supervise your own private infinity.
Did I say push? You NEED ot learn version control, and the easiest one is probably Git, as in Github. Your IDE will handle most of this for you and you should let it, unless you like screaming the command line. Advanced Python Development by Matthew Wilkes is not the most gripping read but it is good on how to manage your ridiculously large number of tools without completely losing your mind.
Remember I mentioned Jupyter? And Swiss Army knives? and remember how you just wanted something to hack around with, instead of mortgaging your cognitive capacity for the next half-decade? Get you a copy of Python Interactive Computing and Visualization Cookbook by Cyrille Rossant which is the best bridge between 'I know some Python and some math and I could probably implement the ideas in this paper I just read' and Getting Shit Done in science Python. It's very accessible and holds your hand well but also assumes you're intellectually curious and want a wide breadth of knowledge. I wish I had bought it much earlier, it would have saved me a lot of time running down dead ends.
Anyway that ought to be enough to wreck your social life/get yourself into moderately serious trouble. Expect to be constantly pissed off for maybe the first 3 months or so, as every new line of inquiry seems to turn up 10 fresh obstacles, partly because you are trying to get familiar with so many different things at once (IDE, language, libraries, program design, problem analysis...). At some point it starts to gel and you can get small tasks done easily enough that researching the next sub-topic becomes empowering rather than overwhelming.
- anigbrowl 4y agoOh, the standard library is so big and knowing what you don't know such a big problem that I forgot to mention some things you need to know about when you actually sit down to write code. It's super easy to do text-based interactive little utilities in Python (that you run in the terminal) and not much harder to do command-line utilities with keywords etc. A basic Python reference will move you quickly thought he basics of open and closing files, doing numeric calculations, and manipulating strings (one of the things that Python does incredibly well and which is kinda miserable in C by default). Pay attention to data types, Python kinda does sensible defaults for everything in the background and gets it right most of the time, but mismatched data types are the most common bug that cause your programs to crash horribly (as opposed to keep running but doing the wrong thing). That's all fine at the learning-the-language stage, but if you get stuck here you'll just end up making command line tools forever and become one of those people that insists everything be stored in text files and eventually lose the ability to operate a mouse altogether. Chances are sooner or later you will want to write a program that goes on the internet to grab some data or do a thing and give the sense of god-like power that you secretly crave. For this you will need to get familiar with the Requests library (and later Sockets) which will let you do web-type things. Requests are how you ask the internet for things, sockets are the networking infrastructure you build if you want more low-level control. Most of your requests will involve either sending or receiving json, to be opened or saved in files and later in data frames, which are like smart tables. You'll find json is not that hard but nor is it that easy, so you'll need a library to translate back and forth between json and standard data types or advanced ones like data frames, which I am repeating because you will end up using them all the time for everything. This doesn't mean you can skimp on understanding the standard data types. So get used to the json library, then learn to use the json builtins in pandas, which are the same but different because standardization is more of an idea than a reality in many respects. This is especially true for csv and json files, which everyone uses because they're easy, until they become unmanageable. (A lot of HN discussion is about the tools that do a good job once the volume/flow speed of data becomes so overwhelming that your basic hacker knowledge isn't sufficient, and you'll either need to become a much better programmer fast, lock in to bad solution and become a creator of Weird Software, or use a database. (Databases are for when you want less control and it's someone else's job to make shit work, which it will, and often far faster than anything you could have achieved. Working programmers have strong opinions about databases the same way truck drivers have opinions about trucks, and they're all valid. If you are not trying to make a commercial product where the product is simple but the infrastructure is complex, you might find you never need anything more than SQLite for a database. Database design is its own big subject and it depends very much on your problem. You will need to learn SQL (structured query language) as well as Python once you start using databases but it's easy, you can pick up the basics in am afternoon.) You absolutely have to get comfy with json because most APIs are just about computers slinging json back and forth and once you get the hang of how to do this it opens up an entirely new vista, suddenly large chunks of the internet are accessible from inside your IDE allowing you to do all sorts of interesting stuff with relatively limited expertise. This is where it gets much more fun and rewarding, in terms of both emotion and utility. See something cool on the web, but no json? No problem, that's what BeautifulSoup is for, it'll help you scrape data directly off web pages, it's super easy to use, you're going to need it all the time. Selenium is also important to know about if you want to do remote control of something without an API (ie use Python to drive a browser and fake the typing and mouse clicks). But you won't often need to use it, just know that it exists when you can't find any other way to do something you could do by hand. Dataframes in (pandas and other libraries) are great for tabular data, numpy is great for multi-dimensional numeric data, and together they can meet most of your needs. But if you're at all interested ing graph theory you'll want to use Networkx. Graph theory is a kind of essential tool for anything where you don't know your data layout in advance and you want to represent the relations between things and analyze them mathematically. Networkx is not the most performant library but it's really easy to use and there's a ton of people working on it. Like Pandas, it's the de facto standard and competitors try to match its syntax/concepts so as to be more accessible. Basically with all the above you'll be able to prototype anything, it just won't run at outstanding speed and if it turns into a large project you'll probably have maintenance issues as you hit the limits of Python, the most mainstream libraries, and your own knowledge, cause there's always more to learn. But if you're more interested in problem-solving and demonstration than building consumer ready products, then these are the must-haves in your toolkit that you'll find yourself using on a daily basis.