Programming Tips πŸ’‘
51.5K subscribers
67 photos
10 videos
30 files
354 links
Programming & AI:
Tips πŸ’‘
Articles πŸ“•
Resources πŸ‘Ύ
Design Patterns πŸ’Ž
Software Principles βœ…

πŸ‡³πŸ‡± Contact: @MoienTajik

🎯 Buy ads: https://telega.io/c/ProgrammingTip
Download Telegram
How JavaScript works: inside the V8 engine + 5 tips on how to write optimized code ⚑️

A JavaScript engine is a program or an interpreter which executes JavaScript code. πŸŒ€

A JavaScript engine can be implemented as a standard interpreter, or just-in-time compiler that compiles JavaScript to bytecode in some form. βœ…


Why was the V8 Engine created❓

The V8 Engine which is built by Google is open source and written in C++. ✨

This engine is used inside Google Chrome. Unlike the rest of the engines, however, V8 is also used for the popular Node.js runtime.πŸ’Ž

V8 was first designed to increase the performance of JavaScript execution inside web browsers. πŸ’¨

In order to obtain speed, V8 translates JavaScript code into more efficient machine code instead of using an interpreter.πŸ’₯

It compiles JavaScript code into machine code at execution by implementing a JIT (Just-In-Time) compiler like a lot of modern JavaScript engines do such as SpiderMonkey or Rhino (Mozilla). 🦊

The main difference here is that V8 doesn’t produce bytecode or any intermediate code. ❌


https://t.me/pgimg/160

[ Article ] : kutt.it/js-md2

γ€°γ€°γ€°γ€°γ€°γ€°
#JavaScript #Internals #V8
@ProgrammingTip
BDDfy ✨

BDDfy
is the simplest BDD framework to use, customize and extend❗️

A few quick facts about BDDfy :

β€’ It can run with any testing framework. Actually you don't have to use a testing framework at all. You can just apply it on your POCO (test) classes. βœ…

β€’ It does not need a separate test runner. You can use your runner of choice. For example, you can write your BDDfy tests using NUnit and run them using NUnit console or GUI runner, Resharper or TD.Net and regardless of the runner, you will get the same result. πŸ”₯

β€’ It can run standalone scenarios. In other words, although BDDfy supports stories, you do not necessarily have to have or make up a story to use it. This is useful for developers who work in non-Agile environments but would like to get some decent testing experience. πŸ’Ž

β€’ You can use underscored or pascal or camel cased method names for your steps. 🌈

β€’ You do not have to explain your scenarios or stories or steps in string, but you can if you need full control over what gets printed into console and HTML reports. πŸ“Š

β€’ BDDfy is very extensible: the core barely has any logic in it and delegates all its responsibilities to the extensions all of which are configurable; e.g. if you don't like the reports it generates, you can write your custom reporter in a few lines of code. ⚑️


https://t.me/pgimg/161

[ Github ] : kutt.it/bddfy

γ€°γ€°γ€°γ€°γ€°γ€°
#BDD #Testing #DotNet #CSharp
@ProgrammingTip
Getters/Setters. Evil. Period. πŸ‘Ί

There is an old debate, started in 2003 by Allen Holub in this Why getter and setter methods are evil famous article, about whether getters/setters is an anti-pattern and should be avoided or if it is something we inevitably need in object-oriented programming. πŸ•Έ

The gist of the following text is this ✨ : getters and setters is a terrible practice and those who use it can't be excused. ❌

Again, to avoid any misunderstanding, I'm not saying that get/set should be avoided when possible. No. I'm saying that you should never have them near your code. 🚫


https://t.me/pgimg/163


[ Article ] : kutt.it/gset

γ€°γ€°γ€°γ€°γ€°γ€°
#BestPractices
@ProgrammingTip
DDD - The 5 Minutes Tour πŸ‘Ύ

During a conference in Paris, after the organizers asked me to fulfill a missing-speaker slot for a lightning talk (an hour before the presentation time), not only did I accept, but I decided that an introduction to DDD (Domain Driven Design) was a good choice. Yes, DDDβ€Šβ€”β€Šthe discipline that was born in a 560-page book. πŸ“•

