how does one learn to program?

44
Academy Building Better Nerds™ www.codergv.com All Rights Reserved http://goo.gl/ vfJE4o Join the presentation

Upload: olmo-f-maldonado

Post on 10-Jan-2017

25 views

Category:

Education


0 download

TRANSCRIPT

Academy

Building Better Nerds™

www.codergv.com

All Rights Reserved

http://goo.gl/vfJE4o

Join the presentation

Academy

Building Better Nerds™

www.codergv.com

All Rights Reserved

How does one learn to program?

by Olmo MaldonadoGMG Agency, LLC

Dec. 4th, 2014

Academy www.codergv.com • All Rights

Reserved

Instructor: Olmo Maldonado➔Over 10 years of experience as Software Engineer

➔Masters in Electrical Engineering from UCLA

➔Founder Tech Tuesdays, Code#RGV➔MooTools Developer➔Ex-Googler with Google Photos Team, circa 2009

➔Fluent in JavaScript, PHP, and many more web tech

Contact & Follow{facebook, twitter, github}.com/ibolmo

Academy www.codergv.com • All Rights

Reserved

Sorry, this is not a“How to get started programming

course”

This course is about➔jump starting your programming engine

➔life lessons in the programming craft➔how you should navigate the waters

Disclaimer

Academy www.codergv.com • All Rights

Reserved

You should if you➔Like taking apart problems➔Want to develop a new skillset that pays dividends the more you master it

➔Don’t mind stumbling and getting back up

First Step: Why should I learn?

Academy www.codergv.com • All Rights

Reserved

You should not if you➔Expect to “get it” in one week; let alone 1 month

➔Expect to make it “big” within 1 year*

➔Are shy, or need to be continuously motivated

*: Your mileage may vary (YMMV).

First Step: Why should I learn?

Academy www.codergv.com • All Rights

Reserved

Bottom Line: Define Your Purpose

Programming is tough. You will be tested at every single

moment. You will get frustrated. You will wonder whether it’s going

to get any easier. If you don’t have a purpose, or drive, you

will easily give up.

Academy www.codergv.com • All Rights

Reserved

Defining A Purpose: Ideas➔Projects you’ve always wanted to do*

➔Research and fix bugs for your favorite software, framework, library, or company

➔Clone or improve an existing app or idea

➔Pair up with someone from Code#RGV that already has a project

➔Do a Challenge◆E.g. www.hackerrank.com,

mscodechallenge.net

*: Not a new idea, but something already done or “easy” to achieve/modify.

Academy www.codergv.com • All Rights

Reserved

What if someone asked you to build them a house?➔Look for similar houses’ blueprints➔Modify blueprint➔Seek advice from city regulation, original architect, and other architects

Alternatively,➔Start with an empty canvas, a square, and pencil

Why start with something made?

Academy www.codergv.com • All Rights

Reserved

Never Start with An Empty Canvas *

Compare your work with what’s expected. Especially at this stage:

make your life easier.

*: Everyone does this all the time. More explanation soon.

Academy www.codergv.com • All Rights

Reserved

Review: What is it going to take?➔ Patience and pressing the I believe

button

➔ Aptitude, or hard work, to:◆ ingest (educate)◆ investigate (explore)◆ improve (evolve)

Academy www.codergv.com • All Rights

Reserved

So, you still want to code?Choosing a Language*

➔All languages are (relatively) the same but with different flavors.

*: Actually, this is probably already chosen for you -- by the projects you’d like to do.

Academy www.codergv.com • All Rights

Reserved

Languages: What is a Language?➔English instructions for the computer

➔You define a program with a language JavaScript PHP Python

var variable = 1;1 + 1; // answer is 2for (var i; i < 10; i++){ console.log(i);}function method(argument){ return argument;}method(variable);

$variable = 1;1 + 1; // answer is 2for ($i; $i < 10; $i++){ echo i;}function method($argument){ return $argument;}method($variable);

variable = 11 + 1 # answer is 2for i in range(0, 10): print idef method(argument): return argumentmethod(variable)

Academy www.codergv.com • All Rights

Reserved

What’s in a Language?Most, if not all, have➔Variables➔Types➔Functions➔Control Flow➔Exceptions➔Comments➔and many more

