# Programming languages  

 Which language should you learn? 
 - Just as choosing which language you will use for your foreign language requirement is based on your research question, there are multiple programming languages you can choose to learn.
 * How much of the language do you need to learn? 
  * Does your project require basic fluency or only reading comprehension?  
 
 In data science and digital humanities, R and Python are the most common. Most 'introduction to a programming language' sessions will focus on one or the other. 


<!-- ## Python 
* [Python is an interpreted, high-level, general-purpose programming language.](https://en.wikipedia.org/wiki/Python_(programming_language))

## R 
* [R is a programming language and free software environment for statistical computing and graphics.](https://en.wikipedia.org/wiki/R_(programming_language))
* Learning R fundamentals is a gateway to analyzing data, creating visualizations, composing interactive websites, scraping the Internet, and engaging in distant reading of texts.-->

## R vs. Python
<!--* [Comparing Python vs R Objectively.](https://www.dataquest.io/blog/python-vs-r/): “where Python is more object-oriented, and R is more functional.”
* [Choosing R or Python for Data Analysis? An Infographic.](https://www.datacamp.com/community/tutorials/r-or-python-for-data-analysis)
* [Python vs. R for Data Science: What’s the Difference?](https://www.datacamp.com/community/blog/when-to-use-python-or-r) 
* [R vs. Python](http://www.theswarmlab.com/category/rvspython/): Compares the two in action.-->
* [R vs. Python for data science: Explainer and learning tips](https://www.edx.org/resources/r-vs-python-for-data-science-explainer-learning-tips)
* [Python or R for Data Analysis: Which Should I Learn?](https://www.coursera.org/articles/python-or-r-for-data-analysis)


## Tutorials (online notebooks)
When you see language referring to *interactive tutorials* they are referring to online notebooks (such as [Google Colab](https://colab.google/) or [Jupyter notebooks](https://jupyter.org/)) that combine *executable code* and rich *text* in a single document. 

 These allow instructors to have text explanations alongside sections with executable code (code that you can run and modify to see how it works) in the same document. 

There is an introductory tutorial to 'Getting Started with Jupyter Notebooks' available through [JSTOR Constellate](https://guides.smu.edu/c.php?g=1397994) Tutorials.

# Python
- You have access to Python tutorials with your SMU log-in in **Constellate**
- To access [JSTOR Constellate](https://guides.smu.edu/c.php?g=1397994) Tutorials, [log in](https://constellate.org/docs/user-quick-start) to Constellate and navigate to the [tutorials](https://constellate.org/dashboard/tutorials) section on your dashboard. From there, you can explore their growing library of interactive tutorials covering a wide range of text analysis topics.
  - Beginner Python Tutorials: Get started with Jupyter notebooks with an introduction to the Python Programming language for absolute beginners.
  - Python intermediate Tutorials: Expand your Python skills learning to work with files, comprehensions, and object-oriented programming.

    - [Guide to Getting started with Constellate](https://constellate.org/docs/topic/explanation)

**Additional Python lessons**
* [Plotting and Programming in Python](https://swcarpentry.github.io/python-novice-gapminder/): This lesson is an introduction to programming in Python 3 for people with little or no previous programming experience. Via [Software Carpentry](https://software-carpentry.org/lessons/)
* [Python lessons](https://programminghistorian.org/en/lessons/?topic=python) from [Programming Historian](https://programminghistorian.org/)
* [Text Analysis Pedagogy Institute (TAPI) Open Educational Resources](https://labs.jstor.org/projects/text-analysis-pedagogy-institute-2/)
* [Tutorial from Python](https://docs.python.org/3/tutorial/)

 
We highly recommend working though these tutorials or attending some workshops in order to become familiar  with some basic python terminology such as: operators, expressions, data types, variables, basic functions. 
* [Python Terms Beginners Should Know – Part 1](https://learnpython.com/blog/python-terms-for-beginners/) & [Python Terms Beginners Should Know – Part 2](https://learnpython.com/blog/python-terms-for-beginners-2/)
* [Python Terms: A to Z Glossary](https://www.coursera.org/resources/python-terms)
* [Full Python glossary](https://docs.python.org/3/glossary.html)



# Installing packages
As you are learning python, installing a a package to help manage packages will be useful.

## Anaconda 
Anaconda is a distribution of the Python and R programming languages that aims to simplify package management and deployment. It allows you to install, update, and manage libraries. Anaconda includes Jupyter Notebooks, and allows you to create separate environments for different projects.

* [Anaconda Distribution](https://docs.anaconda.com/reference/glossary/#anaconda-distribution)
" A downloadable, open-source, high-performance, optimized Python and R distribution with 250+ packages automatically included. Anaconda Distribution provides the option to easily install an additional 7,500+ open-source packages for data science, including advanced and scientific analytics. Anaconda Distribution includes the anaconda package, Anaconda Navigator, and the conda package and environment manager. Anaconda Distribution is available for Windows, macOS, and Linux. 

* [Installing Anaconda](https://docs.anaconda.com/anaconda/install/index.html)

### Additional coding & technology lessons
You also have access to online courses through [LinkedIn Learning & to O'Reilly Learning Platform for Higher Education Tech](https://guides.smu.edu/computationalskills) with your SMU logon.


-----
#### Attribution 

* Written by [Rafia Mirza](http://guides.smu.edu/prf.php?account_id=142826/) 



[![Creative Commons License](https://i.creativecommons.org/l/by-sa/4.0/88x31.png)](http://creativecommons.org/licenses/by-sa/4.0/)
When sharing this material or derivative works, preserve this paragraph, changing only the title of the derivative work, or provide comparable attribution.


