Categories: CreativeDevelopment

Dont put your code snippet as an image

Code snippets no matter the placement as seen as a guide, answer or ways to do something. From a blog to a website, Gist they serve the same purpose. Code snippets arent some secrecy that can’t be shared or must not be copied if the were then why would you even reveal it to begin with.

Yet still you visits websites that will put code snippets in an image, completely useless and missing the point. Code is text it’s not an image, it is something that can be selected, altered and copied. What is someone meant to do with an image if your code is meant to teach something?

How about this

code as image

or this?

";
   $hash_val = md5 ($val);
   echo "Hashed outcome: $hash_val";
?>

Depending on how you get the image created the inline code sits better, more customizable and as I have stated can actually be used.

The darn code snippet images make debugging harder too, just put it in a syntax highlighter box. You will get better SEO if your code is readable by Google especially if it’s for a problem.

The only place that an image code snippet is ok is Twitter BUT even then its pretty close to useless. Just link to a Gist no one can do anything with a jpg that has code.

Maybe some think its fancy or trendy whatever the thought should be put to rest, its 2019 code shouldnt be turned into images.

 

Share

Recent Posts

Kennington reservoir drained drone images

A drained and empty Kennington reservoir images from a drone in early July 2024. The…

2 years ago

Merrimu Reservoir drone images

Merrimu Reservoir from drone. Click images to view larger.

2 years ago

Early September spring shots

Some early September spring shots from a bushwalk, It is still too early for wildflowers.

3 years ago

Cloning an NVMe to SK Hynix Platinum P41 NVMe

I recently needed to clone over a smaller NVMe to a 2TB SK Hynix Platinum…

3 years ago

Using Laravel’s deleteDirectory to delete folders and their contents

If you ever needed a simple solution in Laravel to delete an entire directory and…

3 years ago

How to allow only 1 user to register in a Laravel application

How to enforce only one user to register or be registered in a Laravel web…

3 years ago