Unfortunately, even if I had managed to get the attention of a room crowded with (PHP!) developers to talk about a topic that was dear to my heart, I don’t know if the presentation insisted enough on the two key aspects that are DDD. βœ…

My goal with this article is to give it another try, with more time to prepare. πŸ’Ž


https://t.me/pgimg/164

[ Article ] : kutt.it/ddd

γ€°γ€°γ€°γ€°γ€°γ€°
#DDD
@ProgrammingTip
PWA vs INSTANT APPS πŸš€

Since many of you wanted to know more about the specifics on PWA and INSTANT APPS, here is a quick review on the two, we will look at the 3 basic componential parts. ✨

β€’ Speed πŸ’¨
β€’ Build complexity 🧠
β€’ Branding 〽️


First PWA, what is it and why does everyone talks about it❓

Google as usual is the one standing behind popularising this concept. 🌈

While you will see a lot of bold words like: fast, reliable, engaging. ⚑️

Esseintially it is a web app built with typical tools like HTML, CSS, JS and that has a nice caveat around it that can utilise something like service workers that stay in between your web app and the server. 🌐

This allows PWA to have something that normal web sites won't provide - ability to work offline. πŸ’Ž

You can easily try telegram, instagram, facebook as web apps and pin them to your mobile home page. 🏠

So in short, it will provide you the typical app's functionality and will work fine. βœ…

Don't confuse it with responsiveness though.πŸ™…πŸ»β€β™‚οΈ

While it does inteconnect, your Bootstrapped web site will not be considered as PWA just because it adapts to your user's screen. It will simply be a responsive site.🀞🏻

There is only 1 problem with this :
Since it is not an app, it is hard to get to phone's functionality like Bluetooth, Flashlight etc. 🀯


https://t.me/pgimg/165

[ Read More ] : kutt.it/pwa

γ€°γ€°γ€°γ€°γ€°γ€°
#PWA
@ProgrammingTip
Using Random on the production may put you in a trouble❗️


What is a random number❓

Well, even if you have never read any definition, you can still answer that question pretty easy. πŸ€·πŸ»β€β™‚οΈ

It’s the unpredictable result of some action like throwing a dice. 🎲

We just can’t predict what the next number will be. ❌

In a real world, randomness is kind of natural thing, but it starts to be more complicated when it comes to machines. πŸ’»

Why❓Simply because of their deterministic characteristic which makes it really hard to generate random numbers (but it’s still possible). βœ…

That’s why in most of the time we use the pseudorandom numbers – they look like a random but they are the result of some mathematical algorithms.⚑️

Are they used in generator offered in C#❓
Let’s find out. πŸ€“


https://t.me/pgimg/166

[ Article ] : kutt.it/rnd

γ€°γ€°γ€°γ€°γ€°γ€°
#CSharp #Random
@ProgrammingTip
Bulma πŸ€

Bulma is a modern CSS framework based on Flexbox. ✨

Bulma is a CSS framework. As such, the sole output is a single CSS file: bulma.css πŸ’Ž

You can either use that file, "out of the box", or download the Sass source files to customize the variables. 🌈

There is no JavaScript included. People generally want to use their own JS implementation. ⚑️

Bulma can be considered "environment agnostic": it's just the style layer on top of the logic. πŸŒ€


https://t.me/pgimg/167

[ Website ] : bulma.io
[ Github ] : kutt.it/blgit

γ€°γ€°γ€°γ€°γ€°γ€°
#CSS #Framework
@ProgrammingTip
Framework Design Guidelines, 2nd Edition.pdf
45.3 MB
Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries - 2nd Edition πŸ“•

Author πŸ–Š : Krzysztof Cwalina

γ€°γ€°γ€°γ€°γ€°γ€°
#Book #DotNet #BestPractices
@ProgrammingTip
Span πŸŒ€

C#
gives us great flexibility when it comes to using different kinds of memory. πŸ’Ž

But the majority of the developers use only the managed one. πŸ€·πŸ»β€β™‚οΈ

Use Span to work with ANY kind of memory in a safe and very efficient way. Simplify your APIs and use the full power of unmanaged memory❗️


https://t.me/pgimg/170

[ Article ] : adamsitnik.com/Span

γ€°γ€°γ€°γ€°γ€°γ€°
#CSharp #DotNet
@ProgrammingTip
Branca as an Alternative to JWTβ“πŸ”

