Skip to content

Latest commit

 

History

History
73 lines (56 loc) · 2.14 KB

File metadata and controls

73 lines (56 loc) · 2.14 KB

Pre-Programming: Useful Things for Programming

There is more than one shell

  • telnet
  • python
  • bash inside bash
  • pretty much any program that felt like having a shell (SQL, etc.)

Platform-specific issues

  • Line endings
  • Drive and file paths
  • What it is for
  • When you might need it (see e.g. questions on StackExchange)

Data types

  • '1234'
  • What is that for you?
  • What is it for the computer?
A data type (or just type) tells the program/interpreter/computer what kind
of data a specific value can have.
In programming or in databases data types are used to define attributes or
variables and define particular characteristics. Data types include classifications
like integers, floating point values, strings, characters etc.
  • Common data types:
    • for numbers: integer (int), float (1234, 12,34)
    • for text: string (hello)
    • for true/false: boolean ()

Data structures

Many programming langages provide means to group or collect variables together

  • lists, arrays (e.g. [1,2,3,5,8])
  • sets, tuples (e.g. ('A', 'B'))
  • maps, dictionaries (e.g. {"name": "Walter"})
  • nested datatypes, e.g. to represent a matrix:
123   ---->   [[123],[456],[789]]
456
789

Close reading of error messages

  • ls -z
  • use a filename as command
  • cp file file file
  • other error messages we've seen?
  • The power of Google
  • Stack Overflow

Documentation, man pages and --help

  • grep / regular expression docs
  • mark up printout of ls, where do you get stuck?
  • [read the man page to find how to print files in reverse order]
  • [how to use cat to print line numbers?]
  • Searching for help
  • knowledge transfer: regular expressions in word processors, e.g. searching in MS Word

The hard way

  • install Mallet (from here)!
  • Get stuck, get a chocolate
  • This is an exercise in running into problems and resolving them, not an exercise in showing how skilled you are!