1,795 karma · joined Sep 13, 2012 (14y ago) · 646 submissions
391.
What Functional Programming Is, What It Isn't, and Why It Matters(inner-product.com ↗)
3 points · by cryptos · 6y ago · discuss
comment 6y ago · link · parent
It is this superficial understanding of OOP that led to a somewhat bad reputation. At least in the form "getX" and "setX" it would be more of a data structure with mostly useless methods around the fields. If a programmer is able to set each and every field from the outside through a setter, there is no encapsulation at all. To have objects that deserve this name, a method should be more like a "transaction" on the object, so related fields should be changed in one shot.
Apart from that, I don't think it is useful to think in separate camps (OOP vs FP) here, since both approaches are complementary in many cases. It is not like you have to decide for the one or another theses days, since most common languages support OOP and FP style.
comment 6y ago · link · parent
comment 6y ago · link · parent
Look for example at this link:
https://www.amazon.com/Fundamentals-Software-Architecture-Engineering-Approach-ebook/dp/B0849MPK73/ref=sr_1_1?dchild=1&keywords=software+architecture&qid=1594966348&sr=8-1
Maybe each part has a solid reason to exist, but the result is a monster.I would prefer something like this:
https://amazon.com/dp/B0849MPK73
And guess what, the above short link actually works! But Amazon didn't use this kind of links as a standard.396.
Ask HN: Best ways to retain qualified employees?
100 points · by cryptos · 6y ago · 153 comments
comment 6y ago · link · parent
However, one practical problem with this approach is that HTML forms currently only support POST and GET, although PUT and DELETE were needed in many scenarios. Without JavaScript the only solutions are using POST for everything or using POST + hidden form field with the desired HTTP method and rewriting the request on the server side.
comment 6y ago · link · parent
The longer I think about it the more I come to the conclusion that you have to hammer the new layout into your head, since there are many situations, like the keyboard of a colleague, where the physical layout wouldn't match. But again: how to learn it efficiently without a lot of frustrating typing errors?
The best would be some kind of official standard and the introduction of a new layout in schools.
comment 6y ago · link · parent
From that point of view, tables should have never been part of Markdown.
comment 6y ago · link · parent
Markdown tables are overly simplistic.
comment 6y ago · link · parent
AsciiDoc got it right: https://asciidoctor.org/docs/asciidoc-syntax-quick-reference... You can even have formatted source code in AsciiDoc table cells. Try this with Markdown ...
409.
Czech hospital hit by cyberattack while in the midst of a Covid-19 outbreak(zdnet.com ↗)
2 points · by cryptos · 6y ago · discuss
comment 6y ago · link · parent
comment 6y ago · link · parent
Essentially every closed source crypto application isn't trustworthy. Same is true for operating systems.
comment 6y ago · link · parent
Starting with overly strong rules and relaxing them later is better than starting with loose rules and tighten them later, because it would require much refactoring to introduce a new rule, whereas dropping a rule is a thing of a few seconds.
comment 6y ago · link · parent
* No checked exceptions destroying lambda expressions and leading to architecture problems (since exceptions are oft not used like the inventors of checked exceptions assumed).
* Functions are real first class citizens and don't need artificial interfaces.
* Named parameters with default arguments are very practical.
* `name: Type` is a better fit for type inference than `Type name`.
* Null-safety helps to avoid lots of bugs.
* The type system with `Any` as a unified root and `Unit` instead of the special case `void` makes programming with generics much easier.
* Constructors are always lean, not only for data classes (record in Java 14).
* Most things are expressions, so you can write `val a = if(cond) 1 else 99`.
* Extension functions and operator functions can be used to write simple to use and elegant APIs.
So at least for me Kotlin is definitive the better Java and I wouldn't start a new project with Java, if I could use Kotlin instead.comment 6y ago · link · parent
With Kotlin you get like 80 % of the good things from Scala for 20 % the efforts.
I've switched from Scala to Kotlin 3 years ago and didn't miss much (real pattern matching come to mind).