SPH retrenchment, media stagnancy

Singapore Press Holdings (SPH) recently had a retrenchment exercise. The initial plan was to reduce about 230 jobs (130 being retrenchments) by end 2018, but the management had a change of mind and decided to bring it forward to October this year.

This unfortunate event precipitated some critiques on local Singapore media: SPH mass retrenchment to save costs is like “applying a plaster to a gaping wound”, and also gave way to a schadenfreude of people gloating at local forum EDMW, talking about how the reporters deserved it for being mouthpieces of the government all these years. ( Ironically, the popular EDMW forum belongs to SPH.) Part of me thinks that this is an inevitable situation, considering the economic/political realities, but part of me also feels for the people who got their jobs axed. Hopefully, this event gives rise to new opportunities and a more robust media landscape.

This sounds like captain obvious: the overall local media landscape is suffering now because we can’t compete with YouTube, Facebook and Google. These platforms are chewing up all our ad revenue and audiences.

Our own platforms like Toggle and digital news sites have been trying to play catch up for some time. There have been initiatives like producing more online news and exclusive content, but it seems to be trapped in infancy, maybe because of insufficient resources and a lack of impactful content.

Just my two cents: I think we’ll probably need to make our local Toggle and news sites more appealing to users in terms of user experience, and include unique features (tech or content-wise) that YouTube, Facebook or Instagram doesn’t have.

I think Toggle has exclusive content, but the overall site is not user friendly enough, and features-wise, it’s not giving anything new above YouTube or other video sites. Consider video streaming sites from China which allow live-comments, I think that’s an interesting feature as it allows users to interact with each other as they watch the show. This makes the experience more fun. Just like how, before the internet, we used to watch TV together as a family and make jibes/comments about the plot and characters.

Content-wise, maybe if we can invest in and utilise newer tech like VR or 3D and produce 3D immersive video content – this would attract newer segments of the market (which currently is dependent on retirees and the under-16 children segment), and also inject a breath of fresh air to the content.

I think it’s hard to fight with Facebook and YouTube because of the sheer quantity of content, which is user generated and extremely current. Maybe Mediacorp or SPH can try opening up their sites to allow user generated content. Like allow users to upload photos, videos, make comments, etc. Which, currently they do have to some extent, but I think they need to put more resources into encouraging the wider public to produce content. Like holding regular contests and workshops to share knowledge and also drive interest towards fresh, new content. Because right now, we are facing an image-crisis and a deficiency in talent – a lack of people coming forward to be content-creators or writers. Overall, there’s a sense that everything is same-old, same-old, the public thinks that the media companies are not innovating and just reproducing the same old content every month.

I do believe that we have talent in Singapore. We just need to give them a space and encourage them to grow.

We can take a leaf from China or Korea, see how they have established their own platforms. I admit they have the advantage of their own language as leverage, but perhaps we can leverage on our own strengths: our diversity, our language (Singlish), our unique perspective of Asia as we straddle both Asian/Western attitudes.

If the government allows Singlish, that is. Or keep portraying a reality that our society is only made up of the middle class. Which goes back to the point of releasing some control on the media and giving it room to grow.

Advertisements

Thoughts about coding/programming

thoughts on programming, what makes quality code, why write code that is understandable and readable

Hi there, lately some thoughts about various subjects have been percolating in my mind, and I think I should just write them out, to solidify what I’m thinking about and keep as a note to remember in future.

So this post contains some thoughts about programming or writing code. I think one of the important things I’ve learned during my bootcamp was code quality. I wrote very briefly about it some time back over here, but I should elaborate more this time.

Quality code is understandable, readable, tested, discoverable, changeable, documented.

The thing about programming or building software is you’re essentially writing text or words (code). Lines and lines of them. So these lines of code are the building blocks, imagine Lego blocks, that join together and are processed by the computer to perform functions.

large

In programming languages, there’s a distinction between higher level languages and lower level ones. Lower level languages are assembly language or machine code, they are not easily readable by humans because they are like 1s or 0s. Imagine seeing 1100011111100001010001010. It’s almost impossible to decipher and takes hours even if you try. Thus, higher level languages like C was invented, building on alphabets and mathematical symbols, things we can more easily read and understand. Then over the years, higher degrees of languages were invented, for example Ruby, which reads almost like normal English. This increases the speed in which humans can write, read and understand code, while making fewer errors.

