980
edits
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
== About Me == | |||
Hello, my name is Patrick Callahan. People call me Pat. I have a web page, and you found it. | |||
I' | I've been a programmer since I was a teenager. I'm 74 years old and retired now. | ||
Programming was a fun job. We couldn't believe we got paid to have so much fun. | |||
My current expertise primarily lies in databases, bash scripting, and traditional procedural programming in various languages. | |||
C++ is a work in progress. I took a course in 1993, but never used it professionally. | |||
I like gardening with my wife of 33 years, Ann. We have a daughter who has given us three very active grandchildren, who will visit us next week for four days. Did I say I kept busy? We reside in the state of Massachusetts in the United States. | |||
I hope to make regular code contributions to FlightGear. I want to gain the skills to address some FlightGear issues as they come up and participate in the discussions and programming for the various [FlightGear Epics |https://gitlab.com/groups/flightgear/-/epics?sort=created_date&state=opened&first_page_size=100] | |||
Teamwork: | |||
After they are created, properties are used as needed from Nasal scripts and C++ code, and finally destroyed by a destructor in C++. | I'm a believer in teamwork and would love working closely in real-time with others on specific programming problems. I hope we can create opportunities for that. | ||
== Pair programming ==. | |||
I find pair programming an attractive idea and wonder how it works in practice. What is the result of practicing pair programming with programmers of similar skills? What happens when an expert programmer pairs with an inexperienced one? | |||
I find that most are resistant to participating in pair programming, and I wonder why. | |||
We're taught in academic settings to program by ourselves and hand in ou submissions for review as "homework", but we continue that pattern in our work mainly out of inertia and lack of proper training. There's no reason to continue that pattern outside of a classroom as our only or even as main way of working together. | |||
== Understanding FlightGear's codebase == | |||
The problem with FlightGear is its size, complexity, and the lack of a detailed guide to exploring that complexity. Several factors contribute to that complexity. Understanding FlightGear requires knowledge of many application domains, C++, an internal scripting language, a global data store, application features driven by XML or scripts, network protocols and data formats, some custom, some obscure, and from the era of mainframe computers. | |||
I'll examine each of these complexity realms with a view to providing a guideline for new FlightGear developers, me for instance, a path to follow leading to regular contributions to the FlightGear in C++, Nasal, and XML and other data formats. | |||
== C++ == | |||
First, the application uses C++. As a complex evolving language, C++ has a reputation for complexity. It's not just the language, its the fragmentation of code into small tidbits, widely scattered in individual files covering supposedly just one aspect of what needs to be done. I don't really know if the structure of C++ code as objects is more efficient than a C++ program done using solid structured programming, but I know which is easier think about and to work on. | |||
== Flight Simulation does a lot of different things == | |||
Second, Flight Simulation involves numerous application domains. Among them are aerodynamics, graphics, geography, geodesy, environment, navigation, networks, audio, video, and human languages. FlightGear addresses all of them and more. Each of these domains has their own view of the world, and many of them are modelled as C++ classes. Full understanding comes from knowing the C++ code, The terminolgy of the domain, and the way the code's authors chose to structure things as objects and methods. | |||
== Nasal and the Property Tree= | |||
Next, in addition to the complexity introduced by C++ and the application domains, there's Nasal. Finally, to tie it all together, loosely, the property tree. a global object, with individual data items of a key-value store actually stored in a tree because they are conceptually related. The property tree introduced compexity because items in it are not "owned", they're simply created at some point, in either C++, XML processing or Nasal and used wherever the data item is "needed". Connecting the dots through all the code based on identifying individual properties is not all that easy. | |||
== Where should I start? C++, Nasal or XML) | |||
It's not clear from existing documentation the central role of Nasal scripting and the Property Tree are in the simulation. It's not just C++, Nasal, and the interface between them, understood as computer languages. Knowing the languages and interfaces themselves is vital, but even more important is understanding how scripting is used in FlightGear to create the simulation. If you are struggling as a newcomer to understand FlightGear's C++ code, understanding Nasal's role in driving parts of the simulation and the way it interacts with C++ code is probably one of the first things to do. It's what I'll be doing next. | |||
== FlightGear's DataFlow Diagram == | |||
There isn't one. | |||
Part of understanding any body of code is to be able to identify how data flows through the application. Dataflows are usually represented as arrows of various widths. The arrows are messages flowing between parts of an application. The larger the arrow, the more data items in that data flow. | |||
In FlightGear's C++ code, there are, of course, classes and objects that represent some dataflows. There's a problem, though. Many of the classes are about processing data into ad-hoc structures within the property tree. | |||
There is no C++ class for an Altimeter or a Heading Indicator. Instead, these are represented by a set of properties and data loaded via XML and other formats. The numerical data, stored in the property tree has a path indicating that the properties underneath a node are for the altimeter or the heading indicator. The actual paths in this case are /instrumentation/altimeter and /instrumentation/heading-indicator. Each node in the tree can have properties as child nodes, as well as child nodes that contain additional properties, such as /instrumentation/heading-indicator/gyro. Usually, only the lear nodes of th e tree | |||
Properties are created on the fly, once the property tree's root node is instantiated. Properties are specified in XML data, created by a Nasal script, or by C++ code. The actual property mechanism is implemented in a C++ class. | |||
After they are created, properties are used as needed from Nasal scripts and C++ code, and finally destroyed by a destructor in C++. However, none of that is traceable as a data flow. IDEs are great at connecting elements of code to their definitions and usage, but when we use a data store like the property tree, the connection can't be found by the IDE. These data flows through the property tree mechanisms are a real part of the FlightGear Application, but we have no easy way to visualise them. Any visualization is mentally constructed over time by developers' experiences, as they examine and step through code. | |||
[http://wiki.flightgear.org/User:Callahanp/goals What's up with Pat] | [http://wiki.flightgear.org/User:Callahanp/goals What's up with Pat] |
edits