{"id":496,"date":"2022-02-04T13:48:10","date_gmt":"2022-02-04T13:48:10","guid":{"rendered":"https:\/\/research.reading.ac.uk\/digitalhumanities\/?page_id=496"},"modified":"2024-09-11T15:07:39","modified_gmt":"2024-09-11T14:07:39","slug":"glossary-of-programming-terms","status":"publish","type":"page","link":"https:\/\/research.reading.ac.uk\/digitalhumanities\/glossary-of-programming-terms\/","title":{"rendered":"Glossary of programming terms"},"content":{"rendered":"<p>[vc_row][vc_column][vc_toggle title=&#8221;Object:&#8221;]A collection of data which represents something, and contains information or data about the object.<\/p>\n<p>It can also have <em>methods<\/em> (see Methods) which can manipulate the objects&#8217; data<\/p>\n<p>Example:<\/p>\n<p>A car=&gt;<\/p>\n<ul>\n<li>Colour<\/li>\n<li>Make<\/li>\n<li>Engine Size<\/li>\n<li>Engine Revs<\/li>\n<li>DriveCar()<\/li>\n<\/ul>\n<p>A car has <em>properties<\/em> (see properties) and DriveCar() is <em>a method <\/em>operating on the car.<\/p>\n<p>Here, Make, Colour and Engine size are <em>constant <\/em>but Engine revs is variable as you DriveCar().[\/vc_toggle][\/vc_column][\/vc_row][vc_row][vc_column][vc_toggle title=&#8221;Method:&#8221;]A <em>function<\/em> (see Functions) contained within an object which can alter values of the object.<\/p>\n<p>Example:<\/p>\n<p>A car=&gt;<\/p>\n<ul>\n<li>Colour<\/li>\n<li>Make<\/li>\n<li>Engine Size<\/li>\n<li>Engine Revs<\/li>\n<li>DriveCar()<\/li>\n<\/ul>\n<p>A car has <em>properties<\/em> (see properties) and DriveCar() is <em>a method <\/em>operating on the car.<\/p>\n<p>Here, Make is a <em>constant <\/em>but Engine revs is variable as you DriveCar().<\/p>\n<p>Colour and EngineSize are usually constant once a car is made, but can be changed if need be.<\/p>\n<p>These are often called <em>PseudoConstants.<\/em>[\/vc_toggle][\/vc_column][\/vc_row][vc_row][vc_column][vc_toggle title=&#8221;Function:&#8221;]A routine which performs and operation on data and can return the result.<\/p>\n<p>A general function may look like this: myfunction( x, y){ return x*y}<\/p>\n<p>Example: function area( width,height){ return width * height}<\/p>\n<p>And to use it: mysquare=area( 30, 40)<\/p>\n<p>So mysquare now equals 1200\u00a0 <em>(30*40)<\/em><\/p>\n<p>In the car example we have a Method called DriveCar(): this is an internal <em>function <\/em>which does not return anything.<\/p>\n<p>We could have another method function which returns a value: lets add a method <em>GetRevs() <\/em>and define it as returning the engine revs.<\/p>\n<p>GetRevs(){ return EngineRevs)<\/p>\n<p>MyCar=&gt;<\/p>\n<ul>\n<li>Colour=Red<\/li>\n<li>Make=Ford<\/li>\n<li>Engine Size=1500<\/li>\n<li>Engine Revs=0<\/li>\n<li>DriveCar( )<\/li>\n<li style=\"text-align: left\">GetRevs()<\/li>\n<\/ul>\n<p>So now when we use the new function we will be told EngineRevs:<\/p>\n<p>currentRevs=MyCar=&gt;GetRevs()<\/p>\n<p>currentRevs=10,000 rpm<\/p>\n<p>Functions can also take <em>Arguments <\/em>(see Arguments), so for example we could define DriveCar to take a speed:<\/p>\n<p>MyCar=&gt;DriveCar( speed )<\/p>\n<p>So we have:<\/p>\n<p>MyCar=&gt;<\/p>\n<ul>\n<li>Colour=Red<\/li>\n<li>Make=Ford<\/li>\n<li>Engine Size=1500<\/li>\n<li>Engine Revs=0<\/li>\n<li>DriveCar( speed )<\/li>\n<li>GetRevs()<\/li>\n<\/ul>\n<p>And to set car speed we use it thus:<\/p>\n<p>MyCar=&gt; DriveCar( 50 )<\/p>\n<p>[\/vc_toggle][\/vc_column][\/vc_row][vc_row][vc_column][vc_toggle title=&#8221;Variables and Constants:&#8221;]A user defined data type which can hold the results of functions or preset value.<\/p>\n<p>In the Car example we have 2 <em>variables <\/em> Colour and EngineSize. These are both things which a car owner can change or <em>vary.<\/em><\/p>\n<p>The Car Make is not changeable by the owner once it has been made, so Make is considered a <em>Constant.<\/em><\/p>\n<p>MyCar=&gt;<\/p>\n<ul>\n<li>Colour=Red<\/li>\n<li>Make=Ford<\/li>\n<li>Engine Size=1500<\/li>\n<li>Engine Revs=0<\/li>\n<li><\/li>\n<\/ul>\n<p>These are all attributes of the car.<\/p>\n<p>(Note properties and attributes terms are often used interchangeably)[\/vc_toggle][\/vc_column][\/vc_row][vc_row][vc_column][vc_toggle title=&#8221;Attribute:&#8221;]A property of an object which holds a value.<\/p>\n<p>Example:<\/p>\n<p>MyCar=&gt;<\/p>\n<ul>\n<li>Colour=Red<\/li>\n<li>Make=Ford<\/li>\n<li>Engine Size=1500<\/li>\n<li>Engine Revs=0<\/li>\n<li><\/li>\n<\/ul>\n<p>These are all attributes of the car.<\/p>\n<p>(Note properties and attributes terms are often used interchangeably)[\/vc_toggle][\/vc_column][\/vc_row][vc_row][vc_column][vc_toggle title=&#8221;Constructor:&#8221;]A collection of attributes which instruct object creation.<\/p>\n<p>To create a car you need to have a Car template or <em>Class, <\/em>then to <em>construct <\/em> a new Car you can use the basic default Car class and modify it as it is constructed.<\/p>\n<p>Example:<\/p>\n<p>MyNewCar= new Car( Colour=Red, Engine_size=1500, Make=Ford )<\/p>\n<p>So the new car will look like this:<\/p>\n<p>MyNewCar=&gt;<\/p>\n<ul>\n<li>Colour=Red<\/li>\n<li>Make=Ford<\/li>\n<li>Engine Size=1500<\/li>\n<li>Engine Revs=0<\/li>\n<li>DriveCar()<\/li>\n<\/ul>\n<p>Here EngineRevs is not set so it takes the default of 0 from the Car class template.[\/vc_toggle][\/vc_column][\/vc_row]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[vc_row][vc_column][vc_toggle title=&#8221;Object:&#8221;]A collection of data which represents something, and contains information or data about the object. It can also have methods (see Methods) which can manipulate the objects&#8217; data Example:&#8230;<a class=\"read-more\" href=\"&#104;&#116;&#116;&#112;&#115;&#58;&#47;&#47;&#114;&#101;&#115;&#101;&#97;&#114;&#99;&#104;&#46;&#114;&#101;&#97;&#100;&#105;&#110;&#103;&#46;&#97;&#99;&#46;&#117;&#107;&#47;&#100;&#105;&#103;&#105;&#116;&#97;&#108;&#104;&#117;&#109;&#97;&#110;&#105;&#116;&#105;&#101;&#115;&#47;&#103;&#108;&#111;&#115;&#115;&#97;&#114;&#121;&#45;&#111;&#102;&#45;&#112;&#114;&#111;&#103;&#114;&#97;&#109;&#109;&#105;&#110;&#103;&#45;&#116;&#101;&#114;&#109;&#115;&#47;\">Read More ><\/a><\/p>\n","protected":false},"author":351,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"__cvm_playback_settings":[],"__cvm_video_id":"","footnotes":""},"coauthors":[11],"class_list":["post-496","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Glossary of programming terms - University of Reading Interdisciplinary Research Centre in Digital Humanities<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/research.reading.ac.uk\/digitalhumanities\/glossary-of-programming-terms\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Glossary of programming terms - University of Reading Interdisciplinary Research Centre in Digital Humanities\" \/>\n<meta property=\"og:description\" content=\"[vc_row][vc_column][vc_toggle title=&#8221;Object:&#8221;]A collection of data which represents something, and contains information or data about the object. It can also have methods (see Methods) which can manipulate the objects&#8217; data Example:...Read More &gt;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/research.reading.ac.uk\/digitalhumanities\/glossary-of-programming-terms\/\" \/>\n<meta property=\"og:site_name\" content=\"University of Reading Interdisciplinary Research Centre in Digital Humanities\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-11T14:07:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/research.reading.ac.uk\/digitalhumanities\/wp-content\/uploads\/sites\/233\/2024\/08\/hub-logo-left.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2093\" \/>\n\t<meta property=\"og:image:height\" content=\"1205\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@UniofReading\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data2\" content=\"Paul Heaton\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/glossary-of-programming-terms\/\",\"url\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/glossary-of-programming-terms\/\",\"name\":\"Glossary of programming terms - University of Reading Interdisciplinary Research Centre in Digital Humanities\",\"isPartOf\":{\"@id\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/#website\"},\"datePublished\":\"2022-02-04T13:48:10+00:00\",\"dateModified\":\"2024-09-11T14:07:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/glossary-of-programming-terms\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/research.reading.ac.uk\/digitalhumanities\/glossary-of-programming-terms\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/glossary-of-programming-terms\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Glossary of programming terms\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/#website\",\"url\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/\",\"name\":\"University of Reading Digital Humanities Hub\",\"description\":\"University of Reading Library\",\"publisher\":{\"@id\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/#organization\"},\"alternateName\":\"Digital Humanities Hub\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/#organization\",\"name\":\"University of Reading Digital Humanities Hub\",\"url\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/wp-content\/uploads\/sites\/233\/logos\/readinglogo.gif\",\"contentUrl\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/wp-content\/uploads\/sites\/233\/logos\/readinglogo.gif\",\"width\":2386,\"height\":782,\"caption\":\"University of Reading Digital Humanities Hub\"},\"image\":{\"@id\":\"https:\/\/research.reading.ac.uk\/digitalhumanities\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/twitter.com\/UniofReading\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Glossary of programming terms - University of Reading Interdisciplinary Research Centre in Digital Humanities","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/research.reading.ac.uk\/digitalhumanities\/glossary-of-programming-terms\/","og_locale":"en_GB","og_type":"article","og_title":"Glossary of programming terms - University of Reading Interdisciplinary Research Centre in Digital Humanities","og_description":"[vc_row][vc_column][vc_toggle title=&#8221;Object:&#8221;]A collection of data which represents something, and contains information or data about the object. It can also have methods (see Methods) which can manipulate the objects&#8217; data Example:...Read More >","og_url":"https:\/\/research.reading.ac.uk\/digitalhumanities\/glossary-of-programming-terms\/","og_site_name":"University of Reading Interdisciplinary Research Centre in Digital Humanities","article_modified_time":"2024-09-11T14:07:39+00:00","og_image":[{"width":2093,"height":1205,"url":"https:\/\/research.reading.ac.uk\/digitalhumanities\/wp-content\/uploads\/sites\/233\/2024\/08\/hub-logo-left.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_site":"@UniofReading","twitter_misc":{"Estimated reading time":"3 minutes","Written by":"Paul Heaton"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/research.reading.ac.uk\/digitalhumanities\/glossary-of-programming-terms\/","url":"https:\/\/research.reading.ac.uk\/digitalhumanities\/glossary-of-programming-terms\/","name":"Glossary of programming terms - University of Reading Interdisciplinary Research Centre in Digital Humanities","isPartOf":{"@id":"https:\/\/research.reading.ac.uk\/digitalhumanities\/#website"},"datePublished":"2022-02-04T13:48:10+00:00","dateModified":"2024-09-11T14:07:39+00:00","breadcrumb":{"@id":"https:\/\/research.reading.ac.uk\/digitalhumanities\/glossary-of-programming-terms\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/research.reading.ac.uk\/digitalhumanities\/glossary-of-programming-terms\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/research.reading.ac.uk\/digitalhumanities\/glossary-of-programming-terms\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/research.reading.ac.uk\/digitalhumanities\/"},{"@type":"ListItem","position":2,"name":"Glossary of programming terms"}]},{"@type":"WebSite","@id":"https:\/\/research.reading.ac.uk\/digitalhumanities\/#website","url":"https:\/\/research.reading.ac.uk\/digitalhumanities\/","name":"University of Reading Digital Humanities Hub","description":"University of Reading Library","publisher":{"@id":"https:\/\/research.reading.ac.uk\/digitalhumanities\/#organization"},"alternateName":"Digital Humanities Hub","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/research.reading.ac.uk\/digitalhumanities\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/research.reading.ac.uk\/digitalhumanities\/#organization","name":"University of Reading Digital Humanities Hub","url":"https:\/\/research.reading.ac.uk\/digitalhumanities\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/research.reading.ac.uk\/digitalhumanities\/#\/schema\/logo\/image\/","url":"https:\/\/research.reading.ac.uk\/digitalhumanities\/wp-content\/uploads\/sites\/233\/logos\/readinglogo.gif","contentUrl":"https:\/\/research.reading.ac.uk\/digitalhumanities\/wp-content\/uploads\/sites\/233\/logos\/readinglogo.gif","width":2386,"height":782,"caption":"University of Reading Digital Humanities Hub"},"image":{"@id":"https:\/\/research.reading.ac.uk\/digitalhumanities\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/twitter.com\/UniofReading"]}]}},"_links":{"self":[{"href":"https:\/\/research.reading.ac.uk\/digitalhumanities\/wp-json\/wp\/v2\/pages\/496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/research.reading.ac.uk\/digitalhumanities\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/research.reading.ac.uk\/digitalhumanities\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/research.reading.ac.uk\/digitalhumanities\/wp-json\/wp\/v2\/users\/351"}],"replies":[{"embeddable":true,"href":"https:\/\/research.reading.ac.uk\/digitalhumanities\/wp-json\/wp\/v2\/comments?post=496"}],"version-history":[{"count":3,"href":"https:\/\/research.reading.ac.uk\/digitalhumanities\/wp-json\/wp\/v2\/pages\/496\/revisions"}],"predecessor-version":[{"id":2248,"href":"https:\/\/research.reading.ac.uk\/digitalhumanities\/wp-json\/wp\/v2\/pages\/496\/revisions\/2248"}],"wp:attachment":[{"href":"https:\/\/research.reading.ac.uk\/digitalhumanities\/wp-json\/wp\/v2\/media?parent=496"}],"wp:term":[{"taxonomy":"author","embeddable":true,"href":"https:\/\/research.reading.ac.uk\/digitalhumanities\/wp-json\/wp\/v2\/coauthors?post=496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}