ladco

ladco

Hi,

I have proficiency in Java. I came to know about elixir and phoenix. I liked language and got pretty excited. I need to build a REST based backend server for my startup. I was thinking of using phoenix but as I started rethinking in functional way is getting difficult. Most of the time I start thinking in imperative way of solving.

This is hampering progress on my work. Anybody, who was in the same boat, what did you do. Any help/comments is appreciated.

First 10 of 17 Posts Switch mode

lukerandall

lukerandall

I suggest you examine what you’re looking for from your startup. Is it to learn new languages & programming paradigms and to have fun, or to validate a business idea?

If it’s the former, great. Keep going with Elixir, ask questions when you get stuck and have fun. If the latter, I suspect using a language you’re not proficient with is a mistake. You’re validating an idea, odds are you’re going to throw away or rewrite the code you’re currently writing. Use the language that you’re most productive in, so you can get to that stage sooner.

easco

easco

I will echo what @lukerandall said. “Startup” implies that you have money - perhaps your livelihood, on the line. In that case go with what you know.

Now to your point of retooling your thinking. Making the move from the Object Oriented paradigm to the functional paradigm is difficult. For the folks I know who have worked through it, there is not really any special trick. It takes practice, plain and simple.

What worked well for me was working my way through a lot of small problems - using something like exercism (http://exercism.io). With the way functions compose it seemed to work well for me to try little things and then build them together into bigger constructs. I also spent time using Functional Paradigms in applications that were otherwise Object Oriented (Swift and Objective-C in my case). After a while you get a good feel for when a problem is particularly suited to the Functional Paradigm which helps.

ladco

ladco OP

Thanks luke. I have been thinking of moving to Java but after coding in Elixir, Java looks very verbose. But yes, I think I will be more productive and validate idea.

febeling

febeling

Definitely avoid transitioning from OO programmer to functional programmer at the same time as you transition from engineer to entrepreneur. Both are quite challenging endeavours, which you’re better off tackling one after the other.

CptnKirk

CptnKirk

As others have said, for a startup, go with what you know. Nobody here is going to think less of you for picking something you’re used to for your, everything is on the line, startup. At least if that thing is Java.

That said, if you want a little help thinking in Elixir, I recommend this course: https://pragdave.me/. It helped me.

Aside from that. As my hero, Joe Armstrong, says, “Make it work, then make it beautiful, then make it fast”. Elixir forces you to think in terms of Data + Data Processing. I find that I can program Elixir like I would Java, then look at my working code and try and make it beautiful. Once you get the hang of porting your large imperative functions to smaller, piped, sometimes recursive, functions, you’ll start to think in terms of “native” Elixir idioms more and more often.

Phoenix is a web toolkit (some would call it a framework). Play is a fine alternative for the JVM. I am enjoying my Elixir journey, however it took me many months to become comfortable enough with Elixir and the ecosystem of libraries to bet my reputation and livelihood on it. If you don’t have that kind of time for exploration, then I’d advise you to stick with Java, and keep learning Elixir in your spare time.

tckb

tckb

Welcome to FP world!
@ladco as a full time Java developer and a beginner in FP. This is what I would suggest:

With the gears shifting in Java, as you already know, you can always write Java in Functional way. This is how I started in FP, before even discovering elixir/erlang. I do program almost regularly in elixir, for practicing as a hobby.

When you are starting something of your own, you quickly need an MVP or might try out an interesting idea. The point is your TAT could be in the matter of hours or days, and this could be a matter of getting a new customer or packing up!

So, this is at-most important: YOU NEED TO BE PRODUCTIVE! you don’t have time to debug some unknown exception that popped up in production and have clueless about it. I think if you are still exploring, I would still advice you to look around, not just pick the first thing you see. Phoenix is a great framework, I’d love for what I can do, but for designing just REST apis, it just might a bit bloated (may be I wrong?)

anyways, here’s the bottom line:

You use Java to design your apis (It’s verbose? yes – but it just works. if bothered too much, then switch to scala/play) and put it production. then, on the side, you can test the same with phoenix on the side – in dev. With startup, I believe your budget will also be limited.

Good luck!
Chandra

PS: you can always ping me if you need any help with Java :wink:

Almog

Almog

I really believe in choosing the tech for the problem and not about what is popular. So for example if you need a real-time app then something like Elixir or Meteor.js might, if your doing something that needs machine learning your better off using Python. Just find out what you need a go from there.

Also for startup and MVP’s is not about having everything perfect it’s about get a first version out there. Keep it simple

mbuhot

mbuhot

If you know Java but are interested in some functional features then Kotlin might be worth a look.

You can easily make your data classes immutable and transform them with map/filter/reduce operations, and use well known Java frameworks as needed.

tx8

tx8

I would suggest to go with what you know best, except if you have people experienced with Elixir/Erlang on your team who could guide you through.

Some tips from me to enhance Java experience:

  • Use Project Lombok to prevent Java boilerplate in your source code files.
  • Get familiar with FP in Java (Functional Interfaces/Lambdas/Streams…).
  • Use good IDE, if you currently not using it with Java. Intellij has Distraction Free Mode for those who like clean look.

Java has some good frameworks as well. From simple Java Spark or Ninja to full-fledged Spring (It supports Reactor).
If you need to use Actor model you could use Akka. (Could be integrated to the Spring Framework as well.)

mkunikow

mkunikow

For startup use … cloud, something you can easy and fast prototype :slight_smile:

if you want to go java route … you can check https://www.jhipster.tech/

Or Kotlin instead Java

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New

We're in Beta

About us Mission Statement