Sorry for digressing, anyway, when programmers write code, they’re writing it for two audiences: (1) the computer to run the code, and (2) other programmers.

7016111651_bfb7b9d0c4_b

To dispel a myth that’s perpetuated by the media, of the lone wolf programmer who works in isolation, the reality is much programming work in the real world is done collaboratively. Each person builds a certain module or part of the software, and different parts are built at the same time by different people. It’s almost like construction workers building a HDB flat. So there has to be communication and cooperation between the programmers – they should at least have a general understanding of what the other person is writing, and thus, their code has to be standardised/formatted, and should be written in a way that’s understandable by others.

Just as in English, where you can express the same meaning using different phrases, it’s similar in code. You can get the same function or result using different paths, some of which can be complex or indirect. Usually, programmers will opt for a direct and understandable path, balancing computing speed and efficiency.

True, that are cases where one person builds the software, writing all the lines by himself or herself, so on the surface, if the computer understands the code, it doesn’t matter if other people don’t. But we are forgetting that software is meant to outlast the people who wrote it. Programmers will leave or pass on, and the new person who comes in will have a tough time trying to understand what the previous guy wrote. They’ll be facing a bomb, wondering which parts of the code you can change or remove without crashing the whole system.

Sick-computer.png

In addition, software systems are not foolproof. They are designed by humans to manipulate data and information. Certain scenarios or edge cases might not have been considered when the original programmers wrote the code, like what if the user fills a form by spelling out his age as ‘Twenty’, instead of using the numbers ’20’. If the programmers had not considered how to deal with this anomaly, the software system might not be able to handle it, will throw up errors, and the user gets stuck.

Besides human errors, there are also computing errors. It’s rare but possible because computers are physical objects that experience wear and tear, and there’s limitations on the calculations they perform. I was surprised to learn of the floating point error when I started learning. Floats are numbers with decimal places. Take 0.1 + 0.2, the answer is simple, 0.3. However, you’ll be surprised because the answer in some situations if you’re not careful, is 0.3000000000001.  Once you perform a series of calculations, the magnitude of errors become more significant, and if your software programme is handling salary payrolls for employees, they may find themselves receiving a few hundred or thousand dollars more than they should get.

To learn why this happens to computers, you can check out the link I provided. The short answer is computers perform calculations in binary : 1 or 0, while we use the decimal system – calculations in 10s. So our numbers need to be translated into binary form first, and in cases where numbers have decimal points, rounding errors are introduced into the process. So usually, to overcome this, the computer needs to be specified that arithmetic functions are performed on floating numbers.

What it all means, software systems are not perfect. They need to be maintained and monitored for errors, and this task takes time and eventually more than 1 person on it. So whatever code in it has to be readable and understandable by others. Thus, writing code is not just writing code, it’s also a form of communication.

You have to consider the point of view of the person who’s going to read your code, will they be able to understand the terms you’ve used? Is what you’ve written clear and yet concise?

Speaking of concise, sorry for the lengthy post. I’ll talk about other stuff next time. Like similarities between writing code and writing tv scripts. There’s parallels between the two processes, especially as it involves working in collaboration with others. Until then, have a good day ahead.

What I’ve been up to… Freelancing and signed up for DM courses

So the past week I’ve been freelancing as a copywriter for an agency and it’s been great so far.

i like the pace of the work, and the fact that the company provides breakfast and snacks for its staff, and has a great playlist of songs from the 90s, are plus points too.

As a side effect of doing copy, I’m beginning to like writing again. I think it’s largely because of the pace; I mostly finish work and leave the office on time. A change from some previous jobs where I didn’t know what time I’d be working until every day.

lateoffice

With more time for myself, I signed up for an Edx course on digital marketing and started learning at Lynda.com. I think DM is interesting and certainly very relevant, since the first place people look for information is to go online.

