# Do's and Don'ts when developing First Project with Ignition?

**URL:** <https://forum.inductiveautomation.com/t/dos-and-donts-when-developing-first-project-with-ignition/93592>\
**Category:** General Discussion\
**Created:** [July 23, 2024, 8:55am UTC](https://forum.inductiveautomation.com/t/dos-and-donts-when-developing-first-project-with-ignition/93592 "2024-07-23T08:55:09Z")\
**Posts on this page:** 1\
**Showing post:** 33

<div class="post-metadata">

**Author:** ![Julian\_Islic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/julian_islic/32/57055_2.png) [@Julian\_Islic](https://forum.inductiveautomation.com/u/Julian_Islic)\
**Post date:** [September 12, 2024, 3:28pm UTC](https://forum.inductiveautomation.com/t/dos-and-donts-when-developing-first-project-with-ignition/93592/33 "2024-09-12T15:28:34Z")

</div>

Add Doc Strings for all your functions and classes.

```python
def func1(parms):
     """
          Helpful descriptions to help others understand your code.
          Note: will show up in autofill details, so keep it concise.
     """
     return parms

```

This well help your fellow devs re-use your code and save them time figuring out your function.

You can also print out these doc strings like this:

```python
print func1. __doc__

```

Also, you can use dir() to find out what members a function/class have.  
This can help you understand what tools you have available to you and also discover new things/features you never knew.

You can use dir() and doc strings in conjunction in the script console to learn about libraries/scripts without needing to go look up the documentation online.  
For example:

```python
# New unknown script package I have never used before
import json

# Find out all members in this package
for item in dir(json):
	print item

```

Output

```python
JSONDecoder
JSONEncoder
__all__
 __author__
 __builtins__
 __doc__
 __file__
 __name__
 __package__
 __path__
 __version__
_default_decoder
_default_encoder
decoder
dump
dumps
encoder
load
loads
scanner
>>> 

```

From here you can print out the doc string to get some info on this function!

```python
print json.dump. __doc__

```

```python
"""
Serialize ``obj`` as a JSON formatted stream to ``fp`` (a
    ``.write()``-supporting file-like object).

    If ``skipkeys`` is true then ``dict`` keys that are not basic types
    (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``)
    will be skipped instead of raising a ``TypeError``.

    If ``ensure_ascii`` is true (the default), all non-ASCII characters in the
    output are escaped with ``\uXXXX`` sequences, and the result is a ``str``
    instance consisting of ASCII characters only. If ``ensure_ascii`` is
    ``False``, some chunks written to ``fp`` may be ``unicode`` instances.
    This usually happens because the input contains unicode strings or the
    ``encoding`` parameter is used. Unless ``fp.write()`` explicitly
    understands ``unicode`` (as in ``codecs.getwriter``) this is likely to
    cause an error.

    If ``check_circular`` is false, then the circular reference check
    for container types will be skipped and a circular reference will
    result in an ``OverflowError`` (or worse).

    If ``allow_nan`` is false, then it will be a ``ValueError`` to
    serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``)
    in strict compliance of the JSON specification, instead of using the
    JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``).

    If ``indent`` is a non-negative integer, then JSON array elements and
    object members will be pretty-printed with that indent level. An indent
    level of 0 will only insert newlines. ``None`` is the most compact
    representation. Since the default item separator is ``', '``, the
    output might include trailing whitespace when ``indent`` is specified.
    You can use ``separators=(',', ': ')`` to avoid this.

    If ``separators`` is an ``(item_separator, dict_separator)`` tuple
    then it will be used instead of the default ``(', ', ': ')`` separators.
    ``(',', ':')`` is the most compact JSON representation.

    ``encoding`` is the character encoding for str instances, default is UTF-8.

    ``default(obj)`` is a function that should return a serializable version
    of obj or raise TypeError. The default simply raises TypeError.

    If *sort_keys* is ``True`` (default: ``False``), then the output of
    dictionaries will be sorted by key.

    To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
    ``.default()`` method to serialize additional types), specify it with
    the ``cls`` kwarg; otherwise ``JSONEncoder`` is used.
"""

```

As you can see, no googling required, but now I know exactly what it going on in this function.

---

_[View the full topic](https://forum.inductiveautomation.com/t/dos-and-donts-when-developing-first-project-with-ignition/93592)._
