Jump to content

bascule

Senior Members
  • Joined

  • Last visited

Everything posted by bascule

  1. Python has a real, full-featured object model, which includes metaclasses which not only provide a nice API for singletons but are also excellent for reflection. You can define methods in the metaclass which can be invoked in the body of subclasses, allowing you to generate code on-the-fly declaratively. What do you use that for? The same sort of thing you might use the factory pattern for in languages like Java. Rather than creating a FooFactory you can just call a method of the Foo metaclass which builds an appropriate object. Compare this Python pseudocode: obj = Foo.create_from_bar(bar) as opposed to some Java pseudocode: FooFromBarFactory factory = new FooFromBarFactory(bar); Foo obj = factory.newInstance(); The code is both clearer and more concise. Again, having first class syntax for types like maps/dicts makes code dramatically clearer. Shorter code should improve clarity, not diminish it. Perl was a particularly egregious case of overly terse and confusing syntax. However in a discussion about Python it's a red herring. Using more code typically makes programs harder to read and more difficult to maintain. Java programs are typically ridden with tons of boilerplate code because the language lacks the features to abstract it away. Sounds like you would love Lisp. Personally I prefer languages with rich, expressive grammars. I feel they make code both easier to write and read. Aieeeeeeeee! The STL is TERRIBLE! C++ is the only popular language which has to embed a Turing complete functional templating language, because without it the amount of boilerplate code you would have to write would boggle the mind. Templates make the language terribly confusing, and bely an inability to perform real metaprogramming like you can in a language like Python (or Ruby, Lisp, Smalltalk, Haskell, and many others) "Throw more code at the problem" is a terrible attitude. Every line of code I write for work is a line I have to maintain. More lines of code means more work for myself. I would rather create as little work for myself as possible. This doesn't have to come at the price of clarity, on the contrary, fewer lines of code should improve clarity in most cases. Your typical program in C++ or Java is going to be full of far more lines of code which don't express a solution to the problem but rather are just thunking around deficiencies of the language. This makes programs harder to read as you have to mentally skip over this code to read the actual solution to the problem. Python gets rid of all the boilerplate. It also has a dynamic type system which further reduces boilerplate needed for type thunking. Dynamic type systems make interfaces less brittle and allow you to preserve backwards compatibility in cases which simply aren't possible with static type systems.
  2. Learn Python. It provides a much more powerful model for describing most types of problems than C does. C requires you restate your problem in terms the CPU can understand, and "what the CPU can do" is typically an overcomplicated and error-prone model for describing most problems. If you feel Python is too slow, there are still lots of alternatives to C while still affording you high level, declarative descriptions of problems. OCaml is a fast, compiled mixed-paradigm language which is used for all sorts of performance critical modeling. I would recommend learning C after learning a higher level language. I think too many people start out with a language like C and end up with a "C shaped brain" that tries to model every program directly around the Von Neumann architecture. Learning a higher level language (particularly a functional one) will essentially require you relearn everything you know. I started out with a very heavy C background and it took me many years to move on. Nowadays I never write "for" loops (although they have their place in Python) and can't believe I wasted so much time writing them over and over again in C. There are better ways!
  3. I've been using this site for the past several months to track the polls: http://fivethirtyeight.com (538 is the number of electoral votes, btw) It was developed by a guy named Nate Silver who originally wrote a model for predicting baseball games called PECOTA. The model predicted the Rays would turn it around, going from losing 96 games to winning 90. They ended up winning 97. Who'da thunk it? PECOTA did. Now he's turned to predicting elections. His model runs 10,000 times a day, and analyzes the history of polls vs election results with a data set going back to the '50s. He predicts Obama has a 94.7% chance of winning... on election day.
  4. Climate change / climate science / atmospheric science / climatology really could use its own forum
  5. Let me give my own totally unscientific opinion on liberal versus conservative intellectuals: Conservative intellectuals tend to be diabolically evil (e.g. Milton Friedman) Liberal intellectuals tend to be unrealistic blowhards (e.g. Noam Chomsky)
  6. Oh for the love of god... READ: http://en.wikipedia.org/wiki/DNA_replication If you're going to bother posting on a science forum, could you actually take 5 minutes to research what you're about to post before instead posting your own completely warped view of reality? I mean, this is why we have science, so we can understand the workings of the world empirically and not have to venture thoroughly unempirical, retarded guesses which will undoubtably be wrong.
  7. Lawkin? Perhaps you're thinking of Jean Baptiste Lamarck...
  8. Genetic engineering is memetic evolution turned genetic evolution
  9. I don't forsee humans changing much with time. There just don't seem to be many selection pressures which affect you before you can reproduce driving our development in a direction radically different from our current form. If our bodies are going to evolve at all, it will be through technology.
  10. So does this mean thefinaltheory.com is wrong? *gasp*
  11. Anyone plan on busting out a new forum anytime in the near future? I think you could throw together another omnibus forum like all the others for what's been suggested... Meteorology / Climate Science / Earth Science seems like it'd be a good one.
  12. This has been mentioned before, but with the debate over climate change raging, I'm really surprised there's not a forum dedicated to Climate/Atmospheric Science. Maybe I say that because I work for a climate modelling group... Anyway, I'd really like to talk about: - What climate forcings are truly anthropogenic in origin? - Is "global warming" a result of these forcings? - What climate change metrics should we truly be considering, especially when assessing a "global warming" trend?
  13. Nanotechnology and/or Neurotechnology

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.