Will JavaScript type annotations kill TypeScript?
The creators of Svelte and Turbo 8 both dropped TS recently saying that "it's not worth it".
Yes: If JavaScript gets type annotations then there's no reason for TypeScript to exist.
No: TypeScript remains the best language for structuring large enterprise applications.
TBD: The existing user base and its corpensource owner means that TypeScript isn’t likely to reach EOL without a putting up a fight.
I hope they both die. I mean, if you really need strong types in the browser then you could leverage WASM and use a real programming language.
I don’t know and I don’t care.
Software Development / Tech Life

Code n00b: The Value of Competitive Coding

Jun 16th, 2017 11:05am by
Featued image for: Code n00b: The Value of Competitive Coding

Competitive-coding sites are a thing. There are so very many — HackerRank, LeetCode, Codewars, CodeChef, CodeEval, and the mysteriously-named SPOJ, to name check but a handful among the bazillions. But what exactly is their value in the self-taught programmer’s learning curve?

These code-challenge sites come in a variety of flavors; some are community driven, sharing solutions and voting them up or down based on speed, cleverness, etc — or lack thereof — as participants gain rank and prestige with each successful completion, allowing them to climb their chosen language’s leaderboards. Some sites allow direct coding via their online editor, others require you to submit your solution, and the range of supported languages is very wide. Many support only the current version of the most widely used languages, but some accommodate more esoteric aficionados (Elixir users, please report to Codewars; JavaScript people, go anywhere you please). Some challenge sites even provide videos, tutorials, and/or interview prep courses.

The upshot being, if you’re interested in code challenges, there is almost certainly a site out there that will suit your particular parameters. The question is, though, is this a wise way to invest time and energy early in your coding career, when you maybe should be more worried about actually getting good at coding than you are about pwning fellow programmers?

The answer seems to be a resounding “Well, it depends.”

The obvious benefit to undertaking code challenges for a Code N00b is the same as a beginning musician practicing scales — you’re working on that muscle memory. Going over and over your basic repertoire of being given a problem, thinking through to the solution, attempting to render it in code, then debugging til it works — this is only a good thing, right?

Then there is the added benefit, at least for more advanced coders, that code-challenge sites are good practice for job interview situations where you’ll have programming problems tossed in front of you as part of the evaluation process. Indeed, some code-challenge sites have corporate-sponsored content — challenges that can help you get a job if you solve them well — because tech companies have recognized the talent recruiting value of sites that attract those of us driven to code competitively.

So, then, where is the downside?

I started really diving into Javascript programming just sixth months ago. I had a good grasp of the basics but knew I needed a lot more exposure, not to mention practice, in Javascript’s inscrutable intricacies. Over the holidays one of my JS study buddies invited me to join his Codewars clan, and I enjoyed solving the beginner level challenges. It was a good practical application of, say, your handier built-in JS methods, as well as reinforcement of thinking in a procedural, problem-solving way: i.e., programmer’s mindset.

“Don’t value cleverness over clarity.” — Gordon Zhu

I also really liked that, after you got your code to work, you could check out other Codewars user solutions to the same challenge. Doing a Codewars kata each day became one of the ways I kicked off the new year and participated in the 100 Days of Code challenge.

So, for me, it was good practice, and also I learned quite a bit along the way — not just picking up specific new tools or techniques, but also more globally important knowledge. Like the realization that you don’t actually need to know absolutely everything, and that googling for solutions when stuck is a solid skill in a developer’s toolbox. (! important: I don’t mean googling for the answers to the challenges, which is cheating and defeats the purpose you’re there in the first place. I’m talking about seeking out ways to solve a problem, or parts thereof, yourself.)

The best thing I got out of doing Codewars, though, was intangible but truly essential: I started thinking of myself as an actual coder. Before, I had just been somebody who was learning to code. But now? I could solve real-life programming problems, no hand-holding required.

Thus it came as a surprise to learn that the are more than a few folks — a couple of whom have been significant mentors for me — who think code challenge sites aren’t all that great. Or, even worse, that they can even be detrimental to a burgeoning dev’s progress.

I have been working through Gordon Zhu’s Watch and Code JS curriculum, and he is no fan of code-challenge sites. He even made a YouTube video to explain why he doesn’t want his students doing them at all, comparing code-challenge sites to trying to get better at life by watching television:

People new to programming, he said, hold the misconception that they can get better by doing code challenge websites which tend to offer “really unrealistic, useless, fill-in-the-blank kinds of questions.” Doing code challenges recreationally is ok, Zhu added, so long as you understand it’s just for fun, and not a learning path — just the way that watching Jeopardy is fun and you even learn interesting facts, but it’s not a substitute for actually studying, say, history.

“It’s not the most useful thing you can do,” Gordon told me. “It’s better to just read open source code.” (Cue sad trombone sound).

But, but, but…looking at, and learning from, other people’s solutions, comparing how they went about tackling the challenge compared to how I did it? I made this argument to some other, more experienced programmers, explaining how seeing more elegantly rendered code taught me to write better, DRY-er code myself. The answer was a universal, “Yeah, but…” rebuttal about how the culture of many code challenge sites values cleverness and brevity above all else — which are not actually always that valuable in real life work.

Or, as Zhu told me, “Writing short and tricky code is cool as an idea, but every time your coworkers have to read that they just want to kill you. Don’t value cleverness over clarity. It would be like if you wrote your documentation as a rap, and everyone who needs to refer to it ends up wanting to punch you in the face. Don’t be that person.”

Yikes. I have to admit, it did take some of the Codewars wind out of my sails to realize that people I look up to personally and professionally don’t think it’s the best use of brain cells. I don’t think this is the reason I no longer attempt a kata a day, but I do believe that code challenges can be one of the tools we use. Being presented with different types of puzzles and problems helps you become a better problem solver, teaches you to stick with it and work for a solution. You get more practiced in your chosen programming language, maybe learn new algorithms or other useful skillz (a Codewars challenge I was particularly stuck on finally inspired me to get over my fear of tackling regex, for example).

My Codewars leaderboard progress has definitely slowed in recent months, but I didn’t stop doing daily code challenges because they’re somehow detrimental. I stopped because I’ve gotten to the point where I am putting a lot of that practice into action, building larger and more complex apps and projects. I feel like there is a lot more to be learned, and also feel like I’ll be back.

So, yeah, code challenges: I too have ended up in the “Well, it depends…” camp. Not the perfect path, but also not a complete waste of time. It does indeed depend on where you are, knowledge-wise, and where you want to get to. Sorry, that’s so vague.

But one thing I am now really, really sure about? I will not ever write up any of my documentation in the form of a rap.

Check out more of Michelle G’s Code N00b columns here.

Codewars/Question illustration by Michelle Gienow.

Group Created with Sketch.
THE NEW STACK UPDATE A newsletter digest of the week’s most important stories & analyses.