Monday 29 April 2024

What's the best programming language for beginners?

What should be a programmer's first language?

Often, this is not a deliberate choice, more a matter of circumstance. Perhaps a programmer started on QBasic as a kid. Perhaps, like me, the programmer picked it up in school and was made to learn C++ or Java. I would even venture to say very few programmers start out saying I'm going to begin my programming journey with the best, most modern language out there! To begin with, how would they know what constitutes the "best" programming language, or what even is a good programming language? You don't know what you don't know, after all.

Let's learn!

Also, how suitable a programming language is for your purposes also really depends on what your purpose is. Do you want to crunch data? Write games? Build web portals?

So, obviously, before we can sort out what the "best" programming language is, perhaps it is more useful to figure out what a programmer's first programming language should be. After all, this choice opens different doors.

For that, we should probably look at a few factors. I can only draw upon languages I've coded in before. as examples, obviously.

Syntax

For this, we look at simplicity of writing code in that language. How intuitive the syntax is, and how few extra keystrokes needed to get something done.

For this, my obvious picks would be Python or Ruby. Less of the semi-colons and curly brackets. Anyone picking either Python or Ruby as a first language, I suspect, would be less likely to give up out of frustration.

Code syntax.

C# and Java is probably among the worst for this. Too many namespaces. Overly verbose syntax. I haven't had many projects that needed to be done in either of these languages, and for that I'm truly grateful.

But the one that takes the proverbial cake, in terms of being cumbersome, would be PHP. The function calls structures are wildly inconsistent, and in addition to semi-colons and curly brackets, it also requires a dollar sign preceding every variable name.

As far as syntax goes, the group of programming languages with visually similar styles - PHP, Java, JavaScript, C and its variants - is such that if you pick one up, the learning curve for the others, at least for the simple stuff, isn't so great. Thus, even if PHP is hideously cumbersome in parts, it benefits from being visually similar to other languages mentioned.

Transferable skills

This measures underlying principles or skills that one will pick up while programming in a certain language, that will be useful when transitioning to another stack. It could be something as simple as similar syntax (as mentioned earlier) or strong data typing.

Or it could be something so ubiquitous that no matter what stack you're in, you're almost certainly going to encounter it. A great example of this would be SQL. No matter what kind of programming you go into, the chances of you needing to access a database at some point, are pretty good. I wouldn't go so far as to say that this makes SQL the number one choice for a programmer's first language, but it makes a great case for being a programmer's second, at least.

Data processing.

For a similar reason, if one wanted to go into web development, it's almost impossible not to have to deal with HTML, CSS and JavaScript, but learning JavaScript as a first language just for that, is questionable. As a second language, definitely.

Strongly-typed, class-based languages such as Java and C# would be good choices as a first programming language for learning concepts such as Object-Oriented Programming. (PHP and JavaScript kind of implement OOP as well, but in a way that's a little odd). Python would be the choice if one wanted to have a strong foundation in data structures. However, Python's lack of strong typing might work against it as a first language.

Ease of setup

One of the most daunting tasks of learning a language is setting up the environment for it. Java requires the JRE (Java Runtime Environment). PHP requires an Apache server. Python and Ruby, well, you get the idea.

For this, the most fuss-free option has to be JavaScript, hands down.

All major browsers
run JavaScript.

JavaScript runs on all major browsers. You don't need to install anything you probably don't already have. If you're reading this, unless you're reading it on your phone, you have a desktop browser which you can run JavaScript in. It's almost zero setup. Just write your code, and run it in the browser.

For a Windows environment, VBScript is also almost zero effort. All you need to do is write your script, save it with extension "*.vbs" and you can run it by double-clicking it! Unfortunately, I'm not sure how useful knowing VBScript is.

In essence, in the cases of both JavaScript and VBScript, the environment has already been set up for the programmer.

Popular support

No developer plies their trade without consulting a reference of some sort. Textbooks are a valid source, but for the most updated material, we turn to the internet. Portals and forums provide most of these, with each language having large communities of programmers ready to provide support.