The last time I worked in advertising was in 2011, a time when companies had started utilising social media for marketing. There were contests and games on Facebook, I remember a fruit drinks company hired the agency I was in to make a shooting game and I was also assigned to write some comics for their Facebook posts – the comic characters were fruits.

Now, it’s fascinating to see how the business/advertising landscape has changed, there’s a lot more companies on Facebook now, although I think there isn’t as much experimental work now, maybe the marketers are more careful about their ad spend nowadays, or streamlining it on content that’s more relevant to their brand and consumers.

Thinking about how the marketing landscape has changed, I see new buzzwords and terminology: terms like paid media, earned media, and owned media. New ways of classifying channels of engagement with their audience.

The wave is here. Digital marketing, driven by metrics and ways to measure results, is going to be in demand, along with content creation that produces shared value for brands and their fans.

my first recursive function (Elm)

Yay, I wrote my first recursive function in Elm today.

I was working on the 99 problems tutorial and it had this question:

How do you find the last element in a list? 

I know that in Ruby, we can use the .last method to get it, but in Elm, there’s no such method.

So I tried this:

lastElement xs = case xs of
[] -> Nothing
[x] -> Just x
y::ys -> lastElement ys

And it worked! Yay! So to explain the code, lastElement is the function that takes a list xs as its argument.  The resulting cases are:

  • If the list is empty ([ ]), it returns Nothing,
  • If there’s one element in the list ([x]), it returns it (x).
  • If the list contains more than one element (y::ys), we will ignore the first element (y) and call the same function lastElement recursively on the rest of the list (ys). Thus, we will keep eliminating the head of the list until we reach the last element and return it.

This works as tested here.

I’m happy because I’m starting to see some results in my quest to learn Elm. 🙂

Elm and Functional Programming

I think I’m going to try learning Elm and functional programming, as a way to build skills in frontend and also sidestep the tediousness of javascript. In addition, Elm is static-typed and so I think it’ll give me a perspective on static-typed languages, and that’s different from a dynamically-typed language like Ruby.

I came across this nice online beginner’s course on Elm here. Still can’t believe that it’s free to learn, I’m just watching the videos and expecting a paywall to come up anytime, but so far, 3 lessons in, it’s been great. 🙂

 

Rails web scraper for diaryland

I finished building my webscraper yesterday. I wanted to learn how to build one, and I followed some online tutorials and used the nokogiri gem. It was quite a smooth and interesting experience… Nokogiri is useful, you can choose to target the elements you want to scrape using CSS or Xpath.

I’m not sure what’s Xpath, okay a quick google search says it’s syntax for targeting parts of an xml document. XML is similar to HTML, except the syntax is more descriptive, like actual words in the tags instead of <p>s, <br>s and what not.

Okay, so anyway, while learning to build the webscraper with nokogiri, I learnt some cool new things.

  1. I learnt about other webscraping gems like spidey and other tools; one useful tool is a Chrome extension called SelectorGadget (the name sounds similar to Inspector Gadget, that 80s cartoon series), it helps you easily find and group the CSS/Xpath elements you want to target.
  2. I also learnt to create a random User-Agent for when Nokogiri targets a html page, because if you don’t specify a User-Agent name, you get a default one, and after a few tries, you will get a 429 error code for sending too many requests to the site/page you want to scrape.
  3. Lastly, no matter how small the project is, there’s always something new to be learnt. I guess this is because of how new I am to web dev/programming.

My initial goal to scrape my own diaryland website is accomplished. Good job lol. I followed an online tutorial that was very informative. This one.

What next? I think there’s improvements to be made:

  1. For one, I’ll need to learn how to create a background service job for scraping. So that the rails server can do other things while it’s scraping; like serve the initial results first.
  2. And pagination, I think that’s easier with the Kaminari gem.

Okay, this is it. Oh yeah, another thing I learnt, well I learnt that i have about 680++ diaryland entries. That’s amazing haha. I’ve been writing stuff at my diaryland page since I was 24? That’s in 2004, so it’s been more than 13 years. Wow. I’m surprised diaryland is still around frankly.

So okay. See you. Yeah in case you want to scrape your own diaryland page, with rails, if you have either, you can see the source code here.