Skip to Content
author's profile photo

Back from TechEd Barcelona

Some good hands on sessions, which was nice, but a repeating theme made me sad...

Everywhere in ABAP examples was the use of Hungarian notation. Even the Modern ABAP presentation. Although to be fair, concerning that, I spoke to the presenters afterwards. They were suitably embarrassed, and kindly agreed to do some variable renaming before republishing the documents for the session.

The most egregious crime was the use of lv_ in an auxiliary variable in a table comprehension... I know who the guilty party is, and he should know better...

* Please Login or Register to Comment on or Follow discussions.

15 Comments

  • Oct 11, 2019 at 12:14 PM

    Hi Matthew,

    can't be that bad if it made me read up on Hungarian notation on wikipedia. were they still using multiple German keyboards, though?

    cheers, greg

  • Oct 11, 2019 at 12:44 PM

    Still? OMG, time the sapmentors do their job ;-)

    If I'll be back to SAPTeched sometimes in the future I don't want to see it anymore.

    • Oct 11, 2019 at 01:30 PM

      One of the hands-on was migration to s4hana, using the new migration tools. Which are built upon LSMW... which generates function modules with FORMs.

      I'm just waiting for some Hana SQLScript, where a variable in a stored procedured will be prefixed... :-o

  • Oct 11, 2019 at 07:43 PM

    Many years ago when there was a wave of blogs on this I made a comment that I didn't care much one way or the other. Well, fast forward to current times and I have to say I dislike Hungarian notation very, very much. Dropping it was a truly liberating experience.

    I was very disappointed to find ls_ and lv_ stuff still recommended by the ABAP guidelines in certain organization. However, since those guidelines have not been updated in a few years, I'll be making a case for a revision promptly.

    • Oct 13, 2019 at 05:39 PM

      Liberating - exactly. I used to argue for Hungarian notation, not noticing my hypocrisy since I didn't use it when programming in other languages, such as Java. Then I tried ABAP without HN... never looked back.

  • Oct 14, 2019 at 07:25 AM

    For me personally the saddest moment was that 2 hands-on workshops failed because they didn't scale their infrastructure enough for the amount of people that were participating. Being Jenkins failing because of too many requests at once and the server in Frankfurt going down.

    Otherwise it was a great first experience for me at Teched.

  • Oct 17, 2019 at 05:43 AM

    Honestly I am using the Hungarian notation, but now with clean code it does not take sens anymore.

    I am waiting the CamelCase notation to stop using it (and stop also using the terrible _ )

    • Oct 17, 2019 at 06:00 AM

      Just another comment

      If you follow this tutorial Here, you see Eclipse propose some templates for example to create a local class, But you have to type "lcl". Without the help of Hungarian, how can we identify the templace for local class ?

      • Oct 18, 2019 at 06:44 AM

        When I started using local classes, I did use lcl_ prefix. But then I stopped as it seemed pointless. However, since learning TDD, I'm back to using it. I find it helpful in the outline to know immediately if a class is a productive part of the program (lcl_) and test class (ltc_) or a test double (ltd_).

        Since its only used in declaration, I find the above utility more valuable than the increase in readability.

        I supposed it could be replaced with

        • No prefix
        • test_<descripition>
        • test_double_<description>

        Hungarian notation for variables in my view reduces the quality of the code by 0.01%. I.e. if everything else is ok, it's not a big deal. But why not strive for perfection! :-)

    • Oct 28, 2019 at 05:28 PM

      I think no one realistically expects to achieve 100% prefix-free ABAP (at least outside of Cloud version, that's a different story). In some cases, prefixes can be beneficial. For example, someone showed that using C_ for constants allows to use the code assist more efficiently: just type C_ and then wait for the list of constants to appear. And I prefix types, for example, because I want to keep the prefix-less descriptive words for the actual data elements.

      But using stuff like LV_ and LS_ is just unproductive and annoying. It impairs readability and maintainability. E.g. what if LS_ needs to be changed from structure to a field symbol? Now we have to rename it everywhere. And when prefix is wrong that's even worse.

      I'm with DSAG Guidelines on this: some prefixes are OK but mostly they're just code pollution.

      • Oct 29, 2019 at 05:15 AM

        Exactly, time to recapitulate my (4 years old, oh the horror...) case for HN:

        Lv_material_number is so unnecessary when it could've been just l_material_number.. :)

        @Matthew Billingham:

        «I supposed it could be replaced with

        • No prefix
        • test_<descripition>
        • test_double_<description>»

        Which is just the starting point of a Reeeealy Long Prefixes convention, - no..? ;)

        • Oct 29, 2019 at 06:39 AM

          For test class I just used the LTC_ .. for Local_Test_Class

          but I also need specific word for specific class:

          ZCL_..._MOCK for mock class

          ZCL_...._FACTORY for factory

          ...

          (I did not decide the ZCL_ it is historical)

          I don't know if it is a good practice to identify the class by the Design Pattern used.

          And something important with clean code and the huge quantity of class we could create, I create a lot of packages. It help me a lot to classify all these class and simplify the naming

          But I am agree with Jelena Perfiljeva, the code completion push it the Hungarian notation.

          If I want to find my global class, form the MM modules, about BATCH. Ok so ZCL_MM_BATCH [CTRL+SPACE] and I have the list of the class on this subject.

          • Oct 30, 2019 at 08:03 PM

            Packages is another good point. So many developers are still almost afraid of them or don't even know sub-packages exist. Since I've learned how packages actually work and found that sub-packages were introduced (in 7.02 or so, I think?), life has never been the same. It really helps with organization and even transports, if something goes terribly wrong.

        • Nov 01, 2019 at 03:05 PM

          No, it's limited to a local class (productive), test classes containing test code, and test doubles for mocking/stubs/...

  • Add comment
    10|10000 characters needed characters exceeded