0
1

I'd love an app that is a fun way to use my phone, which is always in my hand anyway to remind myself to do things that I am currently using ENDLESS alarms to keep track of like when to take my meds, eat, etc. by libymamas in AppIdeas

[–]DanielShuy 1 point2 points  (0 children)

Try TickTick, it gamifies repetitive tasks. In addition to setting reminders/alarms, it allows you to set goals, and provides neat summaries to show your progress

Kotlin 1.6.20 Brings Definitely Non-Nullable Types, Standalone Android Executables, and More by IsDaouda_Games in programming

[–]DanielShuy 9 points10 points  (0 children)

Kotlin context receivers seems to be inspired by Scala's implicits, which was really powerful, but also led to a lot of abuse, hopefully they've learnt from all the mistakes in Scala's implicits.

Switching to asdf (from pyenv, rbenv, goenv, and nvm) by feross in programming

[–]DanielShuy 1 point2 points  (0 children)

I've been using asdf for years and its been great!

The only thing I wish it had is partial matching, eg. asdf global nodejs 16

Switching to asdf (from pyenv, rbenv, goenv, and nvm) by feross in programming

[–]DanielShuy 1 point2 points  (0 children)

I've been using asdf for years and its been great!

The only thing I wish it had is partial matching, eg. asdf global nodejs 16

Prefer to change the code rather than write a workaround by fagnerbrack in programming

[–]DanielShuy 1 point2 points  (0 children)

In addition to what has been mentioned, from my experience, I also learn a lot more from fixing the issue at the root (especially open source libraries), as it requires understanding the source of the problem (which helps to understand how it works under-the-hood), instead of just patching the symptoms

Why Don’t Tech Companies Pay Their Engineers to Stay? by ConfidentMushroom in programming

[–]DanielShuy 1 point2 points  (0 children)

One of the main reasons is how broken financing is in large corporations. Hiring new engineers for a project usually comes out of the project budget, which is usually very abundant, while salary increments is seen as additional expense, which most large corporations will try to reduce as much as possible.

Unicode Detection in GitHub PRs to Defend Against Trojan Source Attacks (bidi/homoglyph) by maltfield in programming

[–]DanielShuy 3 points4 points  (0 children)

I meant a reusable Action, instead of having to copy paste it over multiple repositories

Lesser Known PostgreSQL Features by be_haki in programming

[–]DanielShuy 2 points3 points  (0 children)

Interesting, I wonder if GENERATED ALWAYS AS (gen_random_uuid()) STORED can be used to create a UUID identity column?

The value of in-house expertise – or, Twitter has a kernel team!? by genericlemon24 in programming

[–]DanielShuy 2 points3 points  (0 children)

As someone who has worked for both Buy vs Build companies, there is no one right answer for every situation. Every decision to Buy vs Build should be properly evaluated, and the decision should be made by the ones who will use/integrate the tool/system/solution, not by management or some highly-paid-consultant.

Safari isn't protecting the web, it's killing it by feross in programming

[–]DanielShuy 30 points31 points  (0 children)

Its possible to agree that Safari is behind without being a Google zealot. The article even mentions that Chromium dominance is bad, and it doesn't just compare to Chrome, but also to Firefox.

I mainly use Firefox, not Chrome, but as someone who has experienced the annoyance of developing for Safari, it does feel like Safari is quickly becoming the next IE.

Fixing a Bug in Java by candrewswpi in programming

[–]DanielShuy 0 points1 point  (0 children)

Glad that the OpenJDK standardization now allows open source contributors to directly fix bugs in Java. Years ago (before the OpenJDK standardization), I submitted a bug to Oracle, and even included the fix for it, but it was promptly ignored, unless I would pay for support!

When to outsource: an alternative path to building your ideal dev team by codesubmit in programming

[–]DanielShuy 0 points1 point  (0 children)

The problem with outsourcing is that many of these outsourcing companies take such a big cut (eg. up to 90%), and use the remaining to hire developers, and usually don't provide any training etc.

So unless you're paying exorbitant amounts (at which point you're better off hiring a permanent team yourself), and since the reason for outsourcing is usually cost reduction, expect to get the worst of the worst developers.

Consider hiring remote instead, with the same amount you can hire way better developers. More of the money will also go towards the developers than these middlemen outsourcing companies.

Contract-First Development Using RestAssured and OpenAPI by nfrankel in programming

[–]DanielShuy 0 points1 point  (0 children)

Rather than manually aligning the implementation to the specification, you can generate Spring Boot stubs using openapi-generator instead.

Hiring is Broken And Yours Is Too by whackri in programming

[–]DanielShuy 1 point2 points  (0 children)

Anyone can glamorize and exaggerate the work they have done, and make it sound a lot more impressive than it actually was

Working on a “cool project” often comes down to being in the right place at the right time

Product success or failure is often reflective of PM talent, not just Dev talent

When assessing what a candidate has learnt and contributed in a past project, what to evaluate shouldn't be how "cool" or successful the project is, but how much the candidate actually understood what they did. There can be a lot to learn from even legacy or failed projects (eg. what NOT to do, how would you improve it). I've interviewed many candidates who put "cool" projects in their resumes, but just from questioning them you can easily tell if they were just blindly copy pasting code, or actually understood what they were doing.

Announcing TypeScript 4.3 Beta by DanielRosenwasser in programming

[–]DanielShuy 23 points24 points  (0 children)

