MIC102G » Lecture 1
- About Me: http://adam.shadowpuppet.net
- Who are you and what do you want to get out of this class
- Prevent manual duplication and tediousness (HTML lists)
- Creating 1000 files
- Emailing everyone in a list, one at a time
- Parsing content (filtering/reformatting)
- Create interactivity (flash movies, events)
- Visual Effects
- Dynamic population (database driven content)
- Creating a navigation list (like in WordPress)
- User Directory
- https, public key crypto, etc...
It's just math, like algebra, right?
- Functions (similarities and differences)
- Algebra: f(x) = x2
- Syntax (different between languages)
- string concatenation
- data types
- strong vs. loose types
- Logic! (conditionals)
- PHI 106 (intro to logic)
- If, else, elseif
- Human readable vs. Machine readable
Popular Modern Languages
Here are some popular modern languages:
Java is a full-blown Object-Oriented Programming language. Java is compiled to run inside of the Java Virtual Machine. This allows it to run on multiple operating systems without needing separate compiled binaries for each OS type.
C++, like Java, is fully Object-Oriented and it is a compiled language. However, C++ is not written to run inside of a universal Virtual Machine. A C++ program that is intended to be run on both Windows, Linux and Mac OSX will require separate code compilations for each operating system. C++ is a popular language for writing Operating Systems and desktop applications.
C# is popular as both a desktop application programming language and as a server-side web programming language to support ASP .NET driven web sites.
This is the language used to program iPhone applications and desktop applications on Mac OSX.
A popular Object-Oriented, Server-Side language.
Python is used primarily as an embedded scripting language and as a Server-Side web language.
PHP is a very popular Server-Side scripting language. It has a large open-source community of extension developers
Perl is primarily used for server side batch processing, system administration scripts and as a Server-Side language for creating web CGI applications.
Scripted vs. Compiled
Scripted languages are interpreted line by line, executing the next line of code only after the current line has finished running. Scripted languages ship the source code as executable code. For this reason, code written in scripted languages are more likely to be treated as Open Source software. However, many code obfuscation techniques can hide or mask source code to a non-human readable state.
Compiled languages are written in human readable code and then run through a compiler, which extracts the human readable code into machine readable code. The running operating system doesn't know how to read a set of functions the way a human can so the code needs to be compiled in a way that the machine can understand it. After being compiled, the code can be executed on whatever platform it was compiled for. If the language is written to run inside of a virtual machine, the virtual machine acts as a guest operating system for that application.
Scripted languages can be thought of as running inside of a virtual machine. This is either a web browser or an appication like Zend (the environment that serves PHP pages) or an embedded system.
Client-Side Vs. Server-Side
Client code is anything that is downloaded and run on the user's machine. Server code is code that runs on the server. The output of that code's execution may end up in the user's hands but the code itself is never run on the user's machine. Server code is the only code that you can trust hasn't been modified (with a few minor obscure and complex exceptions).
Client-Side Code Security
- Client code cannot be trusted
- It's run by the user, in their environment.
- They don't have to run it at all
- Validation of all input data must be done on the server.