Getting Started with Coding

69
Bohyun Kim (@bohyunkim ) Associate Director, Library Applications and Knowledge Systems University of Maryland, Baltimore HS/HSL http://bohyunkim.net/blog Slides: http://www.slideshare.net/bohyunkim/getting-started-with-coding NN/LM SEA Webinar | Feb. 18, 2015 | #seacode

Transcript of Getting Started with Coding

Page 1: Getting Started with Coding

Bohyun Kim (@bohyunkim)

Associate Director, Library Applications and Knowledge Systems

University of Maryland, Baltimore HS/HSL

http://bohyunkim.net/blog

Slides: http://www.slideshare.net/bohyunkim/getting-started-with-coding

NN/LM SEA Webinar | Feb. 18, 2015 | #seacode

Page 2: Getting Started with Coding

Learning How to Code is Popular Now!

http://www.codecademy.com/

Page 3: Getting Started with Coding

http://blogs.kqed.org/mindshift/2012/09/should-kids-learn-to-code-in-grade-school/

Page 4: Getting Started with Coding

http://www.nydailynews.com/life-style/coding-camps-kids-rise-popularity-article-1.1383074

Page 5: Getting Started with Coding

http://www.pbs.org/mediashift/2015/01/why-journalism-students-need-a-baseline-understanding-of-coding

Page 6: Getting Started with Coding

https://www.quora.com/Should-I-learn-how-to-code-if-I-plan-on-being-a-full-time-real-estate-investor?share=1

Page 7: Getting Started with Coding

https://docs.google.com/spreadsheets/d/1Obzf_n7vkB-WwVXMH1XzouTSGwX89Glq2_WbhECDUQs/pubhtml#

Page 8: Getting Started with Coding

http://organizedscientist.blogspot.com/2014/09/learning-to-code-how-learning-to.html

Page 9: Getting Started with Coding

http://www.bbc.com/news/technology-16440126

Page 10: Getting Started with Coding

http://code.org/about

Page 11: Getting Started with Coding

http://techcrunch.com/2014/12/08/barack-obama-becomes-the-first-president-to-write-code/

Page 12: Getting Started with Coding

Diverse Groups of People Learning How to Code

• Kids

• Journalists

• Real-estate investors

• Academics in digital humanities (literature, history, classical studies/philology)

• Scientists

• Politicians

• Librarians

Page 13: Getting Started with Coding

http://www.ala.org/lita/about/igs/codeyear/jnt-lcy

Page 14: Getting Started with Coding

http://wiki.code4lib.org/index.php/2014_preconference_proposals

Page 15: Getting Started with Coding

http://www.infodocket.com/2015/01/23/video-presentations-from-oclcs-developer-house/

Page 16: Getting Started with Coding

http://dp.la/info/2014/10/07/dpla-community-reps-produce-hackathon-planning-guide-now-available/

Page 17: Getting Started with Coding

http://www.atyourlibrary.org/hackathon-your-library

Page 18: Getting Started with Coding

http://showoffyourapps.challengepost.com/

Page 19: Getting Started with Coding

http://www.ncbi.nlm.nih.gov/news/11-26-2014-genomics-hackathon/

Page 20: Getting Started with Coding

http://www.hackinghealth.ca/about/faq/

Page 21: Getting Started with Coding

4 Themes for Today

1) Why learn how to code?

2) What does coding, scripting, programming exactly mean?

3) What is it like to teach oneself how to code?

4) Tips and resources

Page 22: Getting Started with Coding

(1) Why Learn How to Code?

• Dress up or dynamic webpages• Website redesign

• LibGuide customization

• How to use CMS

• Mobile-friendly/responsive library website

• Customize/Add features to library systems• Example: GVSU Library Lab