Learn by reading, or
by community.

Which programming language has the largest, or best, communities?

That's hard to say. All communities have their fair share of toxic losers who waste little time being condescending and acting like gatekeepers. At the same time, each community also boasts genuine people. I'm not going to waste time detailing how large each programming language's community is relative to others. Suffice to say, they're all (OK, mostly) large enough to be useful.

Generally, the longer they have been around, the larger they tend to be.

Conclusion

Whatever the choice turns out to be, ultimately, there will be benefits to that choice. That is because no matter what language someone chooses for their first programming experience, the fact remains is that they are still engaging in the activity of programming. It's a start. Some starts are better than others, sure, but it's a step. And hopefully the first of many.

Mind your (first) language!
T___T

Wednesday 24 April 2024

The Tree of Newspaper and Toilet Roll Tubes: A TeochewThunder Project

Here's another TeochewThunder project, though this one has nothing to do with software. It does, however, have plenty to do with my professional life as a software developer, of which I'll get to in a moment.

This particular work spanned a number of years.

At the start

Back in 2013, I had just moved into my own place. A friend had come to my place and shown me a project she did with kids, using toilet roll tubes, masking tape, newspaper and glue to make a tree. We had fun making it, though the end result was comically bad.

Just the trunk
and roots.


A branch or two...


More branches!


I dressed it up at Christmas...

Some golden balls
and a star.


...and at Halloween. It was great.

A hanged man!

Somehow, three years later, I lost my job. Thoughts raged in my head, doubts about my professional credentials and my ability to survive in Singapore's workforce, even though logically, I had lost my job in what amounted to a business closure that had very little to do with my competence at all. Still, what with having a huge amount of time on my hands in between applying for jobs and keeping my coding skills sharp, I needed to not be thinking negative and counter-productive thoughts. Thus, I threw myself into adding more features to the tree.

Even more
branches!


I packed it more densely - previously it had just been about stuffing newspaper confetti into toilet roll tubes and then pouring glue in and letting it dry, then wrapping it up in layers of tape. Now, I actually added wire into the mix to shape things. For every day I remained unemployed, I added one more branch. Those branches sprouted smaller branches, which in turn sprouted some more.

Looking good!

Soon it was growing at a steady rate. Little branches popped up. Now it was starting to resemble a bonsai. I began adding layers of glue and newspaper to the base. No more shoddy work with crushed newspaper. The roots, in particular, were looking increasingly solid.

Then I got employed, and no longer had time to continue building on the tree. I was earning what amounted to serious money, for me. And I needed to focus.

For years, my creation was left there languishing in my living room, looking like some tree-shaped Frankenstein's monster.

Five years later

In 2018, I got married. COVID-19 happened a year later, along with a little more upheaval in my employment situation. The wife was trapped in China, under pandemic lockdowns. I started looking at the tree again, critically. Though, this time, around Christmas, I was looking at the base I had created for it, out of large toilet roll tubes. What if the tree roots rested on something rather than floating on air?

What if I filled these toilet roll tubes with papier-mache?

Another Christmas.

I bit the bullet, and embarked on the task. I was determined to finish it, come hell or high water, though the entire thing turned out heavier than I had expected. I had to divide the base into three pieces, and work on them separately. While I was close to finishing the first piece, my wife returned.

In the time that she was back, she was less than impressed with what I was doing. Admittedly, it was a work in progress and did not look in the least impressive. Just before she left for China again, she remarked that we were about to move house in another year, and when we did, we should abandon all the ugly and useless things I had accumulated in my place over the years... all the while looking meaningfully at my tree.

That did it. In that moment, I resolved to step up my efforts to make the tree presentable.

The Foundation

Three large slabs.

By that time, I had finished filling in the toilet roll tubes, and now had three great slabs of dry papier-mache. I needed a way to assemble these easily, and disassemble them for easy packing. That was how I came up with the idea below, pins made from pointed wooden sticks and papier-mache.

