{"id":21673,"date":"2016-05-15T03:01:19","date_gmt":"2016-05-14T17:01:19","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=21673"},"modified":"2018-04-15T08:27:48","modified_gmt":"2018-04-14T22:27:48","slug":"an-interpretive-style-of-web-programming-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/an-interpretive-style-of-web-programming-tutorial\/","title":{"rendered":"An Interpretive Style of Web Programming Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/interpretive_style.jpg\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"An Interpretive Style of Web Programming Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/interpretive_style.jpg\" title=\"An Interpretive Style of Web Programming Tutorial\"  \/><\/a><p class=\"wp-caption-text\">An Interpretive Style of Web Programming Tutorial<\/p><\/div>\n<p>Today&#8217;s tutorial is a &#8220;blurb&#8221; about the personal style of web programming here at this blog.  Nothing that is said here is &#8220;hard and fast&#8221; but there are styles that can be defined, for us, if we were to be &#8220;asked&#8221; to explain it &#8230; thanks for asking.  Features of this style, which we think &#8220;feels&#8221; &#8230;<\/p>\n<ul>\n<li>interpretive<\/li>\n<li>&#8220;onions of the 4th dimension&#8221;<\/li>\n<\/ul>\n<p> &#8230; in that we think more in a &#8220;functional&#8221; style rather than an &#8220;OOP&#8221; (<a target=_blank title='OOP information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Object-oriented_programming'>Object Oriented Programming<\/a>) style, and we think in a &#8220;substitutional&#8221; (hence, &#8220;interpretive&#8221;) way rather than a &#8220;everything defined in a blueprint, before you start&#8221; way for our smaller projects, certainly.  Drilling down, we like &#8230;<\/p>\n<ul>\n<li>we organize user interactivity via HTML and Javascript <a target=_blank title='Javascript event information from w3schools' href='http:\/\/www.w3schools.com\/js\/js_events.asp'>&#8220;event&#8221;<\/a> functionality<\/li>\n<li>data that is like a &#8220;blob&#8221; is stored in a <a target=_blank title='Javascript string information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/jsref_obj_string.asp'><i>string<\/i><\/a> variable and if it has a &#8220;delimiter&#8221; &#8230;<\/li>\n<li>we like using <a target=_blank title='Javascript array information from w3schools' href='http:\/\/www.w3schools.com\/js\/js_arrays.asp'><i>arrays<\/i><\/a> (rarely structures, and rarely with tree like hierarchies, though we are happy to have hierarchy with the organization of any server side database or data source, and query this with <a target=_blank title='Javascript SQL information from w3schools' href='http:\/\/www.w3schools.com\/sql\/'>SQL<\/a>) &#8230;<\/li>\n<li>using Javascript <a target=_blank title='Javascript split information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/jsref_split.asp'><i>split<\/i><\/a> (and PHP <a target=_blank title='PHP explode method information' href='http:\/\/php.net\/manual\/en\/function.explode.php'><i>explode<\/i><\/a> method) to convert a string, and use &#8220;delimit&#8221; systems to convert into <i>arrays<\/i> (often this is the basis for the core of the whole web application&#8217;s architecture and planning)<\/li>\n<li>we don&#8217;t mind global variables<\/li>\n<li>really like Javascript&#8217;s <a target=_blank title='Javascript replace information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/jsref_replace.asp'><i>replace<\/i><\/a> method (and PHP&#8217;s <a target=_blank title='PHP str_replace method information' href='http:\/\/php.net\/manual\/en\/function.str-replace.php'><i>str_replace<\/i><\/a> method)<\/li>\n<li>really like concepts like &#8220;prefix&#8221; and &#8220;suffix&#8221; and &#8220;+&#8221; concatenation to, respectively, prepend and append string data to other string data<\/li>\n<li>lots of <i>if<\/i> (and <i>else if<\/i> and <i>else<\/i>) scenarios<\/li>\n<li>for (i=0; i&lt;ourarray.length; i++) {    }<\/li>\n<li>while ([condition]) {   &#8230; i++; }<\/li>\n<li>in the spirit of &#8220;onions of the 4th dimension&#8221; we often replace individual words with HTML select &#8220;dropdown&#8221; elements as a project becomes more complex, and we do like to use Javascript , and processed via lots of Javascript <a target=_blank title='Javascript eval() method information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/jsref_eval.asp'>eval()<\/a> methodologies to help out with hierarchical data, in particular<\/li>\n<li>sometimes a <a target=_blank title='Javascript textarea information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_textarea.asp'><i>textarea<\/i><\/a> would replace an HTML <a target=_blank title='Javascript input tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_input.asp'><i>input type=&#8221;text&#8221;<\/i><\/a> as an example of approaches to projects becoming more complex<\/li>\n<li>sometimes an <i>array<\/i> would replace a variable as projects become more complex<\/li>\n<li>genericity (and portability) is important to us and its expression takes the form of &#8230;\n<ol>\n<li>Javascript <i>function<\/i> will replace repeated Javascript code (and PHP <i>function<\/i> will replace repeated PHP code)<\/li>\n<li>external Javascript will replace repeated Javascript functions<\/li>\n<li>PHP (in HTML <a target=_blank title='Javascript iframe tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_iframe.asp'>iframe<\/a> elements) or <a target=_blank title='Javascript Ajax information from w3schools' href='http:\/\/www.w3schools.com\/ajax\/'>Ajax<\/a> (and its teaming with <a target=_blank title='jQuery' href='https:\/\/jquery.com\/'>jQuery<\/a>) replaces places in the code needing to access data from server files and\/or databases<\/li>\n<li>rarely, in PHP, <a target=_blank title='PHP require_once information' href='http:\/\/php.net\/manual\/en\/function.require-once.php'><i>require[_once]<\/i> or <i>include[_once]<\/i><\/a> replaces repeated PHP functions<\/li>\n<li>if there is no need for server side participation we try not to involve it (ie. PHP)<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p>When a big project is undertaken, we are much more likely to consider &#8220;structures&#8221; and an &#8220;OOP&#8221; style of proceeding &#8230; it depends.  We think a &#8220;modular&#8221; style of organization is crucial with larger projects, but can be overkill for smaller projects.<\/p>\n<p>We like to write in &#8230;<\/p>\n<ul>\n<li>HTML (client side)<\/li>\n<li>Javascript (occasionally using jQuery or <a target=_blank title='YUI' href='http:\/\/yuilibrary.com\/'>YUI<\/a> libraries, and sometimes Ajax) (client side)<\/li>\n<li>PHP (server side)<\/li>\n<li>MySql (database)<\/li>\n<\/ul>\n<p>Of course, there are many great &#8220;systems&#8221; facilitating the organization of programming tasks, out there in the world.  Think MVC (<a target=_blank title='MVC information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Model\u2013view\u2013controller'>Model\/View\/Controller<\/a>) as one idea.  No doubt all these &#8220;systems&#8221; have merit, and an ideal one for you could be a mix of lots.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#21673' onclick='var dv=document.getElementById(\"d21673\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/web\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d21673' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today&#8217;s tutorial is a &#8220;blurb&#8221; about the personal style of web programming here at this blog. Nothing that is said here is &#8220;hard and fast&#8221; but there are styles that can be defined, for us, if we were to be &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/an-interpretive-style-of-web-programming-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,33,37],"tags":[69,96,212,299,399,400,576,652,663,824,932,997,1122,1186,1867,1319,1400,1495],"class_list":["post-21673","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-software","category-tutorials","tag-ajax","tag-application","tag-client","tag-database-2","tag-eval","tag-event","tag-html","tag-javascript","tag-jquery","tag-mvc","tag-php","tag-programming","tag-server","tag-sql","tag-substitution","tag-tutorial","tag-web","tag-yui"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/21673"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=21673"}],"version-history":[{"count":13,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/21673\/revisions"}],"predecessor-version":[{"id":22462,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/21673\/revisions\/22462"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=21673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=21673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=21673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}