Skip to main content
Commonmark migration
Source Link

#Using N instead of La

Using N instead of La

In many cases you need something initialized to an array containing an empty array as its only element, which is La, seemingly unnecessarily 1 byte longer.

In many cases you also need to add a newline after each element before printing, which would be something like No or N*.

But if both are true, sometimes you may find out that you can just initialize the array with N, which has the newline character as its only element. Make sure you only prepend things to the elements in the rest of your code, and the first thing to prepend is always a character or an array. Or only append, if a leading newline is acceptable and that makes it shorter.

Sometimes S also works if you need to separate the output with spaces.

In rarer cases, the initial element has to be a string. But you still can use Na which might be shorter than appending the newline afterwards.

#Using N instead of La

In many cases you need something initialized to an array containing an empty array as its only element, which is La, seemingly unnecessarily 1 byte longer.

In many cases you also need to add a newline after each element before printing, which would be something like No or N*.

But if both are true, sometimes you may find out that you can just initialize the array with N, which has the newline character as its only element. Make sure you only prepend things to the elements in the rest of your code, and the first thing to prepend is always a character or an array. Or only append, if a leading newline is acceptable and that makes it shorter.

Sometimes S also works if you need to separate the output with spaces.

In rarer cases, the initial element has to be a string. But you still can use Na which might be shorter than appending the newline afterwards.

Using N instead of La

In many cases you need something initialized to an array containing an empty array as its only element, which is La, seemingly unnecessarily 1 byte longer.

In many cases you also need to add a newline after each element before printing, which would be something like No or N*.

But if both are true, sometimes you may find out that you can just initialize the array with N, which has the newline character as its only element. Make sure you only prepend things to the elements in the rest of your code, and the first thing to prepend is always a character or an array. Or only append, if a leading newline is acceptable and that makes it shorter.

Sometimes S also works if you need to separate the output with spaces.

In rarer cases, the initial element has to be a string. But you still can use Na which might be shorter than appending the newline afterwards.

added 148 characters in body
Source Link
jimmy23013
  • 37k
  • 6
  • 77
  • 148

#Using N instead of La

In many cases you need something initialized to an array containing an empty array as its only element, which is La, seemingly unnecessarily 1 byte longer.

In many cases you also need to add a newline after each element before printing, which would be something like No or N*.

But if both are true, sometimes you may find out that you can just initialize the array with N, which has the newline character as its only element. Make sure you only prepend things to the elements in the rest of your code, and the first thing to prepend is always a character or an array. Or only append, if a leading newline is acceptable and that makes it shorter.

Sometimes S also works if you need to separate the output with spaces.

In rarer cases, the initial element has to be a string. But you still can use Na which might be shorter than appending the newline afterwards.

#Using N instead of La

In many cases you need something initialized to an array containing an empty array as its only element, which is La, seemingly unnecessarily 1 byte longer.

In many cases you also need to add a newline after each element before printing, which would be something like No or N*.

But if both are true, sometimes you may find out that you can just initialize the array with N, which has the newline character as its only element. Make sure you only prepend things to the elements in the rest of your code, and the first thing to prepend is always a character or an array. Or only append, if a leading newline is acceptable and that makes it shorter.

Sometimes S also works if you need to separate the output with spaces.

#Using N instead of La

In many cases you need something initialized to an array containing an empty array as its only element, which is La, seemingly unnecessarily 1 byte longer.

In many cases you also need to add a newline after each element before printing, which would be something like No or N*.

But if both are true, sometimes you may find out that you can just initialize the array with N, which has the newline character as its only element. Make sure you only prepend things to the elements in the rest of your code, and the first thing to prepend is always a character or an array. Or only append, if a leading newline is acceptable and that makes it shorter.

Sometimes S also works if you need to separate the output with spaces.

In rarer cases, the initial element has to be a string. But you still can use Na which might be shorter than appending the newline afterwards.

Source Link
jimmy23013
  • 37k
  • 6
  • 77
  • 148

#Using N instead of La

In many cases you need something initialized to an array containing an empty array as its only element, which is La, seemingly unnecessarily 1 byte longer.

In many cases you also need to add a newline after each element before printing, which would be something like No or N*.

But if both are true, sometimes you may find out that you can just initialize the array with N, which has the newline character as its only element. Make sure you only prepend things to the elements in the rest of your code, and the first thing to prepend is always a character or an array. Or only append, if a leading newline is acceptable and that makes it shorter.

Sometimes S also works if you need to separate the output with spaces.