Extra general Flashcards
When should you use local variables and when should you use global variables
If you feel that a certain variable will take multiple values by passing through various functions then use local variables and pass them in function calls. If you feel that a certain variable you need to use will have constant value, then declare it as a global variable
What is top down design
breaking a problem down
Advantages of top down design
the problem is easier to understand, program, test and maintain.
Shows clearly how different parts of the problem relate to each other
Division of labour - different teams working on different parts of the problem independently
May make code more modular as it broken into smaller subroutines
Disadvantages of top down design
It assumes that the whole solution to the problem is knowable in advance.
Poorly understood programs are hard to decompose.
Not every problem can be broken down in this way, for example event driven programs like GUIs
What are the 4 values of the agile methods
1.Individuals over processes
2.Working software over documents
3.Customer collab
change
Pros of flat file databases
Easy to set up - no knowledge required
Easy to use in code - e.g. CSV files are easy to process
Easy to share, e.g. email attachments
Cons of flat file databases
Duplication of data (data redundancy) which take more time to update eg if Miss Read moves house you have to update her address in multiple rows, can lead to inconsistency eg you forget to update Miss Read’s details in every place they are stored.
Take up more space so more storage is required.
Everyone can see everything (not good if some data is sensitive)
Inefficient – have to have all fields for every record
Can’t perform complex queries as easily
Pros of relational databases
Reduces duplication of data meaning easier to update, accurate, better consistency, less storage space
Can set different access rights for each user for each table
Can index fields for quicker searching
If implemented with DBMS, it will allow concurrent access to the database allowing multiple users
Complex queries can be carried out
Cons of relational databases
More difficult to correctly set up (normalization is the process of structuring the data in a relational database according to formal rules to avoid problems of data redundancy which leads to inconsistency and inaccuracy (incorrect) and inconsistency (between different fields)
Cons of cache
small size and fixed size
Pros of web browser cache
Faster load time, reduced network traffic ie fewer HTTP requests
Cons of web browser cache (cache in general)
Cached resource may be out of date
What does a cache server (proxy server) do?
Cache server (proxy server) saves previously requested web pages or other content.
Pros of caching a proxy server
Faster load time as HTTP request does not have to go original web server, reduces network traffic
When is DNS cache used?
When a DNS server responds to a DNS request, the operating system may store these results in a local DNS cache
Pros of DNS cache?
reduced network traffic ie fewer DNS requests.
Reduced network traffic as there will be fewer DNS requests to remote DNS servers
Cons of DNS cache?
resources may be out of date, if a web page has changed the location of its server an error may occur
Pros of caching in general
Speeds up retrieval
Cache miss normally would not result in error
Cons of caching
Algorithms for caching can be very complicated. When the cache is full, the algorithm must choose which items to discard to make room for the new ones.
Wrong data may be cached then it has to be removed and the correct data loaded.
Cache does not have the required content (cache miss) so time is wasted checking it.
What is a cache hit
dataA “cache hit” occurs when a file is requested from a cache and the cache is able to fulfill that request
What is a cache miss
an event in which a system or application makes a request to retrieve data from a cache, but that specific data is not currently in cache memory
What does atomic mean
Atomic means each item of data is distinct and you can’t separate the data any more or break it up any smaller without losing meaning.
atomicity
The fully or not at all transaction thing
When would you not have to do anything for second normal form
If you don’t have any composite primary keys
Do the normal forms have to be done in order
Yes
What does tcp do
the type of error checking to be used
data compression method, if any
how the sending device will indicate that it has finished sending a message
how the receiving device will indicate that it has received a message
type of encryption used
packet size
UDP
a communications protocol that is primarily used to establish low-latency and loss-tolerating connections between applications on the internet. UDP speeds up transmissions by enabling the transfer of data before an agreement is provided by the receiving party. No error checking which makes it good for gaming and streaming but bad for sending over important documents as if data is lost it cannot be retrieved due to no error checking
What is a standard
standard is a definition or specification that is an agreed way of doing things. Standards make it easier to build software or hardware that will run (is compatible) on different systems (in different countries). Without standards most devices would not be able to communicate with each other.
Two categories of standards
De jure (by force of law) and de facto standards
Dejure
Regulated by official bodies and used across the internet
defacto standards
ones that arise through popular use but are not managed or regulated
Why are standards important
Standards form the fundamental building blocks for product development by establishing consistent protocols that can be universally understood and adopted.
Standards are important in the computer industry because they allow the combination of products from different manufacturers to create a customized system.
What would happen without standards
Without standards, only hardware and software from the same company could be used
Why are protocols important
Set of rules that allow transmission between devices.
Allowing devices to communicate
By ensuring all devices follow the same rules
So they interpret data/signals in the same way