This document discusses the importance of comments in code. It provides reasons to include comments such as explaining unintuitive code, documenting what the code is doing, and documenting why certain approaches were taken. It also discusses what makes a good comment, including commenting on processing, APIs, changes, tags, and keywords like TODO, FIXME, and XXX. Bad commenting practices like redundant comments are also covered. The document recommends commenting code for other programmers and notes comments are also important for documentation standards like JavaDoc and PHPDoc.
This presentation is prepared for SVCC 2014 on Javascript Testing with Jasmine. It basically goes through basic Jasmine feature and provide tips for developers when they decide to start testing.
This presentation is prepared for SVCC 2014 on Javascript Testing with Jasmine. It basically goes through basic Jasmine feature and provide tips for developers when they decide to start testing.
Preparing for the next PHP version (5.6)Damien Seguy
With versions stretching from 5.3 to 5.6, PHP has several major published versions, that require special attention when migrating. Beyond checking for compilation, the code must be reviewed to avoid pitfalls like obsoletes functions, new features, change in default parameters or behavior. We'll set up a checklist of such traps, and ways to find them in the code and be reading for PHP 5.6.
Preparing for the next PHP version (5.6)Damien Seguy
With versions stretching from 5.3 to 5.6, PHP has several major published versions, that require special attention when migrating. Beyond checking for compilation, the code must be reviewed to avoid pitfalls like obsoletes functions, new features, change in default parameters or behavior. We'll set up a checklist of such traps, and ways to find them in the code and be reading for PHP 5.6.
JCConf 2022 - New Features in Java 18 & 19Joseph Kuo
Java 18 and 19 are released in 2022, including Simple Web Server, Code Snippet in JavaDoc, Vector API, Foreign Function & Memory API, Pattern Matching for switch, Record Patterns and Virtual Threads. Although some of them are still in the preview or incubator stage, we still need to keep learning about the knowledge. They not only improve performance of Java applications, but also introduce new syntax and API to ease our effort to write more readable and efficient code. This session is to introduce these new features and their intentions.
https://cyberjos.blog/java/seminar/jcconf-2022-new-features-in-java-18-19/
Given at TechMaine's Java Users Group on Feb 26 2008
Why do we need another build tool when we already have Ant? By focusing on convention over configuration, Maven allows you to declaratively define how your project is built, which reduces a lot of the procedural code that you'd need to implement in every build file if you were using Ant. This, along with Maven's built-in management of repositories for project dependencies, allows you to streamline your build process. Ultimately Maven can reduce the amount of time that would otherwise be wasted hunting down jar files and fiddling with boilerplate build scripts.
This presentation covers Maven's core concepts. It introduces the Plugin architecture, and explain how the most popular plugins are used. It also covers the POM concept and how it relates to dependency tracking and repositories.
Ant is a Java library and command-line tool. Ant's mission is to drive processes described in build files as targets and extension points dependent upon each other. The main known usage of Ant is the build of Java applications. Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications. Ant can also be used effectively to build non Java applications, for instance C or C++ applications. More generally, Ant can be used to pilot any type of process which can be described in terms of targets and tasks.
Ant is written in Java. Users of Ant can develop their own "antlibs" containing Ant tasks and types, and are offered a large number of ready-made commercial or open-source "antlibs".
Ant is extremely flexible and does not impose coding conventions or directory layouts to the Java projects which adopt it as a build tool.
Software development projects looking for a solution combining build tool and dependency management can use Ant in combination with Ivy.
A subject named "Internet Technology and its Applications" subject's introduction taught as part of B.E.IV (Computer), 8th semester students, VNSGU, Surat, Gujarat State, India.
ASTs are an incredibly powerful tool for understanding and manipulating JavaScript. We'll explore this topic by looking at examples from ESLint, a pluggable static analysis tool, and Browserify, a client-side module bundler. Through these examples we'll see how ASTs can be great for analyzing and even for modifying your JavaScript. This talk should be interesting to anyone that regularly builds apps in JavaScript either on the client-side or on the server-side.
2. Programs must be written for people
to read, and for machines to
execute.
3. Why Comment
- They are part of programming
Python - #, C# - // /** */, Lisp - ;;
- Helps explain what unintuitive part of code is
doing.
- Code tells you what, comments tells why.
4. ??
public class FriendlyApp {
public static void main(String[] args) {
String name = "";
if (args.length > 0) {
name = args[0];
}
/* print hello on the screen. */
System.out.println("Hello " + name);
}
}
5. When to
- When doing processing
- API Documentation
- To Track Changes
- To Tag
6. This is better
/* sort the bucket in ascending order. */
while (true) {
while ((bucket[++leftPtr] < bucket[pivot]));
while ((bucket[--rightPtr] > bucket[pivot])
&& (rightPtr > leftPtr));
if (leftPtr < rightPtr) {
/* swap pair found. */
swap(bucket, leftPtr, rightPtr);
} else {
/* no more swap pairs. partition complete. */
swap(bucket, leftPtr, pivot);
break;
}...
9. Bad Comments
/* This code will get the anagrams of "word".
* To find the anagrams of the word, we have to convert it to lowercase and get rid of
* all trailing whitespaces - this is the format in which we use to store the words
* in the dictionary. We also need to sort
* the characters of the word because we use the sorted characters as a key for the
* anagrams set (All anagrams of a word and the word appear the same when the
* characters have been sorted.) We also
* remove the word from the anagrams set because we do not want it being returned
* with the set as an anagram of itself.
*/
public Set getAnagrams(String word) {
}
10. Commented Code
public static void main(String[] args) throws IOException
{
// while (c != -1) {
// System.out.print((char) c);
// c = in.read();
// }
System.out.println(“Tech Talks”);
}