Branca is a catchy name for IETF XChaCha20-Poly1305 AEAD message with an additional version number and timestamp.πŸ•’

It is well suited to be used as an authenticated and encrypted API token. πŸ‘₯

Branca specification does not specify the payload format. Among others you can use for example JWT payloads but still have modern encryption and smaller token size provided by Branca. ⚑️

Currently there are implemenations for JavaScript, Elixir, Go and PHP and a command line tool for creating and inspecting tokens. ✨

Heads up❗️JWT itself is the payload part of a larger standard called Javascript Object Signing and Encryption (JOSE). That said the term JWT has become ubiquitous when actually referring JSON Web Signature (JWS) or JSON Web Encryption (JWE). πŸ”‘

Branca is based on Fernet specification. πŸ’Ž

Fernet takes an user provided message, a secret key and the current time and generates an Authenticated Encrypted (AE) token. Authenticated encryption specifies a way to secure a message so that a 3rd party cannot fake it, alter it nor read it. πŸŒ€


https://t.me/pgimg/171

[ Read More ] : kutt.it/branca

γ€°γ€°γ€°γ€°γ€°γ€°
#Branca #Authentication #JWT
@ProgrammingTip
Saving Grandma's Recipes With Xamarin.Forms πŸ‘΅πŸ»

When creating mobile apps, you have to create and maintain the user interface and app logic for both iOS and Android separately πŸ€• : Objective-C/Swift with XCode and Java with Android Studio. 🀯

That can quickly turn into a pain. With Xamarin.Forms, however, the UI and app logic for your app resides in a single codebase and you get to use a single IDE to maintain it all β€” saving time and headaches. βœ…

In this article, take a lap around Xamarin.Forms to see what it can do for you.πŸ’Ž

My grandma makes the best, most fluffiest, go weak-in-your-knees buns that anybody has ever tasted.πŸ˜‹

The problem is, there’s a ton of secret ingredients (and I’m not just talking love) that go into those buns, and those ingredients and directions are all stored in my grandma’s head. πŸ€¦πŸ»β€β™‚οΈ

We all have family recipes like that, and instead of possibly forgetting them, in this article we’re going to create a mobile app for iOS and Android using Xamarin.Forms that will save them for myself and future generations of my family! πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦


https://t.me/pgimg/172

[ Article ] : kutt.it/xam

γ€°γ€°γ€°γ€°γ€°γ€°
#Xamarin #Android #IOS
@ProgrammingTip
What Happened When I Peeked Into My Node_Modules Directory 🀯

The left-pad fiasco shook the JavaScript community to its core when a rouge developer removed a popular module from npm, causing tens of projects to go dark. ❌

While code bloat continues to slow down our websites, drain our batteries, and make β€œnpm install” slow for a few seconds, many developers like myself have decided to carefully audit the dependencies we bring into our projects. πŸŒ€

It’s time we as a community stand up and say enough is enough, this community belongs to all of us, not just a handful of JavaScript developers with great hair. πŸ‘₯

I decided to document my experiences in auditing my projects’ dependencies, and I hope you find the following information useful. βœ…


https://t.me/pgimg/173

[ Article ] : kutt.it/nmo

γ€°γ€°γ€°γ€°γ€°γ€°
#JavaScript #NPM
@ProgrammingTip
Programming Tips πŸ’‘
Photo
Object Thinking.pdf
3.7 MB
Object Thinking πŸ“™

Author
: David West πŸ–‹

Level : Advanced πŸ’Ž

γ€°γ€°γ€°γ€°γ€°γ€°
#Book #DesignPatterns #OOP
@ProgrammingTip
PrimeNG πŸ…°οΈ

PrimeNG
is a collection of rich UI components for Angular. 🌈

All widgets are open source and free to use under MIT License. πŸ’Έ

Features πŸ’Ž :
β€’ 80+ Components
β€’ Open Source
β€’ Productivity
β€’ Themes
β€’ Templates
β€’ Mobile


https://t.me/pgimg/174

[ Website ] : kutt.it/pmng
[ Github ] : kutt.it/pmngi

γ€°γ€°γ€°γ€°γ€°γ€°
#Angular #UIKit
@ProgrammingTip
Crontab Guru ⏱