Each has their merit➔Choose by need, and not by fervor

Want a class in a specific language?

[email protected]

Academy www.codergv.com • All Rights

Reserved

Tip: How to Choose➔Stick to a scripting language

◆PHP, JavaScript, Python, Ruby, and so on◆Faster, easier debugging (in most cases),

and cross platform➔If you are getting paid to learn the language

➔Find a framework (Unity3d, Phonegap) and learn the underlying language

➔Ask your immediate coding friends what they are working with, and use that

Academy www.codergv.com • All Rights

Reserved

How do I learn?

Seems like a cheap answer, but:Google is your best friend™

Don’t worry there are examples coming up.

Academy www.codergv.com • All Rights

Reserved

When starting a new languageSearch for➔Language comparisons

◆“PHP vs Python”◆“switching to python from php”

➔Best practices◆“JavaScript best practices”

➔Gotchas◆“Python gotchas”◆“JavaScript bad practices”

Academy www.codergv.com • All Rights

Reserved

Resource: Books *

➔The Pragmatic Programmer◆Free ebook: http://goo.gl/L4yZFv

➔Code Complete◆Free ebook: http://goo.gl/Nl1OyO

➔Clean Code◆Free ebook: http://goo.gl/bAQxP7

➔Design Patterns◆Free ebook: http://goo.gl/9wIEc2

*: Notice not a single one is about a specific language.

Academy www.codergv.com • All Rights

Reserved

Google Search for“Code Complete ext:pdf”

http://bit.ly/1AmvCk9

Learn more about Google Search Operators: http://www.googleguide.com/advanced_operators_reference.html

*: Use responsibly. Gotta love the internet. :D

Aside: Free Ebooks *

Academy www.codergv.com • All Rights

Reserved

Other Resources: BlogsBlogs are forward thinking, and archive the most annoying problems➔Fabien Potencier (Symfony, PHP)➔CSS-Tricks (CSS)➔David Walsh (JavaScript, MooTools, jQuery)

➔Dean Edwards (JavaScript)

Follow on Facebook, Twitter, or use IFTTT recipe to receive updateshttps://ifttt.com/recipes/99479-rss-to-email-formatted

Academy www.codergv.com • All Rights

Reserved

Other Resources: Slideshows

speakerdeck.com

slideshare.net

Academy www.codergv.com • All Rights

Reserved

Other Resources: YouTubeThe holy grail.

Academy www.codergv.com • All Rights

Reserved

Shave off 8 minutes!

Aside: Fast Video ViewingShave off 8 minutes!

youtube.com/watch?v=f7AU2Ozu8eo

Academy www.codergv.com • All Rights

Reserved

Resources: References➔use the website of the language

◆php.net, python.org, ecmascript.org, ruby-lang.org

➔tutorial sites◆lynda.com, code.tutsplus.com

➔online education*

◆codecademy.com, udemy.com, code.org, coursera.com

*: I’m not a fan, but they are improving. YMMV.

Academy www.codergv.com • All Rights

Reserved

What’s next? DevelopmentEach worth it’s own class but here’s an overview➔Editors or IDEs➔Terminals (Prompts)➔Package managers➔Version control➔Environment or PlatformWhat should be the next

[email protected]

Academy www.codergv.com • All Rights

Reserved

Development: Editors or IDEsEditors (desktop)➔Sublime Text 3 and Package Manager

➔Github Atom➔Textmate➔Coda➔Notepad++

IDEs➔Cloud9 (online)➔Visual Studio (both)

➔IntelliJ (desktop)➔XCode (desktop)

Academy www.codergv.com • All Rights

Reserved

➔Each language has their own package management. Find more here

◆brew, gem, npm, easy_install, pip, apt-get, bower, composer

➔Each has their own way to search for packages

◆brew search, npm search, gem search, apt-cache search

➔Most packages have a version control like ‘git’

➔Review the usage and adoption of the package

Development: Packages

Academy www.codergv.com • All Rights

Reserved

https://github.com/iojs/io.js/graphs/contributors

Academy www.codergv.com • All Rights

Reserved

I don’t care but use a version control

➔Use git, git-scm.com

➔Use mercurial, mercurial.selenic.com

➔Use SVN or CSV

