What is soft coding? (Anti-pattern)

前端 未结 5 1447
无人及你
无人及你 2021-01-04 00:32

I found the Wikipedia entry on the soft coding anti-pattern terse and confusing. So what is soft coding? In what settings is it a bad practice (anti-pattern)? Also, when cou

5条回答
  •  庸人自扰
    2021-01-04 00:51

    Short answer: Going to extremes to avoid Hard Coding and ending up with some monster convoluted abstraction layer to maintain that is worse than if the hard coded values had been there from the start. i.e. over engineering.

    Like:

    SpecialFileClass file = new SpecialFileClass( 200 ); // hard coded
    
    SpecialFileClass file = new SpecialFileClass( DBConfig.Start().GetConnection().LookupValue("MaxBufferSizeOfSpecialFile").GetValue());
    

提交回复
热议问题