HN user

hhandoko

238 karma
Posts4
Comments207
View on HN

I looked into Vue + Webpack vs Vue + Brunch on my last project. I ended up with Brunch because the requirements are fairly basic and Brunch are easier to grok. Had the requirements be a little bit more complex, I could have easily gone for Webpack.

IMO, there are a few key things lacking with the Vue + Brunch combo:

- The `vue-brunch` plugin seems to be no longer in active development? (https://github.com/theocodes/vue-brunch)

- The `sass-loader` plugin allows me to use Sass dialect in SFC-style Vue (Single File Component). I'm using plain CSS with Vue + Brunch SFC as I cannot find a Brunch plugin offering similar functionality.

- There are some Brunch idiosyncracies. For one, the processing pipeline is executed as per `package.json` (dev)Dependencies ordering. I spent quite a bit of time before figuring this out.

The Scala example, yes... The Elixir one? Is it actually a Monad? I figure it's simply destructuring + pattern matching (against the value of the first tuple value, :ok or :error atom).

To expand a bit more, it's not like Scala's `Either[T, U]` where we're limited to a pair of types, I think you can return other atom values (but use :ok and :error) as a convention.

Also, there is an Elixir library I'm using that's a closer in spirit to Scala's for-comprehension called `monadex`. Example below:

    result = success(comment_params)
             ~>> fn p  -> link_reply_to_id(p)  end
             ~>> fn p  -> create_changeset(p)  end
             ~>> fn cs -> assert_changeset(cs) end
             ~>> fn cs -> insert_changeset(cs) end

I believe these are referred to Railway-Oriented Programming. I've seen several other examples for Elixir (incl. ones using macros), but by far this is the 'cleanest' syntax :)

Here's a similar construct in Scala:

    (for {
      user   <- currentUser(...)
      group  <- groups.fetchForUser(...)
      friend <- friendships.fetchFriend(...)
      member <- groups.addMember(...)
    } yield {
      render(...)
    }).recover {
      case e: Exception -> ...
    }
Scaling Scala 9 years ago

IMO the ProcessBuilder class is not a very good example, as the operators are designed to match the existing shell / bash ones (e.g. `#>>` is similar in behaviour to bash's `>>`).

Scaling Scala 9 years ago

Scala core library is littered with :: +: and other nonsensical operators.

They are very useful. With the two you mentioned (:: and +:) they can be used for pattern matching in addition to concatenation (of a list / sequence), for example:

    scala> val list = 1 :: 2 :: Nil
    list: List[Int] = List(1, 2)


    scala> val x = list match {
         |   case head :: _ => head
         |   case _         => 0
         | }
    x: Int = 1

    scala> val seq = 1 +: Seq(2, 3) :+ 4
    seq: Seq[Int] = List(1, 2, 3, 4)

    scala> val y = seq match {
         |   case a +: _ :+ b => a + b
         |   case _           => 0
         | }
    y: Int = 5
It can be a bit confusing at first, especially for mutable vs immutable collection operators. But you end up remembering some, if not most of it, after using them a number of times.

I'm currently working with Scala and recently dabbling with Elixir and Phoenix. It's a good language and great platform, however, I still prefer static typing.

I'm still getting used to dynamic typing in Elixir. Most of the time I feel like just matching against Map data structure or records.

While Dialyzer is great, writing the typespecs is a bit of a maintenance overhead. I suppose it's a tradeoff...

I came to Elixir from Scala, [..] now I don't have to deal with the half of the Scala community that tries to make Scala into Haskell.

IMO Scala will continue to be a multi-paradigm lang. On pure-FP and libs, it's a choice and really depends on the problem domain. It might not be a good solution to everyone, but I'm glad it exists.

Nothing really changed, you could write Android apps on Kotlin before, as well as on any other JVM language. But now "Kotlin is the hero".

The announcement shows Google making a commitment to make Kotlin successful in Android, rather than leaving the effort all to the community and JetBrains.

I suspect that Google's adoption of Kotlin is just politics: [...] Google could acknowledge Scala years ago, but didn't [...]

I think this post explains it best: https://medium.com/@ScalaWilliam/why-scala-didnt-miss-the-an... .

In regards with the Scala evolution, there's a lot of things to be excited about. In the near term, 2.13 should see various optimisation to core libraries and faster compilation.

Also, I don't understand the point of Kotlin. [...] Kotlin is just a subset of Scala. [...]

Kotlin is a better Java, whereas Scala is much, much more.

Scala is still my go-to JVM languages, but one Kotlin use case for me is to write libraries that will be called from Java [1]. Its biggest advantage is that it's succinct, has useful functional features (e.g. Scala-like collections), while producing code signatures that's very close to Java.

Notes:

[1] https://github.com/builtamont-oss/cassandra-migration

Yeah, this is another problem that I had. Plenty of full-tower cases these days support EATX, but SSI-EEB not so much (at least, the ones that can support it out-of-the-box).

In the end, I went with one of the Phanteks Enthoo [1] cases. Decent quality without breaking the bank :)

Notes:

[1] http://www.phanteks.com/enthoo-pro.html

For me it brings a lot of benefits: easier to find parts, consumer-level parts pricing, and lower TDP.

I'm running a dual Xeon as you mentioned, through buying ex-fleet parts at less than half price of new ones. Several issues I experienced:

- Lack of motherboard options. I had to purchase new motherboard at a high price since the ones that support dual Xeons are either in an incompatible form factor or simply out-of-stock. I settled with Asus Z9PE-D8 WS with an SSI-EEB form factor.

- Outdated BIOS. I had to order a new, pre-flashed, BIOS chip since the BIOS that came with the motherboard refused to boot with the CPU and memory combo.

- Hard to find suitable ECC RAM. The motherboard only supports limited RAM (speed + latency) configs, and finding those is becoming harder. Availability looks seasonal at times.

- Needs capable power supply. One thing that people often look past is the need of a proper PSU. I had to upgrade to one which support two CPU power connectors.

Functional programming has nothing to do with declarative/imperative programming styles.

The "functional" part determines the architecture by which the code is structured opposed to the style (vanity) by which the structure comes together.

I think it means a code can be functional but looks imperative. One example is the for-comprehension in Scala:

    val aFuture = future(a)
    val bFuture = future(b)

    (for {
      a <- aFuture
      b <- bFuture
      c <- futureC(a, b)
    } yield c)
This is just a contrived example for working with `Future[T]`, but it can be applied to other monadic types.

For an example library that can be used with a few different styles, have a look at this: http://jsuereth.com/scala-arm/usage.html

Marvel Comics recently fired an illustrator for hiding Islamist, anti-Semitic and anti-Christian references in his art. His ideas were "normal" in his country - should that have been ignored? Reprimanded as long as he kept his politics out of his art?

Indonesian here, I'm not sure to what you attribute it to a normal view by Indonesians?

I think the JVM is a really good runtime, and somehow its poor reputation came from Java applet security holes and the verbosity of the Java language.

And no, I don't think you are crazy. I had a really bad experience trying out Spring for the first time (with ant task, etc.). I was pulling my hair out and it turned me off Java for a few years before discovering Play Framework v1 (the original Java version).

How long ago was your experience with the build system? These days you can bootstrap a new project with Gradle, Leiningen, or SBT pretty easily.

In terms of language: yes, you are correct.

I had seriously contemplated switching to F# before Scala, and attended a full-day workshop for it, however the dealbreaker for me was the poor tooling support (this was around 2011). After switching to Scala, there was very little reason for me to come back to the .NET ecosystem.

I had been working in the Windows / .NET ecosystem for almost a decade prior to my current role. I always thought C# was a nice language to work in, CLR is a really capable runtime, and Visual Studio is one of the best IDE out there. But my observations is that C# in .NET core seemed to appeal only to existing C# / .NET devs.

I am excited for the new functional features coming in C# 7, but to be honest, these days it would not be my first choice of language when starting a new project. That choice falls to Scala due to its versatility:

- Blending of OO and FP.

- Works in backend, frontend (ScalaJS), or compile to native.

- Multi-discipline applications, e.g. web apps, data science, scientific computing, etc.

One of the biggest benefit as well, is that it leverages the JVM ecosystem. Big, mature community and choice is abundant. This is actually one of the things that really struck me when first working in it (JVM). It seems like you always have at least three choice for anything, that to most extent works well with each other:

- Alternative languages: Scala, Kotlin, Clojure, etc.

- Build system: Maven, Gradle, SBT, etc.

- GC: HotSpot, Zulu / Zing, Shenandoah, etc.

I'm not sure why you attribute this to self-importance. It's a real risk and a fair concern. USA border and immigration officers sounds hostile and antagonising from the stories I heard on Twitter (over the course of the past week).

It will take me close to 24 hours to reach American soil. Depending on my luck, I might either:

a) pass without issue, or

b) hand over my phone and passwords and/or complete CS puzzles (which may also include period of detainment)

They can turn me back for any reasons and I would have lost thousands of dollars: if my answers were unsatisfactory, if there were some prejudice against my look, or even if the officer(s) were having a bad day.

There's an overview with data and sources in another section of the website [1].

I think the key difference in Australia and USA is that the Australian government, due to our extensive Medicare coverage [2], bears most of healthcare burden for smokers. Thus, for Australians, paying for smokers' medical costs nearing their end of life is more expensive than keeping them healthy.

[1] http://www.tobaccoinaustralia.org.au/chapter-17-economics/17...

[2] http://www.sbs.com.au/news/article/2014/02/20/how-does-austr...

I use Codeship [1] for personal (private) project and Travis CI [2] for open source ones. I had also use AppVeyor [3] for one of my Windows web app project.

I chose Codeship since it was the only one (at the time) that had BitBucket integration. The free tier (100 builds / mo) was more than enough for my side projects. In addition, it supports a lot of deployment targets (e.g. ElasticBeanstalk and Heroku).

I use Travis CI for open source projects initially since it is what everyone uses :) However, one feature that I find really useful is the test matrix. I used it to test my project against different Java version and Cassandra distribution versions [4].

I use AppVeyor on one of my side project (which lies dormant now) since needing to test against both *nix and Windows build (a .NET / Mono web application).

[1] https://codeship.com/

[2] https://travis-ci.org/

[3] https://www.appveyor.com/

[4] https://github.com/builtamont-oss/cassandra-migration

Thanks! I agree Ruby looks to be far user-friendly in this context.

Just to add, my work revolves around the JVM ecosystem, but mostly in Scala and some Kotlin... Both already provide a nicer interface for Java :) e.g. in the context of collections both have `list.head` or `list.first` and `list.last`.

You get to use Ruby, which [...] remains the most extraordinarily beautiful and luxurious language I’ve yet to encounter.

I've used Ruby sporadically as gap-fill in small projects, but I didn't feel the language has any qualities that sets it apart from others.

Perhaps I missed something, any Ruby devs care to comment?

From OS X to Ubuntu 10 years ago

If you know f.lux, RedShift is an alternative to it for Linux.

Good to know there's an alternative, but to clarify: f.lux is available on Linux as well (the statement makes it as if it weren't, just not open-source).

You're making the assumption that other teams and other leaders won't review your docs. In my experience, they do and always come back with more questions.

If you do suspect ...

And that's exactly it. If I suspect something then of course I can communicate it directly or redesign, but we're trying to assess impact on areas I might not have no awareness of.

So let's put it in another way:

Design docs is one of many formal methods of communication in any organisation. It preserves context, change history, and a good part of risk management. It protects you and potentially saves downstream rework.