Programming Concepts That Were “Automated” By Modern Languages [closed]

Optimizations. For the longest time, it was necessary to do this by hand. Now most compilers can do it infinitely better than any human ever could. Note: This is not to say that hand-optimizations aren’t still done, as pointed out in the comments. I’m merely saying that a number of optimizations that used to be … Read more

Dependency Injection best practices and anti-patterns

I really enjoyed this article regarding DI, as it’s targeted towards people who don’t have a ton of DI experience, or don’t even know what it is. https://mtaulty.com/2009/08/10/m_11554/ What’s Unity? It’s a “dependency injection container”. Now, at that point a bunch of folks reading this will say “Yes, we know and we’re already using it … Read more

What ever happened to Aspect Oriented Programming? [closed]

There has maybe been a lot of hype in the early 2000’s, and what happened is the following: there has been a lot of attempts to create aspect-oriented frameworks, and these attempts have merged into two significant projects in the Java sphere: AspectJ and Spring AOP. AspectJ is complete, complex, academic, somewhat overengineered. Spring AOP … Read more

How to calculate distance from a point to a line segment, on a sphere?

Here’s my own solution, based on the idea in ask Dr. Math. I’d be happy to see your feedback. Disclaimer first. This solution is correct for spheres. Earth isn’t a sphere, and the coordinates system (WGS 84) doesn’t assume it’s a sphere. So this is just an approximation, and I can’t really estimate is error. … Read more

Code Golf: Beehive

Perl, 99 characters @P=map{$/.substr$”.’__/ \\’x99,$_,$W||=1+3*pop}0,(3,6)x pop; chop$P[0-$W%2];print” __”x($W/6),@P Last edit: Saved one character replacing -($W%2) with 0-$W%2 (thanks A. Rex) Explanation: For width W and height H, the output is 2+2 * H lines long and 3 * W+1 characters wide, with a lot of repetition in the middle of the output. For convenience, we … Read more