Git Product home page Git Product logo

Comments (10)

jedwards1211 avatar jedwards1211 commented on June 2, 2024 3

Googling for "elm breakpoints", I didn't find much. But I found a few posts on the google groups for Elm. One user summarizes my biggest reservation about using Elm in production-scale web apps:

Elm, as great as it is, doesn't save you from debugging every once in a while. The one option we have now, is logging. Logging is great, but it can quickly become painful in loops. Since Elm compiles to a single JS file with long mangled names, setting a breakpoint from the code would sometimes be the simplest way to properly debug your code. The generated JS isn't that hard to understand either, it's a series of vars and function calls for the most part.

from learn-elm.

SimonLab avatar SimonLab commented on June 2, 2024 3

It seems that more debugging tools will be available also on the next version of elm (0.18): https://youtu.be/DSjbTC-hvqQ?list=PLglJM3BYAMPH2zuz1nbKHQyeawE4SN0Cd&t=1633

from learn-elm.

jedwards1211 avatar jedwards1211 commented on June 2, 2024 1

@nelsonic yeah if I remember correctly that was the inspiration for the redux dev tools, which do essentially the same thing, though in my experience with a complex app with a high volume of events, it was quite slow :(

And the time traveling debugger is great but it's only half of the battle; what's missing from that demo is putting breakpoints in the code and stepping through to see what went wrong when some action was mishandled.

from learn-elm.

jedwards1211 avatar jedwards1211 commented on June 2, 2024 1

@nelsonic surprisingly Evan Czaplicki claims that few companies in production have much of a need for source maps so they aren't a priority right now. I don't yet understand what about Elm enables them to avoid using any source maps. I asked him about it in that thread.

from learn-elm.

jedwards1211 avatar jedwards1211 commented on June 2, 2024 1

Yes, importing/exporting history is very helpful and fortunately possible with Redux as well.

from learn-elm.

nelsonic avatar nelsonic commented on June 2, 2024

@jedwards1211 really good question! (thank you for asking it!)
I think debugging is where elm-lang truly shines...! see: http://debug.elm-lang.org/

In fact if the elm debugger was available for JS/IE (let's face it Internet Explorer is still where most of our time consuming bugs are...!) it would make my life (debugging other people's code) so much better!
But, the only way we can show the power of the elm debugging experience is with a video ...

For a micro-intro to "Elm Reactor" see: elm-reactor: a Time Travelling Debugger https://youtu.be/vS3yzUo7l8Y

If you want to have your mind blown watch "Code is the Easy Part" by @evancz where he demos the next iteration of the Elm debugger: https://youtu.be/DSjbTC-hvqQ?t=27m17s

from learn-elm.

nelsonic avatar nelsonic commented on June 2, 2024

@jedwards1211 thank you so much for digging into the debugging "story"... ❤️ ✅

from learn-elm.

nelsonic avatar nelsonic commented on June 2, 2024

@SimonLab yeah, v0.18 looks very promising from a Debugging (& "QA") perspective. 😉
I think @jedwards1211 was more focussed on the ability to use "break points" in the code and step through it: https://developers.google.com/web/tools/chrome-devtools/javascript/add-breakpoints
But in my (probably naive) view writing smaller ("pure") functions and having a (really) smart compiler that looks for typos and type errors will go a long way toward improving the debugging story ... while this does not directly answer the question @jedwards1211 originally asked - and I think we should continue to ask it - I'm still optimistic ... 🌈

from learn-elm.

nelsonic avatar nelsonic commented on June 2, 2024

@jedwards1211 this might interest you: http://elm-lang.org/blog/the-perfect-bug-report 🤔

from learn-elm.

nelsonic avatar nelsonic commented on June 2, 2024

@jedwards1211, indeed, Dan Abramov did a great job of "porting" the elm debugger to Redux. 😉

from learn-elm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.