Development: Version Control

➔github.com

➔bitbucket.org

➔trac.edgewall.org

Travel in time or work in a parallel universe

I don’t care but use a version control

Academy www.codergv.com • All Rights

Reserved

A machine within a machine➔Take your development environment with you

➔No harm to your computer Use Vagrant boxes ➔vagrantcloud.com➔Ex: http://goo.gl/Si8x7u➔LAMP, Python, Ruby➔one line to install

Aside: Virtual Machines (Vagrant)

Credit: http://goo.gl/MJhrgV

Academy www.codergv.com • All Rights

Reserved

Review (so far)➔by now you understand the commitment

➔how to get educated and stay educated

➔and setup of your environment

Next➔Coding and Practical Matters

Academy www.codergv.com • All Rights

Reserved

Rule: Don’t Reinvent The WheelSomeone already went through the

troublehttps://github.com/explore

Academy www.codergv.com • All Rights

Reserved

Use Code Repositories➔https://github.com/search/advanced➔https://code.google.com/hosting/search➔http://sourceforge.net/directory/freshness:recen

tly-updated/

Use Package Managers➔ brew search, npm search, gem search, apt-

cache search

Finding Packages

Academy www.codergv.com • All Rights

Reserved

https://github.com/search?q=3d

Academy www.codergv.com • All Rights

Reserved

Tip: Subscribe

Academy www.codergv.com • All Rights

Reserved

➔Read the source code➔Hack things together

When you’re stuck …➔Ask questions in

◆stackoverflow.com◆user forums◆Code#RGV Forum (Facebook Group)◆IRC channel

Next Steps

Academy www.codergv.com • All Rights

Reserved

Online chatroom(s) for nerds.

http://webchat.freenode.net/?channels=python

Aside: IRC Channel?

Academy www.codergv.com • All Rights

Reserved

Aside: Internet Relay Chat (IRC)➔Many professionals from Fortune 500 from around the world

➔Most open source are on IRC◆#mootools, #jquery, #nodejs, #python,

#rails, #angularjs➔Try to ask only if you’ve done a Google Search

➔Don’t be offended, and don’t offend others

➔IRC Clients◆webchat.freenode.net, Colloquy, mIRC

➔Beware of files

Academy www.codergv.com • All Rights

Reserved

How To Ask a QuestionSeems stupid, but it’s critical. Include:➔What have you tried?➔What did you expect?➔What happened (if anything), and were there any errors?

➔Mention what projects you are using➔Use gist.github.com, or pastebin.com to paste your code

Academy www.codergv.com • All Rights

Reserved

Challenge: Contribute to O.S.If you’ve benefited from an answer, or from an open source project you should reciprocate the gesture.➔Research and answer questions

◆ stackoverflow.com/questions/tagged/javascript?sort=unanswered

◆ forum.jquery.com

➔Fix bugs or send enhancements◆ github.com/facebook/react/issues◆ github.com/iojs/io.js/pull

➔ Open Source a private project

Academy www.codergv.com • All Rights

Reserved

True Story: I’ve BenefitedBy contributing to MooTools➔Satisfaction in helping others➔Learned in collaboration➔My code has been used by hundreds of developers, and millions of users

➔One of the reasons that Google employed me

This is not an isolated incident, though. Majority of MooTools devs are now part

of Facebook.

Academy www.codergv.com • All Rights

Reserved

How does one learn to program?1.Find a purpose, and stay committed2.Choose a project/goal and find

packages to help you get started in learning a language

3.Setup your environment and become proficient

4.Be part of a community, and contribute back

Academy www.codergv.com • All Rights

Reserved

HomeworkPost answers to Code#RGV Forum, or use #codergv #academy #hw in tweets and posts1.Define, or find, a project to learn

programming2.Pick one or more language for doing

the project3.Write a Getting Started guide for the

language4.Follow a blog, Github user, and

YouTube channel5.Setup VirtualBox and Vagrant; and a

Vagrant Box6.Answer a question on

StackOverflow.com7. Join a IRC channel and ask a question

Academy

Building Better Nerds™

www.codergv.com

All Rights Reserved

Thank You!

#codergv#academy

Evaluationhttp://goo.gl/D73ljr

lowercase L