Live data from Hacker News

The Wrong Kind of Paranoia

prog21.dadgum.com

51–54 of 54 posts

Re: The Wrong Kind of Paranoia

#51
post #46

Earlier quoted context omitted.

Is it really worth that much though? I'm a Ruby developer and I've only very rarely actually wanted a type system. I've often found that I could work around its lack by implementing class checking and raising an error whenever the wrong type gets passed. It gave me everything I wanted without having to give up dynamicism. I think types probably work well in situations where you don't know what kind of code you're goi…

I don't know much about Ruby, I will admit. But dynamic typing is terrible for large code bases. The only place I allow it is at the very edges of our system, where we are transforming the proper types of the internal system into POD-objects to be serialized and returned to the JS/HTML front-end. I'm not willing to give up the compile-time safety of breaking the build if someone inadvertently assigns a string to a nu…

> But dynamic typing is terrible for large code bases.

Yes, you can get into a lot of trouble very quickly as your codebase grows if you don't have a heavy security blanket. But the more Ruby I write, the more typing looks like Linus from Charlie Brown's blanket.

Because you don't need a monolithic code base any more. You can break it up into smaller pieces that interact with each other using POD objects.

When I start to have type problems in Ruby, I start looking around for a domain concept that I need to extract into a gem. The codebase never grows to a point to where it becomes a serious problem.

Re: The Wrong Kind of Paranoia

#52

Earlier quoted context omitted.

Is it really worth that much though? I'm a Ruby developer and I've only very rarely actually wanted a type system. I've often found that I could work around its lack by implementing class checking and raising an error whenever the wrong type gets passed. It gave me everything I wanted without having to give up dynamicism. I think types probably work well in situations where you don't know what kind of code you're goi…

I agree that some type systems are infuriating. They demand highly verbose code, and offer almost no protection in exchange for your effort. However, not all type systems are equal. Haskell (for example) almost never requires explicit type annotations. It has a type inference system that is sometimes frighteningly good. You can express a huge amount of logic through the type system and enforce very non-trivial constr…

The problem isn't the type annotations. The problem is losing the meta-programming capabilities you gain when you can make everything an object with a class. These capabilities are really useful when you don't really know what you're doing yet, which, for me, is almost all the time.

Knowing at any time I can take the class hierarchy I just built, turn each class into an instance of an object, and store those objects in a database, with a 10 minutes and a fancy bit of code, is much much more useful than having a babysitter.

Re: The Wrong Kind of Paranoia

#53
post #41
post #36

I usually love James Hague's posts, but this one has his head buried deep in the sand. And he's enough of a veteran to remember early Lisp and Smalltalk systems, where excessive openness in all aspects looked awesome for prototyping/hacking or academic toy programs (or what is considered toy-size in the last 20 years anyway), but was a disaster even for the mid-1990's definition of programming in the large. Attempts…

> we have tried the elegance of extremely simple and open language/runtime architectures, and that was always an abject failure. Just because it was tried in the past, doesn't mean it wasn't the right direction. > Attempts to discipline these languages came too late, So, as an industry, we were learning and now we know some basic principles. Discipline does a great deal for Erlang. Ironically the game sockets he desc…

You didn't understand what I meant by "discipline". I didn't mean best-practices -- i.e. programmers learning to not abuse openness without any help from the language. What I meant was adding the missing controls to languages (making them more similar to the languages James criticizes) so proper discipline could be enforced: visibility, module systems, restrictions to change core runtime classes, optional static typing etc.

Re: The Wrong Kind of Paranoia

#54
post #3

"There's an architecture used in video games for a long time now where rendering and other engine-level functions are decoupled from the game logic, and the two communicate via a local socket." Is he talking about multiplayer or has anyone ever actually seen this?

You can go even further, and this architecture is becoming more and more popular in business applications.

James Lewis and Martin Fowler coined the per "Microservices" for this emerging pattern:

http://martinfowler.com/articles/microservices.html

Post reply on HN