"Java" _ Some rules of processing data and some tips and suggestions for software development

Source: Internet
Author: User

Learning Source: Stanford University Open Class programming method Cs106ajava

The code used in the learning process, the first draft of notes (mainly recorded in sequence video tutorial) and the course handout has been uploaded to the Download Center (interested people can download their own learning),

Most programs in the learning process need to import the Acm.jar package (uploaded to the Download Center, you can also go to http://jtf.acm.org/to download),


Rules for handling large data structures:


noun (nouns) correspondence class (classes)
Verb (verbs) correspondence method (methods)
The data must have a unique identifier corresponding to it
Need to select the appropriate collection body
In order to reduce storage space and make data easy to call, the general data only one copy, use the path to point to the required data can be

Example:Write a simple online music store (need to be able to add music (song) and albums (Album), etc.)

According to the data structure rules: (Name correspondence class, verb correspondence method)

Class Song
Name String
Band String
Price double
Unique identifier (name + band)-Unique identifier

Class Album
Name String
Band String
List of songs ArrayList
Add
List (iterator)

arraylist<song> songs = new Arraylist<song> ();
hashmap<string, album> albums = new hashmap<string, album> ();


some tips and suggestions for software development

Debug Program (Debugging):
Design Software-architect (Architect)
Writing code (Coding)--engineer (Engineer)
Test (testing)-the person who destroys another's property (vandal)
Debug program (Debugging)--Detective (detective)--Find out where the error is and fix it

Four parts of software development:
Testing-development-debugging-deployment
The cost of each link is 10 times times that of the former.

Debugging Experience Summary:(The cause of the problem)
1, bad value of the variable
2, there is the wrong logic
3. Unfounded assumptions--units

rules for software debugging:
Most of the problems are simple questions.
The program needs to be systematized
Question your assumptions (many people often assume that a problem may occur when they have problems with the program)
Picky about your code
Don't panic when you're having trouble.

Debugging Method:
PRINTLN: If the wrong value is the problem with your program, add an extra PRINLN statement in the code to find the problem location
Unit test: Test a separate unit (cannot test the entire program in a breath)
Eclipse Debugging methods: Breakpoints


This article from "Not Daze" blog, please make sure to keep this source http://tobeys.blog.51cto.com/10620284/1694041

"Java" _ Some rules of processing data and some tips and suggestions for software development

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.