Lars Hvam Petersen
@LarsHvam
Heliconia Labs

Slides: https://larshp.github.io/advent-2020-presentation/

Feel free to use the chat

Will answer questions if time permits

Advent of code?

Example: 2020 Day 01

Find the two entries that sum to 2020

1721, 979, 366, 299, 675, 1456

1721 + 299 = 2020
Puzzle answer is 1721 * 299 = 514579

But why?

  • Practice problem solving
  • Learn a new programming language
  • Practice TDD
  • Optimizing solution performance
  • Make your own twist

My Recommendations

SAP Community

My twist

1. Git


Decentralized version control system, it allows you to:
  • Compare changes over time
  • Rollback files to old version
  • Track who changed what


GitHub
Hosting service for git, free for public projects.
  • Provides graphical web interface
  • Collaboration via Pull Requests

started ~5 years ago ~100000 lines
~4300 commits 7.02 and up
110+ contributors MIT License

abapGit Design Goals

  • Easy installation
  • Easy upgrade
  • Small system footprint
  • Code readable in git repository

Resources

2. Static Analysis

abaplint

lint, or a linter, is a tool that analyzes source code to flag programming errors, bugs, stylistic errors, and suspicious constructs

syntax

rules.abaplint.org

playground.abaplint.org

abaplint - Use Cases

Continuous Integration?

3. Automatic Downport

CLASS lcl_bar DEFINITION.
ENDCLASS.
CLASS lcl_bar IMPLEMENTATION.
ENDCLASS.

FORM foo.
  DATA(lo_moo) = NEW lcl_bar( ).
ENDFORM.
https://rules.abaplint.org/downport/ https://playground.abaplint.org

4. Transpiling

LOOP AT lt_strings INTO lv_string1.
  LOOP AT lt_strings INTO lv_string2.
    IF lv_string1 + lv_string2 = 2020.
      output = lv_string1 * lv_string2.
      output = condense( output ).
      WRITE output.
      RETURN.
    ENDIF.
  ENDLOOP.
ENDLOOP.

for (const unique1 of abap.statements.loop(lt_strings)) {
  lv_string1.set(unique1);
  for (const unique2 of abap.statements.loop(lt_strings)) {
    lv_string2.set(unique2);
    if (abap.compare.eq(abap.operators.add(lv_string1,lv_string2), constant_2020)) {
      output.set(abap.operators.multiply(lv_string1,lv_string2));
      output.set(abap.builtin.condense(output));
      abap.statements.write(output);
      return;
    }
  }
}

5. All Together Now

https://github.com/larshp/abap-advent-2020

Automatic Upport

Future Work

#ABAPisNotDead

https://larshp.github.io/advent-2020-presentation/

@LarsHvam

Creative Commons License

Links

abapgit.org
abaplint.org
dotabap.org

Disclaimer


Open source

Test in sandbox