splinterofchaos | 11 years ago | on: Identifying Autism from Neural Representations of Social Interactions
splinterofchaos's comments
splinterofchaos | 11 years ago | on: Can a simple algebra test predict programming aptitude?
From cppreference.com: http://coliru.stacked-crooked.com/view?id=0b2cec4d8c69ffaf
splinterofchaos | 11 years ago | on: Show HN: Code Words, a quarterly publication about programming
splinterofchaos | 11 years ago | on: Show HN: Code Words, a quarterly publication about programming
I don't think that's necessarily true. Look at brainfuck!
But in all seriousness, dynamically typed languages could be categorized as "more expressive" than statically typed languages, and generally allow for cleaner interfaces, but turns static-typing compile-time errors into dynamic run-time errors. What's worse is that your tests might not cover the specific conditions that cause it. So, while you might consider C++ less expressive and concise than Python, at least you'll never try to take the square root of a string.
The ease of writing bug-free code and debugging depends on a lot of factors. How well designed is the interface/API? How structured is the code? How good are the available tools? It's not what language you use, but /how/ you use it.
splinterofchaos | 11 years ago | on: Show HN: Code Words, a quarterly publication about programming
def move_pos(x):
if random() > 0.3:
return x + 1
return x
def move_cars(positions):
return map(move_pos, positions)
I do not believe that functional programming benefits from brevity, except at the top layer. Unfortunately, functional programmers often expand their equations which, having examined them thoroughly, they understand implicitly, but can give too much information to the reader all at once.Though, I have to agree, the FP community really hasn't been able to demonstrate how to do it without losing efficiency, and yet many proponents claim we should abandon all other paradigms. All of these articles seem very biassed towards FP.
I enjoy functional programming, but I prefer to work in imperative languages where I have a choice between paradigms.
splinterofchaos | 11 years ago | on: Perfect forwarding and universal references in C++
splinterofchaos | 11 years ago | on: Perfect forwarding and universal references in C++
splinterofchaos | 11 years ago | on: Perfect forwarding and universal references in C++
Your code example does not work because you call "foo" instead of "bar". But consider this one:
#include <iostream>
using namespace std;
template<class T> T bar(T&& i){ return std::forward<T>(i); }
int main() {
int i=0;
cout << bar<int&&>(6) << endl;
return 0;
}splinterofchaos | 11 years ago | on: Perfect forwarding and universal references in C++
So when I see "Don't let T&& fool you here - T is not an rvalue reference" -- yes it fricking is! And if you're going to work on a low enough type-level that you need perfect forwarding, you NEED TO KNOW THAT.
splinterofchaos | 11 years ago | on: Sherlock Holmes Debugging
Also, completely missing from this story is how deductions are made and the difference between deductions, hypothesis, and facts.
For example, fact: The message isn't sent. Deduction: cURL works, so the problem isn't the system. Hypothesis: The problem is in the API.
splinterofchaos | 11 years ago | on: Neovim: input encoding and you
splinterofchaos | 11 years ago | on: Neovim: input encoding and you
splinterofchaos | 11 years ago | on: Neovim: input encoding and you
We have refactored some of the code base using modern coding standards, which makes it more hackable. Some of these systems have become more efficient by, for example, using pipes over temp files.
We accept upstream patches in order to stay on top of vim, so I hope that no one will ever not use neovim because of a feature lacking (aside from a GUI--see below).
neovim creates a socket for each instance that external programs can communicate with, allowing one to write a plugin or extension in any language, providing it has a msgpack implementation. These plugins may eventually control things like the GUIs, spell checkers, syntax analysers, allowing nvim to become more focused, like a micro-kernel.
As of right now, many people have switched without having any real problems.
splinterofchaos | 13 years ago | on: Manipulating C++ Containers Functionally
splinterofchaos | 13 years ago | on: Manipulating C++ Containers Functionally
My argument is that C++, a multi-paradigm language, benefits from not being bound to purity and that being able to mix imperative and functional code is a good thing. We aren't stuck in pure-land so we can insert IO where it needs to be, not where it propagates, but neither do we need to be stuck in state-land. Functional programming is not against the "nature" of the language, it gives us the freedom to choose.
> Because the first does not copy the container and its elements...
This is a quality of implementation detail. It would have been detrimental to the point of the article to waste time showing optimizations such as "if F is a function X to X, use the in-place version". But I assure you, my optimization testing has shown there is little difference between the code generated by this and vanilla <algorithm>. In fact, it is at times better.
https://github.com/splinterofchaos/Pure/blob/master/samples/...
splinterofchaos | 13 years ago | on: Manipulating C++ Containers Functionally
But also: std::to_string
http://en.cppreference.com/w/cpp/string/basic_string/to_stri...
splinterofchaos | 13 years ago | on: GCC 4.8 Has Automatic Return Type Deduction
I, and many others, have been writing code in Clang and GCC for years that could not be compiled in MSVC. But that code was standard c++11. This is experimental and people should be aware of that while using it.
splinterofchaos | 13 years ago | on: Try meditation for 10 days - its working for me
Perhaps. Some like to listen to light jazz or classical music while meditating, but I like white noise, wind blowing, and passing traffic best. I think it's very important that you don't meditate in front of your computer because it puts your brain in a high-activity, instant-gratification mode, which is the opposite of what you want. Just the fan on my computer in enough to make me think about checking reddit or my email or whatever. Even something as simple as moving to a room you don't normally stay in can be enough to wind down your mind and become more relaxed.
> Meditation was a bit of mystery to me before watching them.
Meditation IS a mystery. If anyone ever tells you "IT IS THIS!", they are wrong. There are countless methods devised by people from all over the world and they all work. Some think you must lay down and listen to music. Others think you must sit cross-legged. Some even believe you must to it standing up! Some think you must count to ten, others say do it backwards. There are those who say think "nothing", and those who say think "anything". Some say "concentrate", some say "relax".
But the best advice I ever got: "Just sit."
splinterofchaos | 13 years ago | on: Try meditation for 10 days - its working for me
It is said that when one is still for long enough, the brain switches modes. The unmoving mind. We spend all day interacting with the world, filling our brains with facts, experiences, feelings, etc. Take a step back and empty your mind. But don't pay money for it.
splinterofchaos | 13 years ago | on: Dr. Alan Kay on the Meaning of "Object-Oriented Programming"
Now-a-days, people have more understanding and awareness (this was a little over ten years ago), but it is still an expensive procedure, involving many specialists of different areas, sometimes neurologists and brain scans.