Languages
[Edit]
EN

Dirask - write better posts - quick solution / code examples - simple variable input data

3 points
Created by:
isherwood
449

Very good data examples for quick solutions and code examples:

// ONLINE-RUNNER:browser;

var text = 'abc'; // small letters recommended
var text = 'ABC';
var number = 123;
var text = 'abcde'; // when required to work on longer strings
var text = 'ABCDE';

Why we need to use simple variable values?

It is very easy to undestand the post if variable values are simple and very commonly used accorss all posts.

Also if human eye and brain can process example quicker than user experience is better, because user can quicker find solution.

Posts examples with correctly used short variable values:

Wrong:

var text = 'This is my text...';
// or
var text = 'This is some very long text, This is some very long text, This is some very long text';

If example doesn't require long and complex variable value, then use simple variables, like showed above.

 

Why long and complex variable value are wrong?

It is harder to understand the qucik solution / code example when variables value is long.

Alternative titles

  1. Dirask - quick solution variable input data - ABCD, abcd, 1234 VS This is my text
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Dirask - content writing

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join