{"id":513,"date":"2013-12-24T16:01:02","date_gmt":"2013-12-24T16:01:02","guid":{"rendered":"http:\/\/thomas.w-p.me.uk\/blog\/?p=513"},"modified":"2013-12-24T16:01:02","modified_gmt":"2013-12-24T16:01:02","slug":"classes-inheritance-and-encapsulation-in-php","status":"publish","type":"post","link":"https:\/\/thomas.w-p.me.uk\/blog\/2013\/12\/classes-inheritance-and-encapsulation-in-php\/","title":{"rendered":"Classes, inheritance and encapsulation in php"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-514\" alt=\"meterboard2\" src=\"https:\/\/thomas.w-p.me.uk\/blog\/wp-content\/uploads\/2013\/12\/Capture.png\" width=\"988\" height=\"379\" srcset=\"https:\/\/thomas.w-p.me.uk\/blog\/wp-content\/uploads\/2013\/12\/Capture.png 988w, https:\/\/thomas.w-p.me.uk\/blog\/wp-content\/uploads\/2013\/12\/Capture-300x115.png 300w\" sizes=\"auto, (max-width: 988px) 100vw, 988px\" \/><\/p>\n<p>I have been, and probably remain somewhat of a <strong>cottage<\/strong> programmer.\u00a0 Completely self taught.\u00a0 I have heard the terms &#8220;Classes, inheritance and encapsulation&#8221; for years and not really understood them.<\/p>\n<p>I have spent a lot of time over the last week or so working on <a href=\"http:\/\/www.freespiritsrowing.com\/meterboard2\/\">a row tracker for my virtual rowing team<\/a>.\u00a0 I wrote it without using a single class.\u00a0 I then (for reasons I don&#8217;t remember) decided it was about time I got to grips with them.\u00a0 Suddenly, and I am not sure how, I understand them and how to use them.\u00a0 Oh, the power!<\/p>\n<p>I appears from <a href=\"https:\/\/www.youtube.com\/watch?v=lbXsrHGhBAU\">this useful (but soporifically voiced) youtube video<\/a> that I have been doing procedural programming all these years.\u00a0 Object oriented programming is a very different way of looking at it.\u00a0 But inheritance makes a lot of sense.\u00a0 Now.\u00a0 I am still trying to wrap my head around why encapsulation is &#8216;better&#8217; but I understand what it is and how to do it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been, and probably remain somewhat of a cottage programmer.\u00a0 Completely self taught.\u00a0 I have heard the terms &#8220;Classes, inheritance and encapsulation&#8221; for years and not really understood them. I have spent a lot of time over the last week or so working on a row tracker for my virtual rowing team.\u00a0 I wrote &hellip; <a href=\"https:\/\/thomas.w-p.me.uk\/blog\/2013\/12\/classes-inheritance-and-encapsulation-in-php\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Classes, inheritance and encapsulation in php<\/span> <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":[27],"tags":[70],"class_list":["post-513","post","type-post","status-publish","format-standard","hentry","category-geekiness","tag-php"],"_links":{"self":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/513","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/comments?post=513"}],"version-history":[{"count":1,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/513\/revisions"}],"predecessor-version":[{"id":515,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/513\/revisions\/515"}],"wp:attachment":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/media?parent=513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/categories?post=513"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/tags?post=513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}