LIS5367 - Week 1 Slides - Intro to Programming
Created Tuesday 11 May 2021
A few things 95% of languages have in common:
- Written in plaintext (there are exceptions)
A few things 95% of languages have in common:
- this is important to remember:
Written BY humans FOR humans. Most everything you see isn't some weird computer artifact: it's a choice.
A few things 95% of languages have in common:
- Punishingly difficult and picky syntax. One character wrong and the whole thing explodes*
*But not HTML or CSS!
Things people debate about over languages:
- Human readability?
- How do you "run" it?
- "Paradigm?" What's the language's main "style?"
- What was it originally designed to do?
- How does it get changed?
- What does it do now?
Many of these boil down to: SIMPLE vs EASY
..which can be opposites, weird
SIMPLE: (Think "command line")
- Few assumptions
- You can see "everything"
- Usually text-only
- Rigid Framework
- "Mathematical"
- Few abstractions - simple data types.
- MORE verbose, MORE language to get things done.
EASY: (Think "iPhone" or "Siri")
- Many assumptions
- A lot is hidden to simplify the view
- Not always text-only
- Multiple Pre-Loaded Frameworks
- "Visual"
- Many abstractions - simple data types.
- Less language to get something up and running.
Human Readability
Old school - Human readability is not important
- Short abstractions are concise and thus quicker
- Forced whitespace is limiting
- There should be MANY ways to do a thing
Human Readability
New school -Hey, looks like human readability is at least
a little important:
- Multiple people working on projects
- Older code needs to be understandable
- There is value in forcing people to do things only one way
"Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live."
"Closeness" to machine
- Compiled Before running, you have to "convert" it., Usually Makes for faster/more efficient code.
- Interpreted - "Conversion" happens on the fly, sometimes through something like a VM
- Scripted - No "conversion" necessary. Usually only
Important "real life" Categories.
(these are fuzzy and non-exclusive)
Procedural/Imperative (default)
Do things step by step
Functional
Turn it into straight up math. No variables, no
"procedures"
Object Oriented
Everything uses an "object" metaphor.
("Black Box Approach")..
Declarative:
Very hands-off.
You don't say "how" - you just tell what to do over a limited set of possibilities.
Along with HTML and MYSQL, this is getting really hot these days;
due to tools like Docker that deal more in e.g.
configuration files as opposed to "coding."
(JSON/YAML etc)
Examples of Languages
(and my opinionated categories)
"Low Level"
C
Rust
Go
Examples:
"Midrange"
Java
Python
..And then the holy mess that is the web.
Here goes: This ONLY makes sense if you remember that the web grew and accreted on itself, and encouraged to do so primarily by "market forces"...
as opposed to "designed."
(evolution v. intelligent design?)
Text
Plain ol' text. BBS and the like
HTML
"Lets make this look better than the Matrix, SEMANTICALLY"
CSS
"Still kind of ugly, now let's go VISUAL"
Okay but we need interactivity...
OKAY, how about, lets just reach into the computer and run random programs
cgi-bin
This actually worked for a while when we were oh so innocent...
Server-Side
PHP.
Click a menu and get back some generated HTML. Cool!
LETS GET OUR BLOG ON.
Combine with MySQL for even more power!
Client-side
uhoh.
"Okay, so we want things to move around. And maybe more..."
Client-side
We've got this thing people are using to literally make cartoons...
..so I guess we're going to use it for EVERYTHING.
Flash
Javascript
Clearly, we can do better than Flash. I mean, we could slap that together in a weekend and name it something similar to something that already exists because okay
Javascript part deux
Okay, maybe that wasn't a great idea...
but too bad, here we are.
RECAP FOR US (stuff we will or might see)
HTML - the very beginning, "Markup." Still the base for a lot of this stuff.
CSS - For styling, but for us also...
DOM - Document Object Model (how we "reach into" webpages and manipulate parts)
Languages
PHP
Perhaps the grandaddy of server-side, yet still widely in use
Javascript
Overwhelmingly, the 800 lb gorilla of client side, and as a result is gooping out into other frameworks and, well, everything. More later.
Bash / Shell Scripting
- You *might* use it to generate static pages and other cool and wonderful hacks, but probably not useful for much interactive.
Python?
Flippin' great language. A little client side is done here, also much in the way of scraping, ML, AI et al
Ruby?
Maybe? I'm not sure if it's worth it for us
Anything else?
You tell me...