Cron
format is a simple, yet powerful and flexible way to define time and frequency of various actions. πŸŒ€

This is a quick and simple editor for Cron schedule expressions by Cronitor. ⚑️


https://t.me/pgimg/175

[ Website ] : crontab.guru

γ€°γ€°γ€°γ€°γ€°γ€°
#Cron #Timing
@ProgrammingTip
How DNS works ❓

A fun and colorful explanation of how DNS works.✨

Hey there❗️This comic explains what happens when you type a website address in your browser. 🌐


https://t.me/pgimg/176

[ Website ] : howdns.works

γ€°γ€°γ€°γ€°γ€°γ€°
#DNS #Comic
@ProgrammingTip
Framevuerk ✨

Fast, Responsive, Without Dependencies, Both Direction Support and Configurable UI Framework based on Vue.js. πŸ’Ž

Features ⚑️ :
β€’ Configurable
β€’ No Dependency
β€’ Multi Direction
β€’ Responsive
β€’ SSR Ready
β€’ Fast


https://t.me/pgimg/177

[ Website ] : framevuerk.com
[ Github ] : kutt.it/frvuerk

γ€°γ€°γ€°γ€°γ€°γ€°
#Vue #UI #Framework
@ProgrammingTip
Objects Should Be Immutable 🀫

In object-oriented programming, an object is immutable if its state can’t be modified after it is created. 🀞🏻

In Java/C#, a good example of an immutable object is String.βœ…
Once created, we can’t modify its state. We can request that it creates new strings, but its own state will never change. ❌

However, there are not so many immutable classes in JDK. Take, for example, class Date. It is possible to modify its state using setTime(). πŸ•’

This is an incomplete list of arguments in favor of immutability ⚑️:

β€’
Immutable objects are simpler to construct, test, and use
β€’
Truly immutable objects are always thread-safe
β€’
They help to avoid temporal coupling
β€’
Their usage is side-effect free (no defensive copies)
β€’ Identity mutability problem is avoided
β€’ They always have failure atomicity
β€’
They are much easier to cache
β€’ T
hey prevent NULL references, which are bad

Let’s discuss the most important arguments one by one. πŸŒ€


https://t.me/pgimg/178

[ Article ] : kutt.it/immtb

γ€°γ€°γ€°γ€°γ€°γ€°
#BestPractices #DesignPatterns
@ProgrammingTip
Pose πŸ‘₯

Replace any .NET method (including static and non-virtual) with a delegate. πŸ’Ž

It is similar to Microsoft Fakes but unlike it Pose is implemented entirely in managed code (Reflection Emit API).✨

Everything occurs at runtime and in-memory, no unmanaged Profiling APIs and no file system pollution with re-written assemblies.⚑️


Example Usage πŸ”₯:

Shim static property getter
⏱:

Shim dateTimeShim = Shim.Replace(() => DateTime.Now).With(() => new DateTime(2004, 4, 4));


Usage πŸ‘Ύ:

// This block executes immediately
PoseContext.Isolate(() =>
{
// All code that executes within this block
// is isolated and shimmed methods are replaced

// Outputs "4/4/04 12:00:00 AM"
Console.WriteLine(DateTime.Now);
}, dateTimeShim);


https://t.me/pgimg/179

[ Github ] : github.com/tonerdo/pose

γ€°γ€°γ€°γ€°γ€°γ€°
#CSharp #DotNet #Fake
@ProgrammingTip
Clean Architecture with ASP.NET Core 2.1 πŸ¦‹

The explosive growth of web frameworks and the demands of users have changed the approach to building web applications. 🌐

Many challenges exist, and getting started can be a daunting prospect. Let's change that now. βœ…

This talk provides practical guidance and recommendations. πŸ’Ž

This video will cover architecture, technologies, tools, and frameworks. We will examine strategies for organizing your projects, folders and files. ⚑️

We will design a system that is simple to build and maintain - all the way from development to production. You leave this talk inspired and prepared to take your enterprise application development to the next level. πŸ”₯


https://t.me/pgimg/180

[ Video ] : kutt.it/cav
[ Source Code ] : kutt.it/cag

γ€°γ€°γ€°γ€°γ€°γ€°
#AspNet #Core #CleanCode
@ProgrammingTip