50 likes | 155 Vues
Embark on your programming journey with this beginner-friendly introduction to the basics of programming. Understand how computers work and learn to harness their tremendous power. This guide emphasizes the importance of clear logic, disciplined coding style, and proper documentation. Explore fundamental concepts such as spacing, indentations, and the organization of code. By focusing on writing cleaner and more readable code from the start, you will set a strong foundation for your programming skills while avoiding common pitfalls.
E N D
COMP SCI 1MD3 Introduction to Programming Sanzheng Qiao http://www.cas.mcmaster.ca/~qiao
A long journey begins with a single step • Long journey • Understand how computers work • Utilize computers’ enormous power • First step • Basics of programming
What matters • Logic: Know exactly what your program is supposed to do • Discipline: Consistent style, format • Documentation • Spacing, indentations • Line breaks • Positions of curly braces { }
Why bother? • Who cares what a program looks like if it works? • Doesn’t it take too much time to make it pretty? A well-written code is easier to read and to understand, almost surely has fewer errors. In the rush to get programs out the door to meet some deadline, it’s easy to push style aside, to worry about it later. This can be a costly decision.
Emphasis • Basics of programming, rather than Java specifics. • Writing better code from the beginning and improving it as it evolves. • Principles of programming style, clear, simple, straightforward logic, meaningful names, neat formatting, helpful comments, and consistency.