Friday, 29 June 2018

3 Worst Programming Languages to Avoid Like the Plague

worst-programming-languages

There are lots of awesome programming tutorials out there to get you started with coding. But before you dive into them, you’ll have to answer a very difficult question: Which programming language should I learn?

Some languages are easier for beginners to learn. Others are most useful for the future. And others are most likely to help you land a programming job.

In this article, we’ll approach it from the opposite end: Which programming languages should you avoid?

1. Esoteric as %^&*!

Let’s start with an easy one. Esoteric programming languages (or esolang for short) are designed to push programming to its limits of simplicity. In doing so they succeed in making it incredibly complicated.

While this seems like a contradiction in terms, a quick look at the unfortunately named Brainf&*k language:

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

This monstrosity is functional, Turing-complete code. The function of this program? It prints Hello World! to the screen. Simple, isn’t it?

The language consists of eight characters, which move the data pointer within the program array, and modify or output the data held in each position. This all adds up to a simple language which is an absolute mind destroyer to use. Hence the unfortunate name. By the way, Brainf£$k is not the only esoteric language with a “colorful” name, so be curious at your own risk!

Brainf^&k is one of the better known esoteric programming languages, though many more can be found. Perhaps you want to build a program using the one-liners of Arnold Schwarzenegger? Chef is particularly notable as the code you write ends up reading like a recipe.

Esoteric languages are designed more like a fun challenge to programmers than for everyday use. As a general rule, these languages are Turing Tarpits and will cause more frustration than anything else if used for actual programming tasks. In the same way that going over Niagara Falls in a barrel isn’t necessary, I’m sure some of you will program in esoteric languages regardless!

2. PHP

This is where things may get contentious. PHP is a server-side language designed for web development. Originally released in 1997, PHP quickly took over the web. You’d be hard pushed to find any large web entity that doesn’t use PHP. PHP introduced the concept of Dynamic Websites, allowing users to query databases in real time rather than loading static pages on each interaction.

A recent Stack Overflow survey shows PHP as the ninth most popular language, and there is still a considerable demand for PHP developers. So far so good. Widely used, in demand, long-standing, what isn’t there to like?

Well, depending on who you ask, quite a lot!

Inconsistency

PHP wasn’t meant to be a language and grew piece by piece rather than with a general structure. This makes learning PHP a frustrating experience.

An example of this provided by aptly named phpsadness is PHP’s get function:

gettype()
get_class()

These little inconsistencies in the naming of in-built functions are part of a much larger problem. Small differences in syntax and semantics make PHP difficult to learn when coming from another language.

In an age of programming language polyglots, these issues might not be a big deal to you, but it is enough to make some developers run for the hills.

One more thing before we move away from these types of inconsistencies. In PHP, function and class names are not case sensitive, but variables are.

Wait, what?

The Ternary Operator

Whether it is a product of PHP’s ad-hoc structure or the mad whim of one of its creators, the ternary operator in PHP is baffling. Consider this:

$a = 11; 
echo ( 
    $a == 10 ? 'ten' : 
    $a == 11 ? 'eleven' : 
    $a == 12 ? 'twelve' : 
    $a == 13 ? 'thirteen' : 'something else'); 

echo "\n";
//this code prints 'thirteen' to the console

As you can see in the above example, PHP does strange things with ternary operators. In almost all other languages you would expect this code to output eleven. PHP disagrees.

This strange behavior comes from PHP using a left associative ternary operator. This somewhat mind-bending behavior is utterly unintuitive to many programmers, and even after reading a detailed explanation of how it works, it’s still baffling.

PHP is still used widely, and many people claim it has improved hugely over its 20-year tenure.

If you want to create your own WordPress plugins, then it’s certainly worth learning. There are great resources out there to get you started learning PHP, and its popularity means you will likely land a development job once you have.

The real question is: with so many other languages out there, and the rise of other frameworks like node.js and Ruby on Rails, do you really want to?

3. JavaScript

Can you hear that? It’s the sound of a thousand developers cracking their knuckles, ready to defend JavaScript’s honor in the comment section!

JavaScript is the language of the internet. There is no disguising its dominance. If you are using a browser, the page you are looking it will almost certainly be using JavaScript. When you watch Netflix or use PayPal, you are using servers running node.js, JavaScript’s server-side runtime. A quick skim of any job board for programmers shows demand for JavaScript developers.

Why does it belong on this list? Well, the darling of front-end has a few quirks.

Automatic Semicolon Insertion

If you are familiar with Java or any of the C family programming languages, you’ll know that semicolons are used to denote the termination of a statement. The interpreter sees the semicolon and knows to move on.

In JavaScript things are a little different. Semicolons are optional. While that might seem impossible, many people want to drop semicolons from JavaScript altogether.

While this is a nice idea, it is not without its problems. Self-confessed semicolon denier and YouTuber Kyle Robinson Young makes a good case for why they should be used by beginners.

The issues raised in this video point to a wider problem. JavaScript works fine without semicolons most of the time. This is because the semicolons aren’t gone at all, they are just automatically inserted where the interpreter thinks they should go.

While the cases when the interpreter gets it wrong are seen as “edge cases” by more experienced coders, they are all things beginners are likely to run into, thereby making the experience of using JavaScript unwelcoming.