The pins.

The above came about when I was idly molding a piece of damp papier-mache in my fingers, and as it dried, it looked like a slab of granite. And that gave me the idea of making pins that looked like slabs of stone. But it also gave me a further idea. What if I glued several of these pieces to the sides of the slabs, to simulate a rough-hewn stone wall?

Making a wall.

I started making papier-mache bricks. Lots of them. Big, small, roughly rectangular, some not so much. At some point, I had a pile of them. And when I started putting them together for the "wall", I came to realize that it was still not enough. I would have to up my production.

Little papier-mache bricks.

The wall was fun, by the way. It was like putting together a jigsaw. It took a month or so, but now I had three great papier-mache blocks, each with their own wall, and joinable to each other via the pins.

Now I had another problem - how to make the joins seem more seamless?

A pointed stick fence...

I came up with the idea of a fence made from pointed sticks. Each of these sections of fence were glued and tied together with yarn. This made it look organic and rustic... but unfortunately also made them crooked and warped.

...now with points removed.


Repeating the fence sections.


Binding with thread.


Slipping the fence
sections in.

I added little blockade sections to the bases so that the fences could slot nicely into them. I also extended the pins to have little slots where the ends of each fence section could slide in. Talk about engineering!

The completed fence.

And tada... a fence.

A winch!


Bases for the winch.


Fitting in nicely...


Well walls.


Combining the walls
and winch.


Add a roof...


With the leftover papier-mache bricks, I made a well. I added a roof and a winch, which could actually turn!

Final touches

And now it was time to turn my attention to the tree itself. It had lasted so many years, and now I found that a lot of air pockets existed, just by doing a press test at different locations - trunk, roots, branches. I began cutting it open, and filling in the gaps with papier-mache. The process was akin to playing the whack-a-mole game. Every time I thought I'd gotten them all, I found another patch.

Patching the holes.

A week passed, and another. But finally, I covered them all. And then I started covering the ugly newspaper skin with a thin layer of papier-mache. This had the texture of what approximated tree bark. And while I was at it, I added numerous little twigs to the various branches to round out the shape of the entire tree.

Adding a bark covering.


Almost done.


Adding tiny branches
from leftover
pointed sticks.


In all its
unpainted glory.

Once it was dry, it was time to paint. I gave it two coats of acrylic. The first was a matt black which was meant to cover every nook and cranny. The second coat was a glossy brown finish to deliberately make the coloring look uneven in spots.

Starting from
the roots.


Up to the branches.


On the final few days of last year, I began the process of moving house. One of the first things I moved was this tree. I took apart the fence, the pins, and the foundation slabs. And then I got a cabbie friend to do me the favor of transporting these to my new place, where I proceeded to reassemble it right in front of him.

Disassembled.


When my wife came home and saw the final result, she was pretty impressed. She was definitely no longer calling it "ugly and useless".

My beautiful tree, in
my beautiful new
home.

The tree was placed outside my front door in a prominent spot. My new neighbors came by, took pictures and marvelled. My parents dropped by during the Lunar New Year, and voiced their approval. If you don't have Asian parents, you have no clue how huge a deal that was.

Conclusion

That was a pretty Herculean effort on my part. This was not a software project. There were no do-overs if I screwed anything up badly.

However, in other aspects, it was like a software project. In the sense that everything was done iteratively. Every feature was broken down into separate tasks, with subsequent features planned on top of completed features. As of now, this tree is the finest work that these hands have produced.

Branching out,
T___T

Sunday 21 April 2024

Five Funny Tech Webcomic Strips

Like many geeks, I read comics. I'm a fan of that visual media. And when comics feature software technology, not only do I get the jokes, I relate.

Here are some of the wittiest tech-related comics I've had the good fortune to follow over the years.

1. XKCD by Randall Munroe

This comic strip with the unpronounceable name, is an obvious choice. It's been around since 2005, and is full of tech wisdom and witty (and very cynical) observations about the tech industry.


