1 / 12

Programming

Programming. Robert Love, Venkat Jayaraman July 22, 2008 SSTP Seminar – Lecture 9. Overview. Presentation Engineering Programs The Puzzle Pieces (of Code) The Puzzle/Big Picture Object Oriented Procedural The Missing Pieces: Debugging and Process Control Visual Interfaces Discussion

Download Presentation

Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programming Robert Love, Venkat Jayaraman July 22, 2008 SSTP Seminar – Lecture 9

  2. Overview • Presentation • Engineering Programs • The Puzzle Pieces (of Code) • The Puzzle/Big Picture • Object Oriented • Procedural • The Missing Pieces: Debugging and Process Control • Visual Interfaces • Discussion • Activity UF Flight Controls Lab

  3. Engineering Programs • Commonly Used Engineering Programming Software • Matlab • C, C++, C# • Java • Fortran, Visual Basic, Excel (old school) • Maple. Mathematica (more for physics and math) • Visual Based Codes • Simulink, Labview, Lego Mindstorms UF Flight Controls Lab

  4. The Pieces: Some Types • Think of a puzzle, putting together pieces • Menus and user inputs • The “if” statement • The “for/do/while” loop • Variables: Matrices vs. Strings • Note: Be careful with Row vs. Columns (specify indices) • Pause, return • Basic Logic: On/off switching, true/false: 1 vs. 0 • Counters • Timers UF Flight Controls Lab

  5. The Pieces: Comprehensible Code • Keep overall structure as organized and efficient as possible! • Comments • Others may use your code, so keep things organized with comment blocks and subsections • Variable Names • Engineers like names with physical meanings • Don’t just label aaa28 if possible! UF Flight Controls Lab

  6. The Pieces: Be Lazy! • Don’t do the same work twice if possible • Save data and figures (often, not always) • Record what you did • Often codes have a “command history” that keeps track for you • Balance time to build automation into the code vs. the times will have to repeat process UF Flight Controls Lab

  7. The Puzzle: Planning • Try to write out basic flow of solution to puzzle (like looking at the box top) • Visual Codes (Labview vs. Simulink) • UML: Anyone can code if designed well • This is more a software engineering tool • Learn to speak other engineer’s language and how to use their tools so you can work with them! • Ignorance is your enemy! • Look at working codes as if you were learning a language, study the vocabulary and grammar UF Flight Controls Lab

  8. The Puzzle: Basic Structure • User Inputs? Final Outputs? Find the flow… • Working Directories • Script vs. function files • Visual Representation: use script to call function files • Try to break small steps into recyclable function files • Inputs and outputs UF Flight Controls Lab

  9. The unit in procedural programming is a function, and unit in object-oriented programming is a class Procedural programming concentrates on creating functions, while object-oriented programming starts from isolating the classes, and then look for the methods inside them. Procedural programming separates the data of the program from the operations that manipulate the data, while object-oriented programming focus on both of them Procedural Programming vs Object Oriented Programming

  10. Trouble Shoot (Debugging) • Syntax vs. Logic errors • Syntax: missing parenthesis or capital letter somewhere… • Logic errors: you dropped out data, you are turning the light on when you wanted to be turning it off • Version Control: Go back in time • Working as a team (on a code) • Ex: Subversion, Allway Sync UF Flight Controls Lab

  11. Make it look pretty… • Graphical User Interfaces (GUI’s) • May obtain input or display output • Some components • Titles, triggers, check boxes, radio boxes, entry boxes, sliders, graphs • Graphing Data • 2D plot, 3D plot, surface plot, grid/mesh plot • Show what is required! UF Flight Controls Lab

  12. Activity • Looking at basic code UF Flight Controls Lab

More Related