GETTING STARTED Getting Started Getting Started to Success Session 1.
Getting Started with Coding
-
Upload
bohyun-kim -
Category
Technology
-
view
503 -
download
1
Transcript of 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
http://blogs.kqed.org/mindshift/2012/09/should-kids-learn-to-code-in-grade-school/
http://www.nydailynews.com/life-style/coding-camps-kids-rise-popularity-article-1.1383074
http://www.pbs.org/mediashift/2015/01/why-journalism-students-need-a-baseline-understanding-of-coding
https://www.quora.com/Should-I-learn-how-to-code-if-I-plan-on-being-a-full-time-real-estate-investor?share=1
https://docs.google.com/spreadsheets/d/1Obzf_n7vkB-WwVXMH1XzouTSGwX89Glq2_WbhECDUQs/pubhtml#
http://organizedscientist.blogspot.com/2014/09/learning-to-code-how-learning-to.html
http://www.bbc.com/news/technology-16440126
http://code.org/about
http://techcrunch.com/2014/12/08/barack-obama-becomes-the-first-president-to-write-code/
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
http://www.ala.org/lita/about/igs/codeyear/jnt-lcy
http://wiki.code4lib.org/index.php/2014_preconference_proposals
http://www.infodocket.com/2015/01/23/video-presentations-from-oclcs-developer-house/
http://dp.la/info/2014/10/07/dpla-community-reps-produce-hackathon-planning-guide-now-available/
http://www.atyourlibrary.org/hackathon-your-library
http://showoffyourapps.challengepost.com/
http://www.ncbi.nlm.nih.gov/news/11-26-2014-genomics-hackathon/
http://www.hackinghealth.ca/about/faq/
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
(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
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
https://osc.hul.harvard.edu/liblab/projects
http://www.nypl.org/collections/labs
Or Just for Fun!
http://scratch.mit.edu/projects/48382460/
Scratch:http://scratch.mit.edu/
It Will Be Magical!
Really!?
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.
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
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
(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
Markup Language
http://www.w3schools.com/css/tryit.asp?filename=trycss_list-style-type_ex
Markup Language
• 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
Programming enables the dynamic manipulation/transformation of input through a control structure.
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
My Tiny Python Script
“Building a Faculty Publications Database” at LITA Forum 2014http://www.slideshare.net/bohyunkim/building-a-faculty-publications-database
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
http://www.slideshare.net/bohyunkim/quick-easy-data-visualization-with-google-visualization-api-google-chart-libraries
Multiple charts
example2_chartdraw.html
Adapted from: Traci L. Ruthkoski, Google Visualization API Essentials, Packt, 2013.
https://github.com/bohyunkim/examples
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
Automate; Saving Time
http://htmlpreview.github.io/?https://github.com/bohyunkim/examples/blob/master/link.html
https://github.com/bohyunkim/examples/blob/master/link.html
https://github.com/themattharris/tmhOAuthExamples/blob/master/tmhOAuthExample.php
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.
• Variable
• Array
• Loop
• Function
• Objet
• Class
• …..
http://cheezburger.com/6240227584
(3) What is it like to teach oneself how to code?
http://www.vikingcodeschool.com/posts/why-learning-to-code-is-so-damn-hard
http://www.vikingcodeschool.com/posts/why-learning-to-code-is-so-damn-hard
(4) Resources and Tips
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)
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.
Practice!
http://www.instructables.com/id/Rubber-Band-PencilPen-Holder/
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.
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/)
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)
Questions?
Twitter @bohyunkim (#seacode)
Website/Blog http://bohyunkim.net
Slides: http://slideshare.net/bohyunkim
Github: https://github.com/bohyunkim/examples