Curls, clouds and code

About social media, advertisements, and psychological trauma

The time between Christmas and new-year is traditionally a time of reflection for me. What have we done in the last year, where do we want to go, and how do we want to get there? 2019 has been a though year with lots of self-reflection overall, and my results are rather of philosophical nature than productive output.

I have written this essay back in June, and think now might be a good moment to publish. This essay has mainly been based on my personal experience. If you happen to know more related research which may back some claims, or maybe invalidate them, I would love to hear about it!

Introduction

Every now and then there are people appearing into the spotlights claiming social media is the source of many problems which have appeared over the last (few) decennia. While most of us certainly have heard stories about how social media is changing society - and it certainly is -, I personally do not believe it is the root cause why society is changing. Google’s autocomplete engine is able to summarize the claims about social media quite neatly. Social media arguably causes a lot of things, but most of these are personal, and more importantly, negative and urgent issues.

Search results when searching for 'social media causes' with Google

How is it that a social media platform could potentially cause isolation or loneliness, which are essentially the very things one would try to avoid by being ‘social’. Why is it that social media is linked with elevated depression rates, anxiety and stress?

Having gone through a major depressive episode, followed by a full-blown burn-out I for sure had to change the way I lived. I had to question everything I have ever known, and I needed to get everything back on track bit by bit. And while the whole experience was all but fun, it was healthy. The key take-aways I learned during this episode:

I hope these points have set the stage for the rest of this document.

Using the RazorViewToStringRenderer with Asp.Net Core 3

There are several articles detailing how one can render Razor views without the whole ASP.NET Core web hosting infrastructure. Some of these articles are detailing how to use the RazorViewToStringRenderer approach as first seen in this repo. Another approach is to manually use the RazorProjectEngine to compile templates on runtime. Both approaches have their down and upsides.

The main distinction between these two approaches is the way they deal with templates. In this regard the RazorViewToStringRenderer is ideally used to render pre-compiled razor templates, while the RazorProjectEngine approach is best used in situations where dynamic compilation is required. Think for example about templates loaded from a database or another dynamic data-source.

Additionally the RazorViewToStringRenderer supports rendering complex templates more easily because the dependencies are properly compiled at compile time (no pun intended). Having missing dependencies using the RazorProjectEngine method is one of the more tricky issues to solve consistently.

This post details the instantiation of the RazorViewToStringRenderer using Asp.Net Core 3. Excellent samples for both approaches can be found in the answers to this question on StackOverflow.