cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Coded humor

Lukas_Weigelt
Active Contributor
0 Likes
14,290

Found this sarcastic bit of coding while debuggin today, made my day:

CL_WDR_CLIENT_ABSTRACT_HTTP
HANDLE_REQUEST

cl_wdr_client_ssr=>todo_cleanup( 'Evil hack because of missing support in RR_APPLICATION' )."#EC NOTEXT

method TODO_CLEANUP.
  " REASON
  if 1 = 1.
  endif.
endmethod.

There must be more of this kind. Contribute! For the good of the world!

cheers, Lukas

View Entire Topic
SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes

This is the one which caught my eye today

CL_ABAP_ZIP=>CRC32( ).

* Do the calculations by hand. This is going to be slow. This is going to be a pain.
* What is a man to do?

  CONSTANTS: magic_nr(4)  TYPE x VALUE 'EDB88320',
             mFFFFFFFF(4) TYPE x VALUE 'FFFFFFFF',
             m7FFFFFFF(4) TYPE x VALUE '7FFFFFFF',
             m00FFFFFF(4) TYPE x VALUE '00FFFFFF',
             m000000FF(4) TYPE x VALUE '000000FF',
             m000000(3)   TYPE x VALUE '000000'.

  IF XSTRLEN( crc32_map ) = 0.
    DO 256 TIMES.
      DATA: c(4) TYPE x, low_bit(4) TYPE x.
      c = sy-index - 1.
      DO 8 TIMES.
        low_bit = '00000001'. low_bit = c BIT-AND low_bit.   " c  & 1
        c = c DIV 2. c = c BIT-AND m7FFFFFFF. " c >> 1 (top is zero, but in ABAP signed!)
        IF low_bit IS NOT INITIAL.
          c = c BIT-XOR magic_nr.
        ENDIF.
      ENDDO.
      CONCATENATE crc32_map c INTO crc32_map IN BYTE MODE.
    ENDDO.
  ENDIF.

Cheers,

Suhas