Hacker News Comments on
Programming and Scaling: Part 1 of 4 - (2011)
da009999
·
Youtube
·
2
HN comments
- This course is unranked · view top recommended courses
Hacker News Stories and Comments
All the comments and stories posted to Hacker News that reference this video.Tell me you wouldn't want to avoid this boilerplate:and instead write a nice little main macro, so you may just write:public class HelloWorld { public static void main(String[] args) { System.out.println("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!(main (print "Hello, World!"))
Also, see: Alan Kay "Programming and Scaling" 2011
Also have a look at: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
https://groups.google.com/forum/#!msg/comp.lang.lisp/gsQJOGKYUw4/oLLHW0f4Ce4J https://groups.google.com/forum/#!msg/comp.programming/FiNIiSm5cJE/JkF5wa6Ke54J
⬐ AnimalMuppetSure. 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...
⬐ innguestImagine 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.
⬐ thro1237This. 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.⬐ thro1237This. 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.
That's a good question, and nowadays, it feels indeed quite hard to find such programs, when applications with multi-decamegabyte-sized sources abound.Furthermore, in general, in practice things get very bad when you have to add input validation, error handling and other special cases.
See http://www.gigamonkeys.com/code-reading/
I guess recent examples of lean and elegant programs could be found in the works of Alan Kay and his team:
http://www.tele-task.de/archive/video/flash/14029/
or
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
In general, where you have more abstraction, you will find more elegance and leaner code.
As a microscopic example, check https://news.ycombinator.com/item?id=9211609
is elegant and lean.def hamming(a,b) return sum(x!=y for x,y in map(None,a,b))
Other implementations involving lower level details, such as computing the length of the vectors and indexing individual slots explicitely, and taking ten times more lines of codes, are clearly not more elegant and definitely not leaner.
Factored over a whole application, this kind of differences grow to an unmanageable hundrend megabytes source monster that is unmanageable by anybody, or a lean and elegant hundred kilobytes source that you can read and start to understand in a week end. Much more maintainable.