TGViewer
Channel Public Channel
Programming & AI Tips πŸ’‘

Programming & AI Tips πŸ’‘

@programmingtip

Programming & AI:
Tips πŸ’‘
Articles πŸ“•
AI & LLMs πŸ‘Ύ
Design, Architecture, Principles βœ…

πŸ‡³πŸ‡± Contact: @MoienTajik
Subscribers
46.3K
Photos
67
Videos
11
Links
376

Showing posts older than #247 Β· Back to latest

Older Posts 20 shown
Post #246 1.15K
JUnit β˜‘οΈ

JUnit is a Unit Testing framework for the Java programming language. β˜•οΈ

JUnit has been important in the development of test-driven development, and is one of a family of unit testing frameworks which is collectively known as xUnit that originated with SUnit.

https://ibb.co/f0EFR5

[Website] : http://junit.org/junit5/

γ€°γ€°γ€°γ€°γ€°
#java #junit
@ProgrammingTip
ImgBB junit5 banner hosted at ImgBB Image junit5 banner hosted on ImgBB
Post #237 947
Selectize.js πŸ’Ž

Selectize is the hybrid of a textbox and <select> box.
It's jQuery-based and it's useful for tagging, contact lists, country selectors, and so on.

[ Website ] : http://selectize.github.io/selectize.js/

γ€°γ€°γ€°γ€°γ€°γ€°
#JavaScript #Library
@ProgrammingTip
Post #236 984
Dagger 2

Dagger 2 is a dependency injection (DI) framework. It's based on the javax.inject annotations standard.

[GitHub] : http://bit.ly/2gY3BND

γ€°γ€°γ€°γ€°γ€°γ€°
#Dagger #Java #Android
@ProgrammingTip
Post #234 1.07K
Diffrences Between Abstract & InterfaceπŸ’‘

γ€°γ€°γ€°γ€°γ€°γ€°
#Abstraction #Interface
@ProgrammingTip
Post #233 955
Debug JavaScript with Chrome DevTools 🐞

This tutorial shows you how to debug one specific issue, but the general workflow you learn is helpful for debugging all types of JavaScript bugs.

[ Website ] : http://bit.do/chromedev

γ€°γ€°γ€°γ€°γ€°γ€°
#JavaScript #Debug
@ProgrammingTip
Post #232 978
6 Simple Tips on How to Start Writing Clean Code πŸ‘Ύ

1️⃣ Make code readable for people.

2️⃣ Use meaningful names for variables, functions and methods.

3️⃣ Let every function or method perform only one task.

4️⃣ Use comments for clarification ( if really needed )

5️⃣ Be consistent

6️⃣ Review your code regularly

γ€°γ€°γ€°γ€°γ€°γ€°
#CleanCode
@ProgrammingTip
Post #231 1.1K
No Need for Temporary Collections, Yield Might Help βœ…

Normally when we need to fetch the items from a collection we might create a Temporary List to hold the retrieved items and return. πŸŒ€

Following is the C# code using the temporary list :

public List<int> GetValuesGreaterThan100 
(List<int> masterCollection)
{
List<int> tempResult = new List<int>();
foreach (var value in masterCollection)
{
if (value > 100)
tempResult.Add(value);
}
return tempResult;
}


βž–βž–βž–βž–βž–βž–βž–

To avoid the usage of this temporary collection you could choose to use the yield. πŸ”₯

It will yield the result as and when the result set is enumerated.

Below is the code using the yield keyword :

public IEnumerable<int> GetValuesGreaterThan100(List<int> masterCollection)
{
foreach (var value in masterCollection)
{
if (value > 100)
yield return value;
}
}

γ€°γ€°γ€°γ€°γ€°γ€°
#CSharp #Collections
@ProgrammingTip
Post #225 1.17K
Compare two string by equals() instead == in java πŸ’‘

Use equals() because this method internally checks == plus content equality check. β˜‘οΈ

[ CODE ]
public class Test {

public static void main(String[] args) {
String s1 = "string";
String s2 = "string";
String s3 = new String("string");
String s4 = s3;
String s5 = "str"+"ing";

System.out.println("s1==s2 :"+(s1==s2));
System.out.println("s1==s3 :"+(s1==s3));
System.out.println(
"s1.equals(s3) :"+s1.equals(s3)
);
System.out.println("s3==s4 :"+(s3==s4));
System.out.println(
"s3.equals(s4) :"+s3.equals(s4)
);
System.out.println("s1==s5 :"+(s1==s5));
System.out.println(
"s1.equals(s5) :"+s1.equals(s5)
);
}
}


[ RESULT ]

s1==s2 :true
s1==s3 :false
s1.equals(s3) :true
s3==s4 :true
s3.equals(s4) :true
s1==s5 :true
s1.equals(s5) :true


γ€°γ€°γ€°γ€°γ€°γ€°γ€°γ€°γ€°γ€°

#java
@PorgrammingTip
Post #224 1.06K
You don’t have to memorize everything when it comes to Programming πŸ™…πŸ»β€β™‚οΈ

Good programmers do not waste their time memorizing everything, every documentation, every piece of information.

But they are good at knowing the concepts and reading the documentation, googling and solving problems.

[ Website ] : http://bit.do/DontWasteTime

γ€°γ€°γ€°γ€°γ€°γ€°
#Tips
@ProgrammingTip
Post #223 1.02K
Do I need to dispose of Tasks ⁉️

β€œ Task implements IDisposable and exposes a Dispose method.
Does that mean I should dispose of all of my tasks ? ”


Short answer to this question πŸ™…πŸ»β€β™‚οΈ :
No. Don't bother disposing of your tasks. 


And for those of you looking for a coffee-break read, here’s long answer :

[ Website ] : http://bit.do/DisposeTasks

γ€°γ€°γ€°γ€°γ€°γ€°
#Dotnet #Parallel #Dispose
@ProgrammingTip
Microsoft Do I need to dispose of Tasks? All about Async/Await, System.Threading.Tasks, System.Collections.Concurrent, System.Linq, and more…
Post #222 1.03K
Esprima ✨

Esprima is a high performance, standard-compliant ECMAScript parser written in ECMAScript.

⭕️nline Features :
β€’ Parser
β€’ Syntax Validator
β€’ Regex Collector
β€’ Minify & Obfuscate
β€’ Identifier Highlight
β€’ Rename Refactoring
β€’ AutoComplete

[ Website ] : http://esprima.org/index.html

[ Parser - Produce the syntax tree ] :
http://esprima.org/demo/parse.html

γ€°γ€°γ€°γ€°γ€°γ€°
#JavaScript #ES
@ProgrammingTip
Older posts β†’
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook β†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 β†’