COMP1850 Lecture 5.2 - Programming Tasks and Coding Guidelines

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/11

flashcard set

Earn XP

Description and Tags

Flashcards for Week 5 Session 2 lecture on Programming Tasks and Coding Guidelines.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

12 Terms

1
New cards

argc

An int representing the number of arguments passed to a C program from the command line.

2
New cards

argv

An array of strings containing the arguments passed to a C program from the command line.

3
New cards

atoi()

A function from used to convert a string to an integer.

4
New cards

atof()

A function from used to convert a string to a double.

5
New cards

Coding Style Guidelines

General recommendations for producing well-written and correctly functioning code, including comments, naming, brackets, indentation, whitespace, and consistency.

6
New cards

Comments in C (/* … */)

Used for detailed explanations, generally at the top of a block of code or function.

7
New cards

Comments in C (//)

Used inline for explanation of a specific operation.

8
New cards

Comments in Python (#)

Used inline for explanation of a specific operation.

9
New cards

Python docstrings

Allow embedding documentation in code for explanation at module, class, and function level, read and returned via the help() function.

10
New cards

Indentation (Recommended)

Using 4 spaces for indentation improves code readability. Python enforces indentation. C relies on the developer.

11
New cards

Whitespace

Using spaces and clear lines to improve code readability without affecting compilation or interpretation.

12
New cards

Consistency

Adopting a consistent style for comments, brackets, indentation, and spacing significantly improves code readability.