View Single Post
Old 2019-11-03, 04:27   #2
Dylan14
 
Dylan14's Avatar
 
"Dylan"
Mar 2017

2×293 Posts
Default Motivation for the Guide

So you might be wondering why I am writing this guide here. This is a valid point. In fact, I can see multiple points of contention:


1. There is, like, a thousand other tutorials out there on the Internet that do the same thing (in fact, the Python devs themselves have a tutorial, see https://docs.python.org/3/tutorial/.) Why would this be any different?
2. Why Python, out of all languages? It's not as efficient as, say C, or Fortran, or (insert any other compiled language).
3. Why not just stick with the codes that already exist?



All of these are valid points. To justify this guide, I can reason as follows:


1. With regards to the availability of tutorials on the Internet and in books, it is easy to find information on the language. But say you want something that's more obscure, like for certain packages that you can find on PyPi. Then chances are, you won't find any tutorials on this, and you are left to study the source and you have no idea what's going on. Also, some tutorials are arranged differently than others. While most tutorials will start with the usual stuff like syntax, strings, variables, etc., there is a limit to where the guides go to, and then you have to switch to another one, or rely on the Python documentation which may be cryptic at some points. And some things that are covered may not be needed. For example, certain Linux programs can be run on Colab/Kaggle without calling Python.


2. There are several reasons why I chose to use Python for this guide.
a) The code is easy to read, especially with properly commented code.
b) The code is well defined and has specific syntax.
c) Python can be extended easily by importing modules. Want to plot stuff? Use matplotlib! Need to deal with large arrays of numbers? Use numpy! Want to simulate a particle collider, use vegas! etc. etc.
d) Code will work as long as you have an interpreter, which exists for Windows, Mac and Linux.
e) Python can be linked to databases like MySql.


3. The easy answer (which is more of a question in its self): What if say the code doesn't exist that solves your problem?
A more valid answer: let's consider the OEIS database. There are a lot of sequences that don't have code. Some are due to the fact that the function is not computable, or the next term in the sequence is not known, so creating code for this would be impossible or impractical (for example, the busy beaver sequence). Others are trivial to make code for, but they have no code in a language (for example, 210009 - a formula exists which is a recursion relation which can be coded up). And this is just for math stuff! What about more practical things?


4. Learning a new language might help your programming in other languages.


5. You might have the next big idea that assists people or assists the search for primes, or factors. Being able to code will allow others to benefit. (Hell, you might be able to improve prime95/mprime*).


Thus, this guide is created to provide a detailed study of Python and other useful modules.


(*) This might be hard. George Woltman et al. have done a great job in optimizing the program and implementing things that make primality checking fast and reliable.

Last fiddled with by Dylan14 on 2019-11-18 at 04:24 Reason: gotta love typos
Dylan14 is offline