A short search on the subject of semicolons in JavaScript will lead you down a rabbit hole of opinion and speculation with almost no end. When a language requires a full page of reading just to understand where you should use a semicolon, only to conclude that you should make up your own mind, it’s forgivable to think that something is wrong!

An Array of Weirdness

Anyone who has taken a beginner coding class will be familiar with arrays. They are a simple way to collect lots of data of the same type and order them to easily get it back later.

This is a fundamental of programming, so they should be pretty simple to understand right? Actually no, not right. The first example in James Mickins’ hilarious talk on JavaScript sums it up nicely:

“JavaScript arrays are array-list-dictionary combined multi-type objects.”

Right then. Clear as day.

These are just a few small examples of why JavaScript could be seen as a terrible language to learn and to use. For every case here, and the thousands of others all over the web, there is an army of people ready to defend these behaviors. One thing is for sure, JavaScript isn’t going anywhere, and neither are the endless online arguments about it.

For a final bit of fun, which harks back to esoteric languages discussed earlier: open up a JavaScript console in your web browser and paste in this monster:

alert((![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]);

A World of Programming Languages

Can you hear the sabers rattling? The angry devs ready to strike down every point made in this article? In truth, they would not be wrong. There are thousands of other cases in almost every language out there I could have used.

With the exception of the esoteric languages, each programming language has its good and bad points. As with all tools, a feature which makes one user’s blood boil is a cherished functionality to another. Semicolons may be one person’s kryptonite, whereas whitespace might keep others up at night.

For a beginner, any programming language is hard, and you should spend time learning the fundamentals of programming before worrying too much about what language to choose.

Image Credit: fizkes/Depositphotos

Read the full article: 3 Worst Programming Languages to Avoid Like the Plague



from MakeUseOf https://ift.tt/2NaSzEa
via IFTTT

Prynt Pocket: This Magical Phone Case is Actually a Printer

How to Download More Voices for Windows Narrator

speech-to-text-windows

Windows Narrator is one of several accessibility functions in Windows 10. It serves as a simple screen reader for users with visual impairments.

But even if you don’t need it for that reason, you may still find Windows Narrator useful—and you may want to download and install voices other than the default. These are the basic text-to-speech (TTS) voices you can download for Windows Narrator.

How to Download More Voices for Windows Narrator

Windows 10 does include a few extra voices besides the default. To change them, go to Settings > Ease of Access > Narrator and under Personalize Narrator’s voice, choose a new voice from the dropdown box.

Windows-Change-Narrator-Voice

But what if you want entirely new voices? Unfortunately, this isn’t as easy as it once was.

In prior versions of Windows, you could utilize a few voice-related downloads from Microsoft. Using them, you were able to dive into the Registry and make a few modifications to tell Windows to use the new voices.

We tested the once-popular methods for this, but none of them work properly anymore. Windows 10 keeps the Narrator voice information in a different location than earlier versions, rendering earlier methods unsuccessful.

While you may be able to dig around in the Registry to make this work, there’s no guarantee that future updates to Windows 10 won’t break it. And we don’t like recommending methods that require extensive Registry editing, as they’re more likely to introduce issues.

Thus, if you need more Windows Narrator voices, you’ll want to follow Microsoft’s recommendation to look at third-party tools. It points to a few other speech synthesizer software tools that support SAPI 5, including:

None of these tools are free, but if you need a high-quality screen reader or voice, they’re well worth paying for.

If you want to type with your voice instead, check out the best free speech-to-text tools for Windows.

Read the full article: How to Download More Voices for Windows Narrator



from MakeUseOf https://ift.tt/2tGgRgS
via IFTTT

How to Create and Use a Custom Color Scheme on Firefox

A few years ago, themes were a big part of the Firefox experience. You could find something to suit your mood or personality, the time of year, or even your favorite movie.

As Firefox has grown up, those themes have been largely left in the past. At best, you can add artwork as a browser skin. But that’s it.

And that’s a shame. There’s something oddly satisfying about using your own color scheme. Just ask anyone who rocked “Hotdog Stand” in Windows 3.1. Thankfully, it looks like Firefox is going to reintroduce some color customization features! Keep reading to find out how you can use a custom color scheme on Firefox again.

How to Enable Custom Color Schemes on Firefox

To use your own color scheme on Firefox, you first need to enable an experimental feature:

  1. Go to the Firefox Test Pilot page while using the Firefox browser.
  2. Click on Color to load the experiment’s listing
  3. On the next window, click on Install Test Pilot and Enable Color.
  4. Wait for the process to complete.

Now you’re ready to start customizing. The color add-on lets you tweak the color of almost any part of the browser’s user interface, including the search text, background tabs, toolbar color, and a whole lot more.

The Color add-on should take you to the customization page automatically, but you can also use the associated browser link.

If you scroll all the way to the bottom of the Color page, you can choose from some pre-made themes. And if you want to share your creation with family and friends, go to the Firefox add-on page and share the provided URL.

Lastly, to remove your colors and revert to the default color scheme, just delete the color add-on from your browser.

If you’d like to learn more about Firefox add-ons, we have covered some of the best in our extensive Firefox add-on guide.

Read the full article: How to Create and Use a Custom Color Scheme on Firefox



from MakeUseOf https://ift.tt/2tLAvHH
via IFTTT

How to Select All of the Same Color in Photoshop