Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Secrets to Mastering Any Programming Language

The Secrets to Mastering Any Programming Language

Presented at FOSSAsia 2015, Singapore.

Michael Cheng

March 14, 2015
Tweet

More Decks by Michael Cheng

Other Decks in Programming

Transcript

  1. My experiences...
    Secret to Mastering Any
    Programming Language
    1

    View Slide

  2. Michael Cheng
    Software Engineer, Neo Innovation Inc.
    http://twitter.com/coderkungfu
    http://github.com/miccheng
    http://CoderKungfu.com
    2

    View Slide

  3. About Me
    • Self-learned front-end / back-end / iOS developer
    • Building web apps since 2001
    • Started Singapore PHP User Group in 2006
    • Co-founded iOS Dev Scout (2012)
    • Worked in startups: Foound (2010) and mig33 (2012)
    • Joined Neo Innovation Inc. in March 2014
    3

    View Slide

  4. Hello world!
    1) How do you output
    stuff on screen?
    4

    View Slide

  5. Strings, numbers, floats, date, datetime
    2) What are the data
    types available & how to
    present them?
    5

    View Slide

  6. Variables, constants, arrays, hashes and variable scope
    3) How do u pass data
    around? When to use
    which channel?
    6

    View Slide

  7. Control structures, flow control, if else, switch case
    4) How to add artificial
    intelligence?
    7

    View Slide

  8. Functions, classes / OOP, server side includes
    5) How to not repeat
    yourself? (too often)
    8

    View Slide

  9. Specifics…
    9
    “A string” “Hello,
    $name”
    42
    3.146
    $variable
    $obj->variable
    Klass::$static_var
    SOME_CONSTANT
    Klass::SOME_CONST
    “A string” “Hello
    #{name}”
    42
    3.146
    local_variable
    $global_var
    Klass.class_var
    SAME_CONSTANT
    Klass::SOME_CONST

    View Slide

  10. Specifics…
    10
    if($morning == true){
    echo “Hullo”
    }
    if ($morning)
    echo “Hullo”
    if morning?
    puts “Hullo”
    end
    puts “Hullo” if morning?

    View Slide

  11. Specifics…
    11
    array(10, 20, 30)
    array(1, 2, 3, 4, 5)
    array(
    “a” => “Apple”,
    “b” => “Banana”
    )
    [10, 20, 30]
    [1..5]
    {
    a: “Apple”,
    b: “Banana”
    }

    View Slide

  12. Specifics…
    12
    class Tea extends Beverages{
    private $water
    private $milk
    public function __construct(){
    $this->water = true;
    $this->milk = true;
    }
    public function is_good(){
    return true;
    }
    }
    class Tea < Beverages
    def initialize
    @water = true
    @milk = true
    end
    def good?
    true
    end
    private
    def secret
    “hello”
    end
    end

    View Slide

  13. Language specific goodies...
    • Package management
    • Read open source code (other people’s code - learn best practices)
    • Tooling
    • IDE / text editor
    • TDD/BDD
    • Get help
    • Google, StackOverflow, Screencasts
    • Pair programming with a senior
    • Books
    13

    View Slide

  14. http://careers.neo.com/
    We’re Hiring!
    14

    View Slide