Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
MELANIEPINOLAonLIFEHACKER
ASKLIFEHACKER
WhichProgrammingLanguageShouldI LearnFirst?
DearLifehacker, Withallthebuzzaboutlearningtocode,I'vedecidedtogiveitatry.Theproblemis,I'mnotsurewheretostart. What'sthebestprogramminglanguageforabeginnerlikeme? Signed, CouldBeCoder DearCouldBe, That'sprobablyoneofthemostpopularquestionsfromfirsttimelearners,andit'ssomethingthateducators debateaswell.Thethingis,youcanasktenprogrammerswhatthebestlanguageistogetyourfeetwetwith andyoucouldgettendifferentanswerstherearethousandsofoptions.Whichlanguageyoustartwithdepends notonlyonhowbeginnerfriendlyitis,though,butalsothekindofprojectsyouwanttoworkon,whyyou're interestedincodinginthefirstplace,andperhapsalsowhetheryou'rethinkingofdoingthisforaliving.Here aresomeconsiderationsandsuggestionstohelpyoudecide.
WhyDoYouWanttoLearntoCode?
Dependingonwhatitisyouwanttomakeordo,yourchoicemightalreadybemadeupforyou.Tobuilda websiteorwebapp,forexample,youshouldlearnHTMLandCSS,alongwithJavaScriptandperhapsPHPfor interactivity.Ifyourfocusismostly/onlyonbuildingamobileapp,thenyoucandiverightintolearning ObjectiveCforiOSappsorhowtoprogramwithJavaforAndroid(andotherthings).
lifehacker.com/which-programming-language-should-i-learn-first-1477153665 1/6
12/8/13
RELATED
HowtoProgramWithJavaTeachesYoutheBasicConceptsof Programming(andJava,OfCourse)
RELATED
HowandWhytoTeachYourKidsto Code
Ifyou'relookingtogobeyondonespecificprojectorspecialty, though,orwanttolearnabunchoflanguages,it'sbesttostartwith learningthebasicconceptsofprogrammingandhowto"thinklikea coder."Thatway,nomatterwhatyourfirstprogramminglanguage,youcanapplythoseskillstowardslearning anewone(maybeinaslittleas21minutes).Evenkids'codingappscanbeusefultostartwith.Forexample,the firstformalprogrammingcourseItook(well,otherthanBASICbackinfourthgrade)wasHarvard'sCS50, whichyoucantakeforfree.ProfessorMalanstartsthecourseoffwithScratch,adraganddropprogramming environmentbuiltforkidsthatteachescodingbasicsandlogicwhilehelpingyoucreatesomethingcooland thenheproceedstoteachyouC. We'vefeaturedseveralotherexcellentresourcesforlearningtocodeovertheyears,suchasinteractive courseCodecademy,butevenwiththoseyoustillneedtochoosewhichlanguagetostartwith.Solet'stakea lookatthedifferencesbetweenthemorepopularonesandwhicharemostrecommendedasastarterlanguage.
TheMostOftenRecommendedProgrammingLanguagesfor Beginners
Mostofthe"mainstream"programminglanguagessuchasC,Java,C#,Perl,Ruby,andPythoncandothe sameornearlythesametasksastheothers.Java,forexample,workscrossplatformandisusedforweb appsandapplets,butRubyalsocandolargewebappsandPythonappssimilarlyrunonLinuxand Windows.SOAWorldpointsoutthatbecausemanylanguagesaremodeledaftereachother,thesyntaxor structureofworkingonthemisoftennearlyidentical,solearningoneoftenhelpswithlearningtheothers.For example,toprint"HelloWorld,"JavaandC#aresyntacticallysimilarjustasPerlandPythonare:
lifehacker.com/which-programming-language-should-i-learn-first-1477153665 2/6
12/8/13
Theydiffer,however,inhoweasytheyaretosetupandgetinto.SOAWorldcontinues:
Here'saquickcomparisonofthemostpopularprogramminglanguages:
C:TrainsYoutoWriteEfficientCode
Cisoneof,ifnotthe,mostwidelyusedprogramminglanguages.Thereareafewreasonsforthis.Asnoted programmerandwriterJoelSpolskysays,Cistoprogrammingaslearningbasicanatomyistoamedicaldoctor. Cisa"machinelevel"language,soyou'lllearnhowaprograminteractswiththehardwareandlearnthe fundamentalsofprogrammingatthelowesthardwarelevel(CisthefoundationforLinux/GNU).Youlearn thingslikedebuggingprograms,memorymanagement,andhowcomputersworkthatyoudon'tgetfromhigher levellanguageslikeJavaallwhilepreppingyoutocodeefficientlyforotherlanguages.Cisthe"grandfather" ofmanyotherhigherlevellanguages,includingJava,C#,andJavaScript. Thatsaid,codinginCisstricterandhasasteeperlearningcurvethanotherlanguages,andifyou'renot planningonworkingonprogramsthatinterfacewiththehardware(tapintodevicedrivers,forexample,or operatingsystemextensions),learningCwilladdtoyoureducationtime,perhapsunnecessarily.StackOverflow hasagooddiscussiononCversusJavaasafirstlanguage,withmostpeoplepointingtowardsC.However, personally,althoughI'mgladIwasexposedtoC,Idon'tthinkit'saverybeginnerfriendlylanguage.It'llteach
lifehacker.com/which-programming-language-should-i-learn-first-1477153665
youdiscipline,butyou'llhavetolearnanawfullotbeforeyoucanmakeanythinguseful.Also,becauseit'sso 3/6
12/8/13
strictyoumightendupfrustratedlikethis:
Java:OneoftheMostPracticalLanguagestoLearn
Javaisthesecondmostpopularprogramminglanguage,andit'sthelanguagetaughtinStanford'srenowned (andfree)IntrotoCSprogrammingcourse.JavaenforcessolidObjectOrientedprinciples(OOP)thatareusedin modernlanguagesincludingC++,Perl,Python,andPHP.Onceyou'velearnedJava,youcanlearnotherOOP languagesprettyeasily. Javahastheadvantageofalonghistoryofusage.Therearelotsof"boilerplate"examples,it'sbeentaughtfor decades,andit'swidelyusedformanypurposes(includingAndroidappdevelopment),soit'saverypractical languagetolearn.Youwon'tgetmachinelevelcontrol,asyouwouldwithC,butyou'llbeableto access/manipulatethemostimportantcomputerpartslikethefilesystem,graphics,andsoundforanyfairly sophisticatedandmodernprogramthatcanrunonanyoperatingsystem.
Python:FunandEasytoLearn
ManypeoplerecommendPythonasthebestbeginnerlanguagebecauseofitssimplicityyetgreatcapabilities. Thecodeiseasytoreadandenforcesgoodprogrammingstyle(likeindenting),withoutbeingoverlystrictabout syntax(thingslikerememberingtoaddasemicolonattheendofeachline).PatrickJordanatAriel Computingcomparedthetimeittakestowriteasimplescriptinvariouslanguages(BASIC,C,J,Java,and Python)anddeterminedthatwhiletheotherlanguagesshouldn'tbeignored,Python:
lifehacker.com/which-programming-language-should-i-learn-first-1477153665
4/6
12/8/13
frequentsuccessbreedconfidenceandinterestinthestudent,whois thenbetterplacedtocontinuelearningtoprogram.
JavaScript:ForJumpingRightinandBuildingWebsites
RELATED
LearntoCode:TheFullBeginner's Guide
JavaScript(oflittlerelationtoJava)requirestheleastamountofsetup togetstartedwith,sinceit'salreadybuiltintowebbrowsers.O'Reilly MediarecommendsyoustartwithJavaScriptbecauseithasarelatively forgivingsyntax(youcancodelooselyinJavaScript),youseeimmediateresultsfromyourcode,andyoudon't needalotoftools.InourownLearntoCodenightschoolweuseJavaScripttoshowyouthebasicslikehow variablesandfunctionswork.Ifyouwanttomakecoolinteractivethingsfortheweb,JavaScriptisamusthave skill.
ChoosingYourPath
Onelastconsiderationiswhetherornotyoumightwanttogofromcodingasahobbytodoingitasa career.Dev/Code/Hackbreaksdownthedifferentjobrolesandtheskillsyoushouldpickupforthem:
Backend/ServersideProgrammer:Usuallyusesoneofthefollowing: Python,Ruby,PHP,Javaor.Net.Hasdatabaseknowledge.Possiblyhas somesysadminknowledge. Frontend/ClientsideProgrammer:HTML,CSS,JavaScript.Possibly hasdesignskill. MobileProgrammer:ObjectiveCorJava(forAndroid).HTML/CSSfor mobilewebsites.Potentiallyhasserversideknowledge. 3DProgrammer/GameProgrammer:C/C++,OpenGL,Animation. Possiblyhasgoodartisticskill. HighPerformanceProgrammer:C/C++,Java.Mayhavebackground inmathematicsorquantitativeanalysis.
lifehacker.com/which-programming-language-should-i-learn-first-1477153665 5/6
12/8/13
RELATED
BentoShowcasestheBestResources forLearningtoCode
Onceyou'vedecided,previouslymentionedBentowillsuggestthe resourcesyouneedandthecoursestotakeafteryou'velearnedyour firstlanguage.
P
Love, Lifehacker
lifehacker.com/which-programming-language-should-i-learn-first-1477153665
6/6