Deprecated: Optional parameter $content declared before required parameter $post is implicitly treated as a required parameter in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/functions.php on line 840

Deprecated: Creation of dynamic property wpdb::$categories is deprecated in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/wp-db.php on line 668

Deprecated: Creation of dynamic property wpdb::$post2cat is deprecated in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/wp-db.php on line 668

Deprecated: Creation of dynamic property wpdb::$link2cat is deprecated in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/wp-db.php on line 668

Deprecated: Return type of WP_Theme::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/class-wp-theme.php on line 553

Deprecated: Return type of WP_Theme::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/class-wp-theme.php on line 594

Deprecated: Return type of WP_Theme::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/class-wp-theme.php on line 534

Deprecated: Return type of WP_Theme::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/class-wp-theme.php on line 543

Warning: Private methods cannot be final as they are never overridden by other classes in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/class-wp-session-tokens.php on line 69

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/comment-template.php on line 1720

Deprecated: Optional parameter $object_id declared before required parameter $taxonomy is implicitly treated as a required parameter in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/nav-menu.php on line 1060

Deprecated: Return type of WP_REST_Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-request.php on line 934

Deprecated: Return type of WP_REST_Request::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-request.php on line 954

Deprecated: Return type of WP_REST_Request::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-request.php on line 966

Deprecated: Return type of WP_REST_Request::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-request.php on line 977

Deprecated: Return type of WP_Block_List::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/class-wp-block-list.php on line 151

Deprecated: Return type of WP_Block_List::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/class-wp-block-list.php on line 175

Deprecated: Return type of WP_Block_List::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/class-wp-block-list.php on line 164

Deprecated: Return type of WP_Block_List::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/class-wp-block-list.php on line 186

Deprecated: Return type of WP_Block_List::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/class-wp-block-list.php on line 138

Deprecated: Return type of WP_Block_List::offsetExists($index) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/class-wp-block-list.php on line 75

Deprecated: Return type of WP_Block_List::offsetGet($index) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/class-wp-block-list.php on line 89

Deprecated: Return type of WP_Block_List::offsetSet($index, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/class-wp-block-list.php on line 110

Deprecated: Return type of WP_Block_List::offsetUnset($index) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/class-wp-block-list.php on line 127

Deprecated: Return type of WP_Block_List::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/class-wp-block-list.php on line 199

Deprecated: Optional parameter $block_name declared before required parameter $block_content is implicitly treated as a required parameter in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/blocks.php on line 405

Deprecated: Creation of dynamic property WP_REST_Autosaves_Controller::$rest_namespace is deprecated in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php on line 70

Deprecated: Creation of dynamic property WP_REST_Autosaves_Controller::$rest_namespace is deprecated in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php on line 70

Deprecated: Creation of dynamic property WP_REST_Autosaves_Controller::$rest_namespace is deprecated in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php on line 70

Warning: Cannot modify header information - headers already sent by (output started at /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-request.php:29) in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-server.php on line 1378

Warning: Cannot modify header information - headers already sent by (output started at /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-request.php:29) in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-server.php on line 1378

Warning: Cannot modify header information - headers already sent by (output started at /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-request.php:29) in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-server.php on line 1378

Warning: Cannot modify header information - headers already sent by (output started at /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-request.php:29) in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-server.php on line 1378

Warning: Cannot modify header information - headers already sent by (output started at /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-request.php:29) in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-server.php on line 1378

Warning: Cannot modify header information - headers already sent by (output started at /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-request.php:29) in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-server.php on line 1378

Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/wp-db.php on line 3008

Warning: Cannot modify header information - headers already sent by (output started at /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-request.php:29) in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-server.php on line 1378

Warning: Cannot modify header information - headers already sent by (output started at /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-request.php:29) in /vhost/r/o/t/rottedfrog.co.uk/www/wp-includes/rest-api/class-wp-rest-server.php on line 1378
{"id":19,"date":"2018-01-28T16:33:01","date_gmt":"2018-01-28T16:33:01","guid":{"rendered":"http:\/\/www.rottedfrog.co.uk\/?p=19"},"modified":"2018-01-28T16:33:01","modified_gmt":"2018-01-28T16:33:01","slug":"umm-javascript-is-okay-i-guess","status":"publish","type":"post","link":"https:\/\/www.rottedfrog.co.uk\/?p=19","title":{"rendered":"Umm javascript is okay… I guess…"},"content":{"rendered":"

People who know me are probably aware I have over years been fairly scathing about JavaScript as a serious programming language. I’ve been mostly a classical desktop and back end developer for a large part of my career, and as such have avoided web development. A large reason for this was playing with JavaScript and web development in the early 2000’s. It wasn’t pretty. A mess of functions, no types anywhere, a far cry from the elegance of Borland Delphi, which was my favourite language of the time, or even VB6, which I was using at work, which if nothing else, had a kick ass IDE (there really was nothing else).<\/p>\n

For the last two years I’ve been working on the next generation version of our software at work, which, as all enterprise software is these days, entirely web based. Our front end stack is AngularJS, Node, and typescript, which has necessitated me learning Typescript, and by proxy, becoming au fait with modern JavaScript.<\/p>\n

My opinion of JavaScript in 2018? It’s actually pretty good. The prototypal inheritance system\u00a0is both unusual and useful. I really like the way you can chain the Boolean operators together for conditional and lazy execution of expressions. The fact that every JavaScript object is a dictionary that can be arbitrarily extended. JavaScript is also a first class functional programming language.<\/p>\n

A big part of my new found admiration for JavaScript is the new ES2015 syntax (well not so new now…). The class syntax tidies up some of the rather odder parts of the object creation syntax, and arrow functions both simplify creating functions, and get around some of the more quirky behaviour of the “this” parameter.<\/p>\n

TypeScript further embellishes JavaScript with a very decent stab at a type system on top of JavaScript as well as also allowing you to use the lastest JavaScript features and transpile down to more widely supported JavaScript.<\/p>\n

It’s safe to say I’m a convert to the expressiveness of JavaScript, with or without TypeScript.\u00a0Yes there are horrible bits, the implicit type conversions on ==, implicit semi-colon placement, everything in non-strict mode. But you can train yourself to stay out of these holes with very little effort, and as a programmer, learning the ways people use this quirky language can open your eyes to a whole new way of writing code.\u00a0That can only be a good thing.<\/p>\n","protected":false},"excerpt":{"rendered":"

People who know me are probably aware I have over years been fairly scathing about JavaScript as a serious programming language. I’ve been mostly a classical desktop and back end developer for a large part of my career, and as such have avoided web development. A large reason for this was playing with JavaScript and … <\/p>\n