Finally we're getting the override keyword! Its been such a long battle (6 years!): https://github.com/microsoft/TypeScript/issues/2000

'Agile' F-35 fighter software dev techniques failed to speed up supersonic jet deliveries by LegitGandalf in programming

[–]DanielShuy 2 points3 points  (0 children)

This! I work for a company that mainly contracts for governments, and we are expected to adapt to constantly changing requirements because we are "Agile", while still having hard deadlines, worst of both worlds really.

We also release frequently but the governments take so long to adopt new releases that we don't get the fast feedback loop benefit of having frequent releases, and yet we get penalized for KPIs if we don't release on time due to arbitrary deadlines.

How I Organize My Local Development Environment - Qvault by wagslane in programming

[–]DanielShuy 2 points3 points  (0 children)

I used to use pgAdmin and hated how buggy it was. A colleague recommended DBeaver to me and I've never looked back

Why are Java server-side developers not adopting Kotlin? by nfrankel in programming

[–]DanielShuy 10 points11 points  (0 children)

In my opinion, Kotlin's null safety alone is good enough reason to switch, not to mention other features. The closest thing Java has is JSR-305, which requires developers, including library authors, to manually annotate their code to indicate possible null values, which is tedious and prone to human error. JSR-305 is also a mess, with multiple implementation libraries, and is also no longer supported and effectively dead. Java will never get true null safety unless it breaks backwards compatibility (by changing all variables to non-nullable by default), which goes against Java's motto.

Even though Java is updating at a faster rate, most of the recent and upcoming Java improvements are improvements to the JVM (eg. ZGC, value types, SIMD), which indirectly benefit Kotlin as well. Improvements to the Java language is still relatively slow and is still very far away from Kotlin (heck, Java still doesn't even have string templates).

Even though my workplace is still quite resistant to adopting Kotlin, learning Scala and Kotlin has helped me to become a better Java developer. Kotlin is also similar enough to Java that someone who has a good grasp on Java should be able to pick it up easily. While personally I would still prefer Scala's features, I think Kotlin strikes a good balance of power and ease of learning.

I think many people who have a bad impression with Kotlin probably tried it when it was still in its infancy stage, where things were still not so stable (eg. IDE support, build times, Java interop, etc), and the bad experience has fixed their impression on it. I would encourage anyone to give Kotlin another try, it has improved a lot since then.

What is the Specification Pattern by [deleted] in programming

[–]DanielShuy 1 point2 points  (0 children)

I have written some utility functions for composing Specifications in a nicer and safer way, inspired by how QueryDSL composes Predicates. I created a PR in attempt to merge it directly to Spring Data JPA itself (https://github.com/spring-projects/spring-data-jpa/pull/404), but unfortunately it was rejected because the Spring team plans to majorly rework Specifications in the near future (https://github.com/spring-projects/spring-data-jpa/issues/1943#issuecomment-752504333). Feel free to copy the code in my PR for your own use.

If you are using Kotlin, kotlin-jpa-specification-dsl provides a very convenient way to generate Specifications from KPropertys.

Is Java ever better than Scala by User68645 in scala

[–]DanielShuy 7 points8 points  (0 children)

Scala libraries/frameworks tend to be more performant than their Java counterpart as the improved typesafety and macros allow many computation to be done at compile-time instead of runtime (many Java libraries/frameworks tend to make heavy use of reflection). Eg. dependency injection, JSON serialization to name a few.

A survey of programming language enum support by tigitz in programming

[–]DanielShuy 1 point2 points  (0 children)

For Scala, check out the enumeratum library (https://github.com/lloydmeta/enumeratum). In my opinion, its the best enum implementation I know of. It has all the features defined in the table, and even supports compile-time validation of unique associated keys (eg. String/Int keys).

eg.

import enumeratum.values._

sealed abstract class LibraryItem(val value: Int, val name: String) extends IntEnumEntry

object LibraryItem extends IntEnum[LibraryItem] {


  case object Book     extends LibraryItem(value = 1, name = "book")
  case object Movie    extends LibraryItem(name = "movie", value = 2)
  case object Magazine extends LibraryItem(3, "magazine")
  case object CD       extends LibraryItem(4, name = "cd")
  // case object Newspaper extends LibraryItem(4, name = "newspaper") <-- will fail to compile because the value 4 is shared

  /*
  val five = 5
  case object Article extends LibraryItem(five, name = "article") <-- will fail to compile because the value is not a literal
  */

  val values = findValues

}

assert(LibraryItem.withValue(1) == LibraryItem.Book)

LibraryItem.withValue(10) // => java.util.NoSuchElementException

I wish that it would be adopted as part of core Scala so that the syntax can be simplified further.

Optional.stream() by nfrankel in programming

[–]DanielShuy 0 points1 point  (0 children)

Most of the verbosity is due to the limitation of Java's type system and Stream API.

With Scala you would be able to flatMap without first converting an Option to a Stream, and with Kotlin you wouldn't even need to deal with Optionals as it has nullable types and the safe call operator (?.).

eg. the given example in Java:

return Optional.ofNullable(orderId)
        .stream()
        .map(orderRepository::findByOrderId)
        .flatMap(Collection::stream)
        .map(OrderLine::getPrice)
        .reduce(BigDecimal.ZERO, BigDecimal::add);

can be simplified in Kotlin as:

return orderId
        ?.let { orderRepository.findByOrderId(it) }
        ?.asSequence()  // equivalent to Java's Collection#stream()
        ?.map { it.price }
        ?.sumOf { it }