[Klug-general] Obscure C at saturday's meeting

Thomas Edward Groves teg451013 at freeuk.com
Tue Nov 30 06:34:29 UTC 2010


Actually I've never seen a language that doesn't allow the most horrible spaghetti.
It's just that some languages make it easy.
On the other hand the languages which make it hard to write crap also make it
hard to write stuff that the designers of that language hadn't thought of.
C was designed to let the programmer have all the rope he wanted,
that's why we so often hang ourselves when using it.
It's also why some of us so often return to it too.

And as for code beautifiers: they're the most valuable tool that never gets mentioned
in books on programming that I know of.

Odd that.

Tom
  ----- Original Message ----- 
  From: Peter Childs 
  To: Kent Linux User Group - General Topics 
  Sent: Monday, November 29, 2010 2:46 PM
  Subject: Re: [Klug-general] Obscure C at saturday's meeting





  On 29 November 2010 14:35, David Halliday <david.halliday at gmail.com> wrote:

    There is a reason why C as a language does lean beautifully to code obfuscation. We all know that C was just a joke that has got out of hand, alongside the base of all *nix environments: http://www.asandler.com/jokes/computer/c.shtml


    From The Article:
    We stopped when we got a clean compile on the following syntax:
    for(;P("\n"),R-;P("|"))for(e=C;e-;P("_"+(*u++/8)%2))P("|"+(*u/4)%2);

    To think that modern programmers would try to use a language that allowed such a statement was beyond our comprehension!




  Perl has a reputation for this too.....


  Peter.





    On 29 November 2010 12:53, Dan Attwood <danattwood at gmail.com> wrote:




        And for exactly this reason there has been a policy in places I have worked of running any C code through the C beautifier automatically as part of the version control check-in process.  This has the advantage that coders arbitrarily rearranging the code in their preferred style whilst editing does not look like a change, and that all code retrieved is always in the house style, which makes for easier debugging.


      someone at barcamp was talking about do just this. Although they went one step further where if it fell outside of some rules then they would stop it from compiling and spit it back at the developer 


      _______________________________________________
      Kent mailing list
      Kent at mailman.lug.org.uk
      https://mailman.lug.org.uk/mailman/listinfo/kent




    _______________________________________________
    Kent mailing list
    Kent at mailman.lug.org.uk
    https://mailman.lug.org.uk/mailman/listinfo/kent





------------------------------------------------------------------------------


  _______________________________________________
  Kent mailing list
  Kent at mailman.lug.org.uk
  https://mailman.lug.org.uk/mailman/listinfo/kent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/kent/attachments/20101130/e8cbc35a/attachment-0001.htm>


More information about the Kent mailing list