640 karma · joined October 7, 2014
That goes bad very fast. I've worked with someone who tried winning arguments with one-line microbenchmarks; They even tried to convince me that I should always use undefined over null in JS since one is faster than the other (forgot which).
> Introduce them to the concept of static single assignment form
I failed with this as well; some coders don't trust the compiler/runtime at all. I had people tell me that garbage collectors don't deal with cyclic dependencies or that "simple comparisons" (<, >, ==) are faster than "compound comparisons" (<=, >=).
Math.max(...lines.map((line) => ctx.measureText(line).width))> The answer to all these questions seems to be "no".
In conclusion you shouldn't be learning it and good luck to the company trying to hire people for Rust positions?
You're saying you should only learn what the industry is pushing towards. The thing is that the industry is pushing towards what sort of talent they can acquire - this is a vicious cycle.
Probably not
We already have this technology. Diesel engines ignite the fuel through compression. We also had the opposing pistons layout for a while (https://en.wikipedia.org/wiki/Opposed-piston_engine).
EDIT: we even have triangular-y shaped opposing engines (https://en.wikipedia.org/wiki/Napier_Deltic)
Mind blowing is the amount of output and obscurity of the error message you get from the type checker. It's harder to understand the error message than to debug the program if compiled "unsafely".
The research around erlang is due to the fact that it's heavily backed by Ericsson and the university in Uppsala (it's common for Uppsala master theses to be erlang-related). The other languages have more "neutral" origins.
I'm grateful, of course, for the technological progresses we've made since '73, but how come this is still an issue?
You can of course strip comments when making builds. In fact you can even write functions of more than 600 chars and get away with it as long as you use a minifier. If you have a minified function of more than 600 chars then that's a bulky function which should instead be split in smaller ones.
2. Search for images of "procedural generated art" - there are TONS of these. Pick a pretty/simple one and try to reproduce it.
3. Pick an esoteric programming language (http://esolangs.org/wiki/Main_Page) that doesn't yet have an interpreter/compiler and write one for it.
4. Pick an old piece of hardware and write an emulator for it: old consoles and home computers (NES, Commodore64, CHIP-8, etc). While writing the emulator you're going to need an assembler, disassembler and debugger to have any chance at debugging - these are bonus.
5. Try to port something to the GPU, something that's really awkward/challenging to port. Like a small lisp interpreter - I've no idea how to do that; early shader models aren't even turing complete.
/(x+x+)+y/.test('xxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
for instance. This regex doesn't even use non-regular extensions; it's expressible in a very limited computational model, it fits in a tweet and yet it renders my browser unresponsive.I can do even more damage with a nasty shader; GLSL is not turing complete either (in fact it looks a lot like Crema).
You don't see this disclaimer too often
Color = Data(function() ({ Red: {}, Green: {}, Blue: {}, Yellow: {} }))
Is this JS or pseudocode? There are some extra parens in there and the pattern repeats everywhere.Memorization is certainly not the way to learn how to solve math/cs/logic problems. There's a lot of thinking and (creative) experimentation involved when trying to solve a problem.
A lot of problems are classic problems in disguise. You'd be amazed to find out how many problems are just sorting + one traversal: reducing the average wait time in a queue, convex hull, counting duplicate elements (no extra space), interval scheduling, maximum number of overlapping intervals and a ton more. Can you memorize all of these problems individually? No, but you can ask yourself "how about if I sort my data first, what then?". If that doesn't work then try another question: "I have this brute force algorithm, if I use some other data structure will it get better?" - that question alone solves half of the problems I've ever seen. Follow up questions would be "does my problem look fractal-y?, maybe I can divide it repeatedly" or "can I incrementally build the solution?"
Even more interesting is that problems usually have more than one optimal solution: Prim's algorithms and Kruskal's solve the same problem in opposite-ish ways and use different data structs. How about substring searching: Boyer- Moore searches backwards, Rabin Karp computes hashes while others simulate automata. With self-adjusting binary trees it's the same story: a lot of very diverse solutions to the same problem.
Solving problems implies doing a lot of permutations and experimenting with data structures and classic approaches if you ask me - it's certainly not about memorising more than "sorting sorts and hash tables have constant-ish access time"
Is this process any different than changing colors, fonts and layout on a website until you get a good-looking enough whole? All you have to know are some principles about contrast, alignment, spacing and what not, and the rest is experimentation.