The art is nothing groundbreaking; it's literally stick figures talking to each other. But somehow the lack of faces on these stick figures add rather than detract from the content. It actually makes the dialogue feel very deadpan, which is absolutely appropriate for the subject matter. The humor is very dry.



Take the above example. It features a typical programmer problem - the tendency to over-engineer things. "It'll save time in the long run!" What a punchline, and how apt.

For tech humor where you need a bit of professional experience to really relate to the content, I can't recommend XKCD enough.

2. Dilbert by Scott Adams

The next item on this list needs almost no introduction. Dilbert has been around since 1989, and its content has been the mainstay of many office workers.


Dilbert does not just deal with tech foibles; in the larger picture, it takes the Mickey out of corporate nonsense. Something that a wider audience can relate to.


The strip above is just one such example. In it, the titular character Dilbert mocks his clueless corporate boss, who in turn is a caricature of the stereotypical corporate stooge driven only by profit and buzzwords.

Its creator Scott Adams has in recent years come under fire for remarks made on YouTube. Which is also why there is no link I can provide to his work. But alas, do you hear that silence? It's the sound of me not giving a rat's ass. His shit is funny AF, and in the spirit of separating the artist from the art, that's all that matters.

3. Help Desk by Christopher B Wright

We follow up with another example of extremely simplistic art. There's nothing elegant about Help Desk - though in all fairness the art is way more detailed than that of XKCD. The facial expressions are still minimal, and as with XKCD, this serves to accentuate the deadpan-ness of the humor. 


I've been following this comic since my days in desktop support, and it goes all the way back to 1996. It was huge for me back then. I related so much. Even the character that appears - Binky the Paper Clip, featured below - is an example of something that had relevance back in the day but probably less so now. Still, this does not change the fact that Wright is one hell of a webcomic artist.



Help Desk is actually only one section out of his entire body of work. There are other comics that he draws, of course. The main complaint I have is that the dialogue tends to be a bit wordy, but when it's good, it's good.

4. Toggl by Mart Virkus

Toggl is a tech company with a product, Toggl Track. It's a project productivity tool which - you know what, I'll let them speak for themselves. Go follow that link. I'm just here to talk about their comics. Toggl has a blog that features a lot more than just comic strips, but damn, their comic strips are good.



The comics that are drawn by Mart Virkus, in particular. Virkus has his own site, but its the stuff that appears on the Toggl blog that I like the best. Toggl also has other comics contributors and I'm sure they have their own following, but it's Virkus I want to focus on here.

His stuff mostly focus on the differences between programming languages, software development methodologies and the like.


One of my favorites is the one above, and it's also fairly representative of his content on the Toggl blog in general. The art is cute, and brings the message across quite effectively.

5. Monstika by Monstika/Cheezup/Arseniic 

This last one is more of a blog that I found in recent years. I don't know anything about Monstika, whether they're male, female, or how long they've been doing this. Or their real names - the artist goes by mostly by Monstika, but also Cheezup or Arseniic on different platforms. And guess what, I don't need to know. Their shit is side-splitting.



There are no lengthy dialogs. Mostly memes, and visual puns. And if there's anything I'm crazy about, it's puns. Tech puns. Especially the really bad ones. The programmer dad jokes.


Take this one above. It's so bad, it's good.

The puns are mostly tame enough that even non-techies can (mostly) grasp them. The art's pretty good too!

Hilarious!

Humor - especially the visual kind - is a great way to get through the day. And when you can relate to said humor, all the better.

programmer.chuckle(),
T___T

Tuesday 16 April 2024

How worried should software developers be about Devin AI? (Part 2/2)

On the subject of Artificial Intelligence taking over software development, there's both good news and bad news. Actually, most of it is bad. But let's start with the good.

Your edge against Artificial Intelligence

Computer processors have grown faster over time. That's a bit of an understatement; processing speed and power have increased at an astonishing rate over the past few decades. Faxes used to take twenty minutes to travel the world; now email performs the same function in seconds, or less.

But however fast computers are now, they're still at best capable of accessing and processing information millions of times faster than humans. Their ability to create new things is an illusion - creating what appears to be new things using existing content as input. The creativity factor is probably a zero. And mathematically, zero multiplied by millions, is still zero. Thus, no matter how fast computers get, they aren't any closer to true creativity than they were decades ago.

Machines are always
significantly faster.

Human beings on the other hand... while it's difficult to objectively measure creativity, I think it's safe to say that the creativity factor of the most brilliant minds on the planet, is probably above zero. Therefore, no matter how slow human beings are compared to computers, we still have that edge.

I've also mentioned before that machines aren't capable of loving their work. They aren't capable of being motivated by things like pride and passion. All that requires flesh and blood. So, for whatever it's worth, that is one thing that no A.I can ever replicate. For the simple reason that whatever A.I is capable of, is what humans have been able to define, just performed at significantly higher speeds. No human has ever been able to successfully formulate love, passion and pride. Subsequently, no A.I is capable of those things.

Artificial Intelligence's edge against you

One may think that A.I's lack of pride works against them. But this also means A.I, doesn't have an ego. A.I is not programmed to give up out of frustration, or refuse to learn because their non-existent pride forbids it. A.I is relentless, and keeps going. And because A.I is programmed to learn, at some point it will write better code than any human.

If, as a software developer, you have predicated your entire career around your ability to write clean, beautiful, well-documented and nicely structured code, you have spectacularly missed the point. A software developer's job is not coding. Your job is to solve problems and provide business value. Sometimes, that involves writing code. If there are people who can write code as well or better than you, since Devin AI can trawl the internet and get their code; subsequently Devin AI can code better than you, faster than you, and with a lot less effort.

Whose code is better?
Who cares?

Is it true that A.I can code better than the average software developer? That's the wrong question to ask. The correct question is, how badly do employers want it to be true?

We can argue until the cows come home, about the qualities human software developers bring - passion, pride, possibly better code. But none of it matters. When your bosses ask you about the progress of a project, do they ask how clean or beautiful the code is? No, they ask how soon it will be ready for production. The sad fact of the matter is, code quality is an engineering concern, and business people primarily care about profits. So even if human beings were truly able to write better code, business owners would probably still be more forgiving of whatever flaws A.I produced, as long as it didn't affect the bottom line.

One could argue that bad code does affect the bottom line. But again, how much would it matter to the customer base?

You could say you would support human-created art over computer-generated art. But when it comes right down to it, would you be able to tell the difference? Similarly, would the average consumer be able to tell if it was a human who wrote the code, or A.I? Would the average consumer even care as long as shit worked to an acceptable degree?

Twenty years ago, I was a web developer. I made database-driven websites for a living. Then came website builders that automated everything I was doing, and put the power of website creation squarely in the hands of non-technical people. Thankfully, I had already moved on to bigger things before this happened. Would these website builders truly be able to outdo the creativity of the human mind? Maybe not. Would it matter if they didn't? Would the average web surfer be able to tell the difference, or even care? How creative or cutting-edge do we truly need websites to be?

Think about all the writers whose work A.I is generating new content based on. Or filmmakers who may be going out of a job once A.I can replicate their work and create seemingly-new work imitating their style. Unless users have consumed enough media, books and films to distinguish A.I generated content from the "real" thing, there is going to be a market. And the machines can churn out more of this stuff quicker than humans ever can. Imagine the profits. By that point, would those profiting care about authenticity? Would consumers care enough to make a difference?

Therefore, it's no longer even about who can do the better job. It's about who can do an acceptable job, for much cheaper.

In summary

To answer the question in the title, how afraid should software developers be?

I don't want to underestimate the power of A.I. At the same time, though, let's not get carried away. Either way, I'm at the sunset of my career and I have just about no skin in the game. If A.I takes over, great. If it doesn't, also great. Either way, I doubt I'll be losing much sleep over it.

This is your world now, kids. Enjoy.

Keep calm and code on,
T___T