See these subfolders for more documents:
This is a really quick introduction to computer programming, CS and Python for the CS101 course.
- Any feedback, question, remark or improvement is of course welcome!
- This is also (publicly) available on-line at perso.crans.org/besson/cs101,
- as a PDF at perso.crans.org/besson/cs101/index.pdf,
- or as a simpler web-page at perso.crans.org/besson/cs101/index.htm.
Reading this document will give you a short overview of what you will learn at Mahindra École Centrale (MEC) during the CS101 course and why you will learn it. This course will be given in the second semester of 2014-2015 (from January 2015 to May 2015).
A lot of resources are available (websites, videos, on-line courses, problems, textbooks etc). You should try to spend some time reading, viewing or working on these, by your own: before the beginning of the course but also during the course.
During the December (2014) break, you will have 4 weeks without any class, and working on that CS101 course is an excellent way for you to prepare the second semester, to stay focus on learning, and maybe to have some fun!
CS101
@
crans.org
.Computer programming (often shortened to programming) is a process that leads from an original formulation of a computing problem to executable programs.
It involves activities such as analysis, understanding, thinking, and generically solving such problems resulting in an algorithm, verification of requirements of the algorithm including its correctness and its resource consumption, implementation (commonly referred to as coding) of the algorithm in a target programming language.
Computer programming and software engineering are nowadays one of the most popular activities for newly trained engineers, and lots of you will probably do internships or find your first jobs in an IT company!
Whatever the approach to development may be, the final program must satisfy some fundamental properties. The following properties are among the most relevant:
Usability: the ergonomics of a program, ie the ease with which a person can use the program for its intended purpose or in some cases even unanticipated purposes.
Reliability: how often the results of a program are correct.
Readability: to the ease with which a human reader can comprehend the purpose, control flow, and operation of source code.
Robustness: how well a program anticipates problems due to errors (not bugs).
Efficiency or performance: the amount of system resources a program consumes (processor time, memory space, slow devices such as disks, network bandwidth and to some extent even user interaction): the less, the better.
Portability: the range of computer hardware and operating system platforms on which the source code of a program can be compiled/interpreted and run.
Maintainability: the ease with which a program can be modified by its present or future developers in order to make improvements or customizations, fix bugs and security holes, or adapt it to new environments.
This short explanation comes mainly from Wikipédia. The linked articles give more details!
Because it is free, excellent on the 6 firsts of these 7 key aspects, and because of how easy it is to learn and use it in comparison to the other popular languages (such as C or Java), we at MEC have decided to use Python for the CS 101 and 202 courses (the two first CS courses in the common syllabus of our 4 branches). Other languages will be used in the future for some other courses.
That small 2-line program below will be Python thanking us for chosing it, by producing that output: « I am so happy that you chose me! » -- Python 2.7.6
!
Python is an easy-to-learn, powerful programming language, and one of the most popular in the world from the last 15 years. Python is a widely used general-purpose, high-level programming language.
It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python's elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for beginners, but also for scripting and rapid application development in many areas and on most platforms. The Python interpreter and the extensive standard library are freely available in source or binary form for all major platforms from the Python Web site, Python.org. The same site also contains distributions of and pointers to many free third party Python modules, programs and tools, and additional documentation.
Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in languages such as C++
or Java.
The language provides constructs intended to enable clear programs on both a small and large scale.
Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles.
It features a dynamic type system and automatic memory management and has a large and comprehensive standard library, the result of years of hard work by a huge community scattered around the world.
This short explanation comes mainly from the Python.org Tutorial and the Wikipédia page about Python. Feel free to follow your curiosity and go read more!
During your +11 or +12, or during your former education, you may have learned or started to learn C, C++, or Java. If you did, you probably remember how slow and painful is the usual write/compile/test/re-compile cycle. Programmers should read wiki.Python.org/moin/BeginnersGuide/Programmers.
And having no previous experience at all in programming is not an issue for this course, because we will start from the really basics. True beginners should read wiki.Python.org/moin/BeginnersGuide/NonProgrammers.
If you do much work on computers, eventually you find that there is some task you would like to automate For example, you may wish to perform a search-and-replace over a large number of text files, or rename and rearrange a bunch of photo files in a complicated way. Perhaps you would like to write a small custom database, or a specialized GUI application, or a simple game.
In any case, Python is just the language for you. This page (docs.Python.org/2/tutorial/appetite.html) gives a more complete overview of the many reasons to learn programming, and especially to chose Python!
We chose Python 2 (version 2.7) rather than Python 3.4 (for many reasons). One lecture at the end of the course might be used to highlight the main differences between the two versions, but do not worry, they are very similar! We will also quickly explain how to easily port a Python 2 code to Python 3, if necessary.
These websites are the most useful resources for learning Python, and we plan to use them a lot.
This CS101 course aims to teach all of our MEC students about the basics of programming computers and algorithmic, using Python 2.
This course is specifically designed to be your first programming course using the popular Python programming language. For a lot of you, this will be your very first contact to computer programming.
The outline of the course is designed to start from the fundamental bases and to go slowly to an intermediate level in algorithmic, problem solving using a computer program, and Python. We will use simple examples, some data analysis and some questions from chemistry, physics, maths and engineering courses as programming exercises through the course. And you will have lots of time during the CS labs to practice programming and to think on your own (but always with the help of one or more tutors and lab assistants).
Understanding how to process data is valuable for everyone regardless of your career. This course might kindle an interest in more advanced programming courses or courses in web design and development (this will be covered for the CSE branch students in third and forth years); or just provide some basic skills to help you when you are faced with a bunch of data that you need to analyze.
You can do the (first) programming assignments for the class using your personal computer or smart-phone (or even a web-browser). All required softwares and on-line resources for the course are free (and open-source). It is highly recommended to install Python on your own machine (with Anaconda). Regardless if you use a Mac, a Windows or a UNIX/Linux computer, Python is available for you!
Well, the programming lab sessions will happen in the computer lab, which is open for you a lot. For viewing the on-line lectures, practicing for assignments and projects and working on your own, it is recommended to have your own laptop, but you can manage without it. We will do our best to help you in case you do not have your own machine. Purchasing a laptop will help but it is not mandatory.
The goal of this course is also to teach you to think like a computer scientist. This way of thinking combines some of the best features of mathematics, engineering, and natural science.
The single most important skill for a computer scientist is problem solving, which means the ability to formulate problems, think creatively about solutions, and express a solution clearly and accurately. As it turns out, the process of learning to program is an excellent opportunity to practice problem solving skills. On one level, you will be learning to program, a useful skill by itself. On another level, you will use programming as a means to an end. As we go along, that end will become clearer, especially with the programming project you will have to do in March and April 2015.
This small paragraph gives some logistic details, for you to know how this CS101 course will be conducted. Some of these details can still change.
The CS101 course will be half time of lectures, and half time of labs, and many professors will be there for both lecturing and conducting the labs:
These two books are already available at the MEC library, and will be available at the MEC stationary shop.
If you are impatient and want to order them by yourself, feel free to do it, either by the stationary shop or via flipkart.com!
These books are freely available, on-line (as soft copy). It is possible to download them once in order to read them from your (off-line) laptop or smart-phone anytime you want. All these resources will be available off-line on every computer of the CS lab, in order to allow you to consult them whenever you want.
This last part gives a lot more resources and links to help you learn algorithmic, programming and Python.
Python and concrete programming will be the main part of the CS101 course, but you will also learn about algorithms and data structures, and it will be an important part of the the course and main component of evaluations.
These books are already available at the MEC library, and some will be available at the MEC stationary shop.
As far as now, we decided to use the Spyder EDI for this course.
In CS 101 labs, we will be able to help you if you use the same environment as everyone, of course it will be harder if you choose something else. We will try our best, but for both you and us, it will really be simpler if you also use Spyder.
Spyder will be used on Windows and Ubuntu as the editor and software to write, execute, analyze and debug your Python programs.
Spyder has many advantages: it is free and open-source, easy to install on many platforms (Windows, Mac OS X and Linux), and it is easy to begin with. But it is also powerful enough to do everything we need for CS101, including for real projects as you will have to deal with for the second group project. The recommended way to install and keep up-to-date Python and Spyder is to use Anaconda.
But if you want to try another Integrated Development Environment (IDE), on your own:
These free web-services brings all the simplicity, conciseness and greatness of Python right into your web browser!
You can use any of these to quickly test a piece of code, or practice programming with your laptop or smart-phone from anywhere, without having to install Python!
It is also possible to install an application on any recent smart-phone, allowing you to use Python on your device even off-line!
These websites could help you, but we will not use them. Feel free to visit them, and you can use them if you want, on your own.
These other websites are not focused on Python, but can be interesting for you, in the future.
This document has be written by Lilian Besson for the Computer Science 101 course at Mahindra École Centrale, in November 2014..
Feel free to contact me for any reason, by email at CS101 at crans.org
or with that (anonymous) form at perso.crans.org/besson/contact/en.
This document is publicly published, under the terms of the GNU Public License v3 (as will be every single resource produced for the CS 101 course).
Finally, all the quoted resources (websites, books, videos, slides, programs etc) are the properties of their respective authors, and neither me (Lilian Besson) nor Mahindra École Centrale are affiliated to any of them. By the way, Python and Python.org are trademarks of the Python Software Foundation.