(https://gvsulib.github.io/)

• Data processing in batch; automation

Page 23: Getting Started with Coding

What You Can Do with Coding

• Write plug-ins• LibX, Zotero, etc.

• Full-blown programs• http://showoffyourapps.challengepost.com/

• http://librarylab.law.harvard.edu/projects.html

• http://www.nypl.org/collections/labs

• http://code.library.arizona.edu/gots/

• Relevance to librarianship• Understand better the information systems and everyday software

• Improve communication and collaboration with IT

Page 24: Getting Started with Coding

https://osc.hul.harvard.edu/liblab/projects

Page 25: Getting Started with Coding

http://www.nypl.org/collections/labs

Page 26: Getting Started with Coding

Or Just for Fun!

http://scratch.mit.edu/projects/48382460/

Scratch:http://scratch.mit.edu/

Page 27: Getting Started with Coding

It Will Be Magical!

Really!?

Page 28: Getting Started with Coding

It’s Called a Language for a Reason• Syntax: It has its own quirks.

• Core concepts: • Variable

• Constant

• Array

• Loop

• Function

• Object

• Class

• A programming language CANNOT be learned in a day or a month.

• Practice: It takes a lot of time to master.

• Very cool to see mastery in action.

Page 29: Getting Started with Coding

Funky and foreign-looking

• var a = ["do", "re", "mi", "fa"];var len = a.length;for (var i = 0; i < len; i++) {

console.log(a[i]);}

• $a = array("do", "re", "mi", "fa");for ($i=0; $i<count($a); $i++){

echo $a[$i]."<br/>";}

• $a = array("do", "re", "mi", "fa");foreach ($a as $i=>$note){

echo $note."<br/>";}

• a = ['do', 're', 'mi', 'fa']for i in a:

print i

• JavaScript

• PHP

• PHP

• Python

Page 30: Getting Started with Coding

Techinical ≠ Programming

• XML

• Bootstrap

• PHP

• API

• R

• HTML5

• JavaScript

• Python

• ColdFusion

• Node

• MashUp

• RoR

• CSS

• .NET

• Regex

• XPATH

• JavaScript

• Drupal

• VB

• Django

• XSLT

• RDF

• Ruby

• SPARQL

• CakePHP

• MySQL

• Apache

Page 31: Getting Started with Coding

(2) What Is Programming?

• What do you and others mean when they say “coding,” “scripting,” or “programming”?

• Programming is NOT knowing how to use a CMS (Wordpress, Drupal) or a certain computer software like Dreamweaver (except IDEs).

• Programming is NOT the same as editing HTML, CSS, XML. (http://www.cs.tut.fi/~jkorpela/prog.html )

• Programming is knowing and writing the logic for a computer to execute in a programming language that a computer understands.

• N.B. Markup language vs. Programming language

Page 32: Getting Started with Coding

Markup Language

http://www.w3schools.com/css/tryit.asp?filename=trycss_list-style-type_ex

Page 33: Getting Started with Coding

Markup Language

Page 34: Getting Started with Coding

• JavaScript

• PHP

• PHP

• Python

ProgrammingLanguage

• var a = ["do", "re", "mi", "fa"];var len = a.length;for (var i = 0; i < len; i++) {

console.log(a[i]);}

• $a = array("do", "re", "mi", "fa");for ($i=0; $i<count($a); $i++){

echo $a[$i]."<br/>";}

• $a = array("do", "re", "mi", "fa");foreach ($a as $i=>$note){

echo $note."<br/>";}

• a = ['do', 're', 'mi', 'fa']for i in a:

print i

Page 35: Getting Started with Coding

Programming enables the dynamic manipulation/transformation of input through a control structure.

Page 36: Getting Started with Coding

Is Coding Programming?

• The distinction between these two can be murky.

• Usually the term, ‘coding,’ is used to include the knowledge of a programming knowledge beyond that of a markup language.• http://blogs.jbllanda.com/markup-language-versus-programming-

language/

• Here, I will use both terms – coding & programming –interchangeably.

• See the difference between scripting. vs. programming:• https://en.wikipedia.org/wiki/Scripting_language

• http://stackoverflow.com/questions/17253545/scripting-language-vs-programming-language

Page 37: Getting Started with Coding

My Tiny Python Script

Page 38: Getting Started with Coding
Page 39: Getting Started with Coding
Page 40: Getting Started with Coding
Page 41: Getting Started with Coding
Page 42: Getting Started with Coding

“Building a Faculty Publications Database” at LITA Forum 2014http://www.slideshare.net/bohyunkim/building-a-faculty-publications-database

Page 43: Getting Started with Coding
Page 44: Getting Started with Coding
Page 45: Getting Started with Coding
Page 46: Getting Started with Coding

example1._florida.html

“Quick & Easy Data Visualization with Google Visualization API + Google Chart Libraries” – Code4Lib 2014 Conference, http://www.slideshare.net/bohyunkim/quick-easy-data-visualization-with-google-visualization-api-google-chart-libraries

Page 47: Getting Started with Coding

http://www.slideshare.net/bohyunkim/quick-easy-data-visualization-with-google-visualization-api-google-chart-libraries

Page 48: Getting Started with Coding

Multiple charts

Page 49: Getting Started with Coding

example2_chartdraw.html

Adapted from: Traci L. Ruthkoski, Google Visualization API Essentials, Packt, 2013.

https://github.com/bohyunkim/examples

Page 50: Getting Started with Coding

Example Code

• “Query a Google Spreadsheet like a Database with Google Visualization API Query Language” http://www.bohyunkim.net/blog/archives/2831(Source code: https://github.com/bohyunkim/examples )

• “Playing with JavaScript and JQuery – the Ebook link HTML string generator and the EZproxy bookmarklet generator” http://acrl.ala.org/techconnect/?p=3098

• http://htmlpreview.github.io/?https://github.com/bohyunkim/examples/blob/master/link.html

• http://htmlpreview.github.io/?https://github.com/bohyunkim/examples/blob/master/ezproxy_bookmarklet_generator.html

• Source code: https://github.com/bohyunkim/examples/blob/master/link.html

Page 51: Getting Started with Coding

Automate; Saving Time

http://htmlpreview.github.io/?https://github.com/bohyunkim/examples/blob/master/link.html

Page 52: Getting Started with Coding

https://github.com/bohyunkim/examples/blob/master/link.html

Page 53: Getting Started with Coding
Page 54: Getting Started with Coding

https://github.com/themattharris/tmhOAuthExamples/blob/master/tmhOAuthExample.php

Page 55: Getting Started with Coding

My Thoughts on Coding

• Not everyone, every child, or every librarian needs to learn how to code.

• Learning how to code does not have to result in you becoming an expert or full-time coder.

• Identify your goal in learning how to code.

• Understanding how computer code works will help you navigate everyday information landscape.

• You will understand better how software and systems are built, function, and maintained.

Page 56: Getting Started with Coding

• Variable

• Array

• Loop

• Function

• Objet

• Class

• …..

http://cheezburger.com/6240227584

Page 57: Getting Started with Coding

(3) What is it like to teach oneself how to code?

Page 58: Getting Started with Coding

http://www.vikingcodeschool.com/posts/why-learning-to-code-is-so-damn-hard

Page 59: Getting Started with Coding

http://www.vikingcodeschool.com/posts/why-learning-to-code-is-so-damn-hard

Page 60: Getting Started with Coding
Page 61: Getting Started with Coding

(4) Resources and Tips

Page 62: Getting Started with Coding

Lots of Resources

• Many resources online – discussions, tutorials, books…

• W3Schools Tutorials

• Tuts+

• MOOC

• Codecademy / CodeYear

• Lynda.com; Treehouse; Code School

• Pick One and ACTUALLY DOING IT

• Code4Lib listserv/IRC/journal/conference

• LibTechWomen (http://libtechwomen.org/)

• Library Code Year Interest Group – ALA (LITA/ALCTS)

Page 63: Getting Started with Coding

It Is Hard…

• Syntax will throw you off.

• More time will be spent on debugging than code writing.

• A slow learning curve.

• Not enough time to dedicate to intensive learning.

• Not always a clear connection with your library work.

• Life intervenes.

• Coding is more BORING than exciting.

Page 64: Getting Started with Coding

Practice!

Page 65: Getting Started with Coding

http://www.instructables.com/id/Rubber-Band-PencilPen-Holder/

Page 66: Getting Started with Coding

Tips

• Don’t be discouraged or frustrated. You are teaching yourself a language.

• Be persistent and realistic.

• Set small goals that solve real-life problems.

• Form or join a study group & find like-minded folks!

• Comment your code and document since you will forget what you have learned and made.

Page 67: Getting Started with Coding

More Resources

• See the resources section in my previous presentation at the 2012 Charleston conference,“Geek out: Adding Coding Skills to Your Professional

Repertoire” - Slides athttp://www.slideshare.net/bohyunkim/geek-out-adding-coding-skills-to-your-professional-repertoire

• Bohyun Kim and Kathryn Harnish, “Geek out: Adding Coding Skills to Your Professional Repertoire,” inAccentuate the Positive: Charleston Conference Proceedings 2012, edited by Beth R. Bernhardt, Leah H. Hinds, and Katina P. Strauch, Purdue University Press, 2013. (Available as open access: http://docs.lib.purdue.edu/charleston/2012/Tech/8/)

Page 68: Getting Started with Coding

Image credits

• https://www.flickr.com/photos/skene/3874882162(Title slide; CC License)

• https://www.flickr.com/photos/jdhancock/7082879485(Slide 27;CC License)

• https://www.flickr.com/photos/swolfe/13056042503/ (Slide 61;CC License)

• https://www.flickr.com/photos/edwaado/6129247(Slide 64;CC License)

Page 69: Getting Started with Coding

Questions?

Twitter @bohyunkim (#seacode)

Website/Blog http://bohyunkim.net

Slides: http://slideshare.net/bohyunkim

Github: https://github.com/bohyunkim/examples