Programming Tips πŸ’‘
51.6K 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
Write Code As If You Had to Support It for the Rest of Your Life. πŸ‘Ύ

#CleanCode
@ProgrammingTip
Learn the most important libraries for your use cases. πŸ“š

The more libraries you’re aware of, the less likely you are to try reinventing the wheel. βš™οΈ

#Libraries
@ProgrammingTip
#Fun Seeking Answer
Eval πŸ‘Ύ

if you know about the dot notation, but are ignorant of the subscript notation, you might write:

eval("myValue = myObject." + myKey + ";"); 


γ€° instead of :

myvalue = myObject[myKey]; 


The eval form is much harder to read.
This form will be significantly slower because it needs to run the compiler just to execute a trivial assignment statement ❗️

#Tips #JavaScript
@ProgrammingTip
What is Unit Test ❓

A unit test is a piece of a code (usually a method) that invokes another piece of code and checks the correctness of some assumptions afterward. βœ…

If the assumptions turn out to be wrong, the unit test has failed. ❌

A unit is a method or function.

#UnitTest
@ProgrammingTip
Properties of a good unit test βœ…

A unit test should have the following properties :

1️⃣ It should be automated and repeatable.

2️⃣ It should be easy to implement.

3️⃣ It should be relevant tomorrow.

4️⃣ Anyone should be able to run it at the push of a button.

5️⃣ It should run quickly.

6️⃣ It should be consistent in its results.

7️⃣ It should have full control of the unit under test.

8️⃣ It should be fully isolated (runs independently of other tests).

9️⃣ When it fails, it should be easy to detect what was expected and determine how to pinpoint the problem.

#UnitTest #Tips
@ProgrammingTip
The Art of Unit Testing in C#.pdf
13.8 MB
The Art Of Unit Testing in C# πŸ“˜
Author : Roy Osherove πŸ–Š

#Book #UnitTest
Eloquent_JavaScript.pdf
2.7 MB
Eloquent JavaScript πŸ“•
Author : Marijn Haverbeke πŸ–Š

#Book #Javascript
Why use isolation frameworks❓

An isolation framework is a set of programmable APIs that makes creating fake objects much simpler, faster, and shorter than hand-coding them. πŸ’¨

#UnitTest #Mock
@ProgrammingTip
The Safe Green Zone βœ…

Locate your integration and unit tests in separate places.

By doing that, you give the developers on your team a safe green test area that contains only unit tests, where they know that they can get the latest code version.

They can run all tests in that namespace or folder, and the tests should all be green.

If some tests in the safe green zone don’t pass ❌ ,
there’s a real problem, not a (false positive) configuration problem in the test.

#UnitTest
@ProgrammingTip
Tests are part of source control βœ…

The test code you write needs to reside in a source control repository, just like your real production code.πŸ“¦

In fact, you should treat your test code as thoughtfully as you treat your production code. ↔️

It should be part of the branch for each version of the product, and it should be part of the code that developers receive automatically when they get the latest version. πŸ”š

Because unit tests are so connected to the code and API, they should always stay attached to the version of the code they’re testing.

#UnitTest
@ProgrammingTip
Renaming or Refactoring Tests ♻️

An unreadable test is more of a problem than a solution. πŸ‘ŽπŸΏ

It can hinder your code’s readability and your understanding of any problems it finds. ❌

If you encounter a test that has a vague or misleading name or that can be made more maintainable, change the test code. βœ…

#UnitTest
@ProgrammingTip
Unit Tests ⚜️

Tests are stories you tell the next generation of programmers on a project. βœ”οΈ

They allow a developer to see exactly what an application is made of and where it started.

#UnitTest
@ProgrammingTip πŸ’»
Creating ASP.NET Core Project βž• Angular 4, Vue, React ⚜️

1️⃣ First you need to download & install Node.js from here :
https://nodejs.org/en/

2️⃣ Then you need to install Yeoman Generator, run this command in cmd :
npm install -g yo


3️⃣ Then you need to install ASP.NET Core SPA Generator for Yeoman, run this command :
npm install -g yo generator-aspnetcore-spa 


4️⃣ Finally create a new folder ( Project Folder ) and navigate that with cmd and run this command :
yo aspnetcore-spa


After running this command, you can choose which client technology you want to use with ASP.NET Core like Angular, Vue, React, Aurelia & ...

#aspnet #core #angular
@ProgrammingTip
The compiler doesn't care whether the code is ugly or clean. πŸ€·πŸ»β€β™‚οΈ

But when we change the system, there is a human involved, and humans do care. πŸ™‹πŸ»β€β™‚οΈ

#CleanCode
@ProgrammingTip
Use Strings carefully ⚠️

If two Strings are concatenated using β€œ+” operator in a β€œfor” loop, then it creates a new String Object, every time.

This causes wastage of Memory and increases Performance time.

Also, while instantiating a String Object, constructors should be avoided and instantiation should happen directly. For example:

//Slower Instantiation ❌
String bad = new String("string object");

//Faster Instantiation βœ…
String good = "string object";


#memory #java #string
@ProgrammingTip
Avoiding Memory Leaks By Simple Tricks βœ…

Memory Leaks often cause performance degradation of software. Since, Java manages memory automatically, the developers do not have much control.

But there are still some standard practices which can be used to protect from memory leakages. πŸ™†πŸ»β€β™‚οΈ

1️⃣ - Always release database connections when querying is complete.

2️⃣ - Try to use Finally block as often possible.

3️⃣ - Release instances stored in Static Tables.

#java #memory #performance
@programmingTip
Bootstrap Studio πŸ…±οΈ

A powerful desktop app for creating responsive websites using the Bootstrap framework.

https://bootstrapstudio.io/

#Bootstrap
@ProgrammingTip
Bootstrap Studio 2.2.4 Professional Edition.exe
47.5 MB
Bootstrap Studio Version 2.2.4 Professional Edition πŸ“¦
Media is too big
VIEW IN TELEGRAM
Creating a Responsive website using Boostrap Studio Tutorial ⚜️