0% found this document useful (0 votes)
59 views3 pages

Essential Coding Tips for C#, Java, HTML

Tips on coding in C#, Java, and HTML are provided. For C#, recommendations include writing unit tests for non-public methods, using tuples to return multiple values from methods, using yield instead of temporary collections, and annotating deprecated features. For Java, tips include mastering basics, implementing rather than just reading code, understanding algorithms on paper, and avoiding unnecessary objects. For HTML, suggestions involve customizing colors, adding metadata, hiding fields, and using horizontal lines and input suggestions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views3 pages

Essential Coding Tips for C#, Java, HTML

Tips on coding in C#, Java, and HTML are provided. For C#, recommendations include writing unit tests for non-public methods, using tuples to return multiple values from methods, using yield instead of temporary collections, and annotating deprecated features. For Java, tips include mastering basics, implementing rather than just reading code, understanding algorithms on paper, and avoiding unnecessary objects. For HTML, suggestions involve customizing colors, adding metadata, hiding fields, and using horizontal lines and input suggestions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Tips on Coding in C#, Java and HTML.

1.) Tips on Coding in C#.

a. Write Unit Test for Non-Public Methods.


Many developers do not write unit test methods for non-public assemblies. This is because they
are invisible to the test project.

b. Tuples.
Many developers build a POCO class in order to return multiple values from a method. Tuples
are initiated in .NET Framework 4.0. They can be used effectively

c. Do not bother with temporary collections, Use yield instead.


A temporary list that holds salvaged and returned items may be created when developers want
to pick items from a collection.

d. Making a retirement announcement.


Developers who own re-distributable components and probably want to detract a method in
the near future, can embellish it with the outdated feature to connect it with the clients.

e. Deferred execution while writing LINQ queries.


When a LINQ query is written in .NET, it can only perform the query when the LINQ result is
approached. The occurrence of LINQ is known as deferred execution.

2.) Tips on Coding in JAVA.

a. Get the basics right.


As Java offers so many features and options to the developers, people are sometimes lured into
learning too many things in too little time. As a result of this, they get ‘bits and pieces’ knowledge
of a few options that Java offers, but their basics hang on a loose thread.

b. Don’t just read.


Well, if your sole purpose of learning Java is to clear the exam you have the next day, go ahead
and mug up all the things that you can and you might just get the passing marks. However; if you
are really serious about learning Java and getting better at it, the best way to do it is not by
reading, but by implementing

c. Understand your code and algorithm.


Even if you are writing a simple code having a ‘if else’ statement, as a beginner, start by realizing
the code on a piece of paper. The algorithm and the whole compiler process will look so meaningful
once you understand the idea behind the code.

d. Avoid Creating useless objects


When you create an object in Java, you use up memory and processor speed from the system.
Since object creation is incomplete without allocating memory to it, it is better to keep the object
requirements under check and not create unwanted objects in the code.
3.) Tips on Coding in HTML.

a. Allow visitors to change background or text color.


A little extra bit of code will allow your visitors to choose their own text and background color.
It's impossible for you to please everyone with your color choices, so using this trick will be an
excellent case of pleasing all of the people, all of the time.

b. Add MetaData
Be seen on Google's searches and other search engine searches by making sure that you have
provided meta data about your website. In fact, it is no longer an option, but essential if you want
to stay neck on neck with your competition.

c. Hide Field
This form is an example of amateurish programming, and you don't want such an oversight on
your website. HTML gives you the option to hide fields. The visitor can't type anything into a hidden
field, and when the visitor submits the form, the form carries the hidden field.

d. Add a horizontal line.


A horizontal line to break up long sections of your website will make the page easier on the eye.
To add the line, use the <hr/> tag

e. Input suggestions.
You can make it easier for visitors to find what they're looking for by bringing up a list of
suggestions when they're typing input values.

Source:
C# - https://www.freelancer.com/community/articles/top-16-c-programming-tips-
tricks
JAVA -https://blog.stoneriverelearning.com/10-java-coding-tips-every-programmer-
should-know/
HTML - https://www.freelancer.com/community/articles/13-cool-tricks-for-html

You might also like