Hacker News new | past | comments | ask | show | jobs | submit login

Tell me you wouldn't want to avoid this boilerplate:

    public class HelloWorld {
        public static void main(String[] args) {
            System.out.println("Hello, World");
        }
    }

and instead write a nice little main macro, so you may just write:

    (main (print "Hello, World!"))
Do that a few times in an application, and instead of 10 million LoC, you can write it in 100,000 LoC. This becomes much more maintainable!

Also, see: Alan Kay "Programming and Scaling" 2011

    http://www.tele-task.de/archive/video/flash/14029/
    https://www.youtube.com/watch?v=gZmcmdsoAXU
    https://www.youtube.com/watch?v=-UOmItPa4iA
    https://www.youtube.com/watch?v=QlPavndhYxQ
    https://www.youtube.com/watch?v=y9xLi0iJg1g

Also have a look at:

    https://groups.google.com/forum/#!msg/comp.lang.lisp/gsQJOGKYUw4/oLLHW0f4Ce4J
    https://groups.google.com/forum/#!msg/comp.programming/FiNIiSm5cJE/JkF5wa6Ke54J



Sure. And then imagine that you have to take over someone else's 100,000 LoC written with their own, unique, macros, some of which may invoke other macros, and interact with them in surprising ways, depending on what's passed into them. Now you have to be able to keep in your head what all those macros do (including to each other) while you're trying to read those 100,000 LoC.

At that point, you may not find the macros to be so much of an improvement on the boilerplate...


This. I used to do all my programming in clojure. Now I am going back to python -- because I am not able to figure out a month after writing some code, what these deep recursive, reduce, apply things do.. But it is a good exercise writing it.


Imagine you have to take over someone else's 1,000,000 LoC written with their own, unique, classes and methods, some of which may invoke other methods, and interact with instance variables in surprising ways, depending on which method gets called first. Now you have to be able to keep in your head the flow of data (because the methods need not explicitly pass instance variables around) while you're trying to read those 1,000,000 verbose LoC.

At that point, you may not find Objects (aka copyable global scopes where instance variables are globally available to all instance methods of a class) to be so much of an improvement over symbolic computation.

Honestly, what you said never happens in practice (no one is abusing macros like that) but what I said is literally taught by Sandi Metz in her book Practical OOP in Ruby.

Your (common) reaction is just your everyday fear of the unknown. Try it.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: