Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tanin
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
23 ms
·
241.
▲
by
tanin
7y ago
Yes, itertools is great. But its stblib is still much lighter than Scala's and Ruby's. Actually, that seems to be the direction/principle of Python, where it is less inclined to add a helper function. "It has been discus
242.
▲
by
tanin
7y ago
Here was one example I encountered a while back: https://stackoverflow.com/questions/952914/how-to-make-a-fla... In Python, it's `import itertools` and `list(itertools.chain.from_iterable(list2d))` or `[item
243.
▲
by
tanin
7y ago
> The interesting takeaway from this study I think is that it does not show that statically typed (even "pure") functional languages are not obviously better than plain old Python. Could you elaborate more on this statement? No
244.
▲
by
tanin
7y ago
> But don't mischaracterise python's standard library. My main point is Ruby's stdlib is richer than Python's. (And that's not either better or worse. Some people prefer lighter stdlib, and that's fine.) >
245.
▲
by
tanin
7y ago
Saying Ruby/Scala have richer standard lib than Python isn't really a stab at Python. Like dragonwriter says, it shows that "Python expresses the concept fairly compactly in the core language without even resorting to stdlib&
246.
▲
by
tanin
7y ago
While what you say is true, my small example shows that the code is longer in Python for solving the same problem, i.e. `my_list[0] if my_list else None` is longer than `my_list.headOption` or `my_list.first`. And we are talking about the b
247.
▲
by
tanin
7y ago
> but every language has warts and things like that Sure, but we are talking about the brevity of a language. The richness of the standard library directly impacts brevity. So, Ruby would have been a better representative (for brevity) o
248.
▲
by
tanin
7y ago
That's a great example. And, yes, Javascript has a similar problem.
249.
▲
by
tanin
7y ago
I know. It's strange to say that. But Scala's library is very very rich. Another example is that Scala offers a lot of ways to process a list like foldLeft, foldRight, unzip, headOption, lastOption, flatMap, groupBy, and many meth
250.
▲
by
tanin
7y ago
Maybe I should have given the comparable example in Ruby, which is `array.first`. Even Scala offers `array.headOption`. Both are more succinct than Python's. The degree of richness and/or the height of abstraction seem lower in Py
251.
▲
by
tanin
7y ago
One factor on why Python only saves 20%. Scala has a very rich standard library. Python doesn't. An example is: https://stackoverflow.com/questions/363944/python-idiom-to-r... Ruby would have been a better ex
252.
▲
by
tanin
7y ago
The Scala result confirms my bias :P I love Scala because it strikes a great balance between being succinct and offering type safety. I wish you would use Ruby instead of Python. Python is strangely inconsistent. For example, Python doesn&#
253.
▲
by
tanin
8y ago
Gofundme doesn't take any fee on certain countries (including US) https://support.gofundme.com/hc/en-us/articles/203604424-Fee...
254.
▲
by
tanin
8y ago
This is such an awesome service. Congrats Everest (and team) for making it easier to make software more secure!
255.
▲
by
tanin
8y ago
Congrats, Jonathan!
256.
▲
by
tanin
8y ago
I might misunderstand the question here. Could you elaborate more why the complete grammar of Rust is important for writing a compiler (for any programming langugage) in Rust? I thought the question was about whether to write a compiler in
257.
▲
by
tanin
8y ago
I find that Rust's syntax/ecosystem is much more modern and pleasant to use. Some examples are: pattern matching, immutable variable, better build and dependency system, and many more. There are some concepts like lifetime that yo
258.
▲
by
tanin
8y ago
Playframework (with Scala) + Vue.js (with Typescript) + Heroku. It gives me a good balance on development speed over project's age and performance. I particularly like the balance of type safety and brevity. Learning curve is high for
259.
▲
by
tanin
8y ago
* Statically-typed languages like Typescripts, Kotlin, Scala, or even Java. Avoid dynamic-typed language in general * Single-page application, which means complete separation between frontend and backend. When developing locally, you have t
260.
▲
by
tanin
8y ago
For a non-strong-typed language, it's difficult to dive into the code after you haven't work on that codebase for a while. We were on a really old Mongoid (or carrierwave, or some other gem, can't remember), It was difficult
261.
▲
by
tanin
8y ago
Coming from Ruby, I encountered this funny situation in Python. I was looking how to get first element of an array or get nil if the array is empty. Python library doesn't provide this kind of functionality. https://stackove
262.
▲
by
tanin
8y ago
That's exactly what I have been doing `clang -S --emit-llvm <filename>`. Godbolt.org is even more handy!
263.
▲
by
tanin
8y ago
LLVM is a great project. I'm writing a programming language based on it. It is so much easier because: (1) it's easier than writing machine code translation and (2) it's also easier than translating your code to C which woul
264.
▲
by
tanin
8y ago
I understand what you mean, and it's definitely a trade off. Static typing requires all types to make sense together no matter how small the addition is. In dynamic typing, we can just add a class/object/field here and there
265.
▲
by
tanin
8y ago
Thank you. I think I have a good idea what it is now. It's a constraint of a field. But it goes a bit further to ensures that, for example, an author id refers to a valid entity.
266.
▲
by
tanin
8y ago
> It does depend on how you write your code but favoring pure functions, pushing immutability to the edges of your programs allows you to refactor without fear. Dynamic typing is punitive if we make mistake (e.g. using the wrong architec
267.
▲
by
tanin
8y ago
Is Spec simply a test? Or is it something more? I keep hearing about it, but it seems to be more than just a test case. Let's take a simple example. I have an object with the method named "get". But I call "fetch" i
268.
▲
by
tanin
8y ago
For me, what competitive coding, or practice of it, improves 2 skills: (1) solve an algorithmic problems and (2) translate ideas into code quickly and correctly. The number 1 is not that essential. But the number 2 is somewhat essential for
269.
▲
by
tanin
8y ago
From what I've seen, it seems to be the other way around. As we get better linearly (e.g. code faster), our income increases somewhat exponentially. So, it seems like a better strategy to try to earn more. Not to mention that having mo
270.
▲
by
tanin
8y ago
Can anyone tldr the solution? I'm on Ubuntu and get the warning (stop syncing/move folder). Move to where? How do I get it to work on Ubuntu again?
More ›