Lurker News
I remember in my teens I used to love programming. After 20 years of a career, I don't enjoy it anymore.

Have you rediscovered the joy of programming? Any advice?

Comments (329) 141 threads

Show all comments

Showing thread 4 of 141

elviejo8 replies#
Programming is 1,000 room hotel of which we live in only one.

I recommend you study different programming paradigms because in them we can find really interesting approaches to solve problems.
For me those have been:
- functional programming (with Haskell) - logic programming (prolog) - Constraint Programming with the excellent Coursera class on minizinc.
Those paradigms made programming fun again for me.
PS: I also stay away from JavaScript... When I was working with JS.. I was seriously considering leaving programming... Thankfully I changed jobs and I haven't had to touch it anymore.

tfleming3 replies#
What was it about JavaScript that wanted you to leave programming? I'm just curious.
airstrike2 replies#

    0.1 + 0.2 → 0.30000000000000004
dkulchenko2 replies#
That's not unique to JS.

  $ irb
  irb(main):001:0> 0.1 + 0.2
  => 0.30000000000000004
  irb(main):002:0>


  $ iex
  Erlang/OTP 22 [erts-10.6.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [hipe]

  Interactive Elixir (1.10.2) - press Ctrl+C to exit (type h() ENTER for help)
  iex(1)> 0.1 + 0.2
  0.30000000000000004
  iex(2)>

  $ python
  Python 2.7.17 (default, Dec  2 2019, 13:23:33)
  [GCC 4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.33.12)] on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  >>> 0.1 + 0.2
  0.30000000000000004
  >>>
yellowapple4 replies#
Interestingly, though, some languages get it right:

    northrup@Topaz:~/Desktop$ perl -de1

    Loading DB routines from perl5db.pl version 1.55
    Editor support available.

    Enter h or 'h h' for help, or 'man perldebug' for more help.

    main::(-e:1): 1
      DB<1> say 0.1 + 0.2
    0.3
[…]

    northrup@Topaz:~$ csi
    CHICKEN
    (c) 2008-2019, The CHICKEN Team
    (c) 2000-2007, Felix L. Winkelmann
    Version 5.1.0 (rev 8e62f718)
    linux-unix-gnu-x86-64 [ 64bit dload ptables ]

    #;1> (+ 0.1 0.2)
    0.3
[…]

    northrup@Topaz:~$ sbcl
    This is SBCL 1.5.8, an implementation of ANSI Common Lisp.
    More information about SBCL is available at .

    SBCL is free software, provided as is, with absolutely no warranty.
    It is mostly in the public domain; some portions are provided under
    BSD-style licenses.  See the CREDITS and COPYING files in the
    distribution for more information.
    * (+ 0.1 0.2)
    0.3
reitzensteinm1 reply#
Unless they're using an alternate exact representation for floats by default, that's just rounding them when printing.
yellowapple3 replies#
That's a fair point about the Perl example, but Scheme and Common Lisp (including both Chicken and SBCL, last I checked) support (if not outright require) full numeric towers with rational number types, so these are indeed exact representations (unless you explicitly request binary floats for e.g. performance reasons) and not just rounding during printing.

There are lots of other examples of doing it "right" (using more suitable numeric types) over at https://0.30000000000000004.com/ (alongside a bunch of examples that, to your point, just round, or to the GP's point, just stick to binary floats).

dnautics#
It depends. Do you want deterministic compute time? Then you have to settle for something inaccurate.
reitzensteinm3 replies#
I am aware of numeric towers and actually checked whether that was going on.

sbcl 1.4.16 uses single floats: https://ideone.com/ruw5qi
I don't know enough about Scheme to dig under the covers to see how it's being represented internally.

verandacoffee#
sbcl (and other Common Lisps) uses what you want it to use: read-default-float-format

(setf read-default-float-format 'single-float) (+ 0.1 0.2) => 0.3
(setf read-default-float-format 'double-float) (+ 0.1 0.2) => 0.30000000000000004
On LispWorks 7.0 I get 0.30000000000000005 for double-float. Hmm.

sjamaan#
Scheme is the same. If you type a number with a dot in it, you'll get an "inexact" number, which is floating point. If you prefix it with #e, you'll get an exact representation of the entered number (so, e.g. #e0.1 gives you 1/10)

The output of inexact numbers is typically truncated. In CHICKEN, you can use flonum-print-precision to tweak that. In an example, straight from the manual:

    > (flonum-print-precision 17)
    > 0.1
    0.10000000000000001
yellowapple#
Per my other comment, SBCL's defaults still cause (= (- (+ 0.1 0.2) 0.3) 0) → T. I guess they're technically floats (or at the very least not rationals) given that (= 0.3 3/10) → NIL.
fiddlerwoaroof4 replies#
Yeah, in CL the 0.1 is read syntax for a float (IEEE-754ish on most modern implementations.) If you want exactly 0.1, you’d have to say 1/10. The printer is probably cheating and rounding to the output you expect (I think Python 3 may do this now?)

Aside from financial applications, there’s very little reason to care about the trailing remainder.

Continue this thread — 4 replies

jolmg#
I don't think it's so much a matter of getting it right as much as it is about preferring the performance gain and ease of use of hardware-accelerated constant-space floating-point numbers. At least, that was probably the case when programming in something like C/C++. I don't imagine there's much point to it in ruby or python for example, other than that floating-point is standard by now.
voldacar#
Comparing lisps with their full numeric towers to run of the mill procedural languages is a little unfair ;)
bbv-if1 reply#
I have burnt myself once with perl: numbers that are printed the same are not necessarily equal.

  DB<1> say((0.1+0.2) != 0.3)
  1

Continue this thread — 1 reply

airstrike#
I know, it was just a tongue-in-cheek comment but oh well
aportnoy#
That’s because you are running it on hardware implementing IEEE 754 floating point.
tomg11 replies#
As someone considering leaving the web development industry after 12 years:

JavaScript is a never ending grind.
Callbacks, then Bluebird, then Promises, then a sync await.
a new testing framework every six months. a new web framework every couple of years. aimless, massive changes to the language (classes in a prototyped language? Why not).
JavaScript then coffeescript then three versions of typescript. too many UI libraries to mention.
JavaScript on the server? the people making the most popular web framework abandoned it 5 years ago but who cares?!
paradigms that make no sense (react morphing from a UI library to the full app). a million ways to manage state.
then you have a few big players calling all the shots (FB, MS). I guess we use functional components now. Eurasia has always been at war with Oceana.
It’s tiring. I’ve spent my entire career doing this stuff; and I’m never quite good enough before The Next Big Thing comes along.
I know things change over time everywhere, but it’s hard to imagine anything moving faster with less purpose than the JS ecosystem.
(Apologies for typos and grammar; I’m on my phone)

jeremy_k1 reply#
'JavaScript is a never ending grind' - Wow no better way to summarize it than that. The funny thing is that I've always felt that Javascript the language is pretty straight forward and easy to comprehend. As someone who primarily writes Ruby and really appreciates the functional style of writing code, Javascript lends itself to that style very easily.

But the ecosystem around is just that never ending grind. At my last job, over the 3 or so years I was working fully stack, it was just a constant churn. Start with React / Redux / SRR / Jest / Mocha / (probably some other testing frameworks) / Flow. By the end none of the original testing frameworks were being used. React had introduced Hooks, which I actually like, but it was a whole new paradigm to learn again. Flow was out and we needed to migrate to Typescript as quick as possible. And this is just the React ecosystem!
React has its place and I'm definitely comfortable working with it (also writing 0 tests cause I have no idea where to even start for that) but I'm looking forward to the day maybe simple web apps get back to simple setups. Projects like LiveView[0] for Phoenix really give that hope.
[0] - https://github.com/phoenixframework/phoenix_live_view

Continue this thread — 1 reply

munificent1 reply#
It's like you have to constantly keep learning, but nothing you learn really matters in any deep way. It's just new names and APIs for the same stuff, month after month.

Imagine if you were a woodworker making furniture. You make the same furniture every day and love your craft. But every month, someone shows up, takes all your hand tools, and replaces them all with a set that are mostly the same but slightly different and all have completely different names.

Continue this thread — 1 reply

DeathArrow#
I was a game developer and I pretty much grew to dislike what I had to do at my former job. Doing same kind of mindless games, over, and over and over and pretty much repeating things.

I got into web development, but for me that means mostly back end. I pretty much dislike big opinionated JS frameworks like Angular, although I have to learn it and I will since I took over a project which uses Angular on front-end. Sometimes I generate HTML on the server side, when I can, using a bit of old fashioned JS and jQuery where is needed. Sometimes I write a REST API for backend and write the frontend using good old fashioned HTML, CSS, JS and jQuery. I like this two approaches the most.
Now I'm planning to learn Blazor and Vue for SPA development.

csallen8 replies#
A lot of this is a direct result of feeling that one always needs to be on the bleeding edge, which is both unnecessary and also a recipe for wasting time on fads.

As an analogy, consider fiction. Imagine reading as many new novels as possible as they're released. Well, most of these novels will be completely irrelevant 5 years from now. The good ones stand the test of time. So you might as well only read novels that are 5+ years old, yet are still relevant and receive acclaim.
If you worry that taking this approach with JavaScript will make you fall behind, my question is: Behind whom, exactly?
There's no way many in the industry can keep up with all the changes you listed as fast as they're coming out. Therefore, it follows that a great many of your JS developer peers are "behind." Therefore, it's okay for you to be, too.
What happens to me, personally, is I start on some new project or company using a pretty recent stack at the time. Over the course of the next few years, that stack becomes "outdated" as new things are released. However, it also matures as its documentation improves and its community grows. Eventually, after 2-5 years, I move on to another project, and just take that time to catch up on the latest. The result is that I end up skipping a lot of the fads that die on the vine. For example, I largely missed CoffeeScript.
I think a lot of pain from JS comes from the expectation that one can and should keep up, when you probably can't, and definitely shouldn't.

Continue this thread — 8 replies

jamil71 reply#
Well said, I was close to 8 years in web development and jumped ship a little over a year ago. Working in javascript development felt like a hamster wheel but maybe I just needed something different.

Continue this thread — 1 reply

wastedhours#
I can't empathise with it being a grind - keeping up with the latest developments only makes sense if you need to for your job or the new thing brings something genuinely useful.

However, JavaScript as application code just feels entirely verbose. I guess coming from a very opinionated framework like Rails leaves you sheltered, but I'd rather use a technology designed for the task I'm trying to accomplish than to shoehorn JS into something else.
Personally I find no elegance in JS, and writing it feels like a chore. If I had to do that daily I'd want to quit too. Obviously YMMV, but I get no joy in trying to fit the tool to the job, I'd rather just use another tool.
One of the reasons it's so popular is because JS is like Latin. If you know some words from one Latinate language, you could blag your way around half of Europe, probably order a meal and find directions. If you know some JS syntax, you can scrape by using half the tools out there today, and accomplish a bunch of different things.
If you want to go and live somewhere though, it's better to learn the native tongue.

tomxor3 replies#
I'm one of those "weirdos" who loves writing JS, and yet I agree with everything you just said being horrible. But I enjoy writing plain JS, that doesn't mean react, angular... i've run out of examples because I honestly don't care about those things.

However, I'm in a position where I have enough autonomy to avoid all that crap and just use the bits I like. When you get minimal and ignore all of the noise about the latest hotness JS libraries, the plain language (not including the lanky browser APIs) is not unpleasant especially over the last few years where some modern syntactic features were added - You can go even further and be selective of the language itself and it can get even more pleasantly minimal, my recent delight has been excluding classes and prototypes as much as possible.
When you take this approach the whole "churn" issue disappears (JS is backwards compatible, you will never have the issues you have with Rust or Elm forcing you to re-write).
I suppose this is the argument many make for C++ which is that, yes it can be a complex nightmare, or (if you are able) you can restrict yourself to a desirable subset and have a happy time. In JS's case, most of the complexity is from "keeping up" with the community and libraries, not the core language itself.

Continue this thread — 3 replies

emilecantin1 reply#
Maybe I haven't been doing this for long enough (~8 years), but I think we're starting to see a plateau in JS-land.

I jumped into React early-on (5 years ago), and it's still going strong, and has been for way longer than Angular / Backbone / ExtJs ever did.
I wouldn't say Express is abandoned, I feel it's more that it's "matured". I mean what else can you add / improve?
State management is still an un-settled area; 2 years ago it seemed like Redux was the best choice, but GraphQL / Apollo is eating its lunch. However, when you think about it it still follows a similar conceptual model, but making it even more declarative: You have your "store" (the query result), and you dispatch "actions" to modify that store (the mutations). You just don't have to dispatch an action to fetch data from the server anymore; Apollo handles that for you.
It's true that JS churned very fast for a long time, but I'm seeing signs of it slowing down as problem areas become "settled" one-by-one.

Continue this thread — 1 reply

reinvanim#
I felt exactly the same thing the last few weeks but I have no idea what to do with it. Not sure how I would approach transitioning to another role really.
say-vagnes#
I've found that this grind is conquerable. There are only so many ways to go before you start to see the fundamental patterns, and friction in picking up anything new becomes seriously minimal. It's like how some other comments are, talking about how most of programming is really just data access and some clever gluing of frameworks. Or like how there are already software patterns, especially in OP.

My point is, you start to glimpse these overarching patterns as you interact with different takes, and you learn what works and what doesn't, ultimately empowering you to intelligently make tradeoffs or designs of your own. The chaos of web development is, IMO, because it was a new frontier, and a lot of inexperienced leadership occurred. This was compounded by bootcamps churning out people experienced only in Framework X, causing poor re-implementations of nearly _everything else_ inside Framework X.
It sounds like you feel like you _have_ to keep up with these things - perhaps someone else on the team is constantly insisting on migration, but they don't have to go through and tediously migrate and test everything. I'd suspect this lack of autonomy is at the core of your dissatisfaction. You can, and should, say no to a lot of trends, and if you do pick up something new, you should be able to clearly articulate why it's valuable, and these values should be more than superficial.
Another thing worth noting is that the release you work on today is the "legacy, painful" code of tomorrow. But that's a good problem to have - it got the job done. It just happened to get it done in one way, when there are really N ways, and so obviously the numbers game will work against you eventually, even in the imaginary case where the implementation is perfect.

cdeutsch#
Nailed it!

I've been programming professionally for 20 years and doing exclusively frontend with React since about 2014.
After the whole React Hooks thing, I can't freaking wait to do something else; and I'm absolutely livid with their decision to promote Hooks.
They should have forked React instead of introducing that into a somewhat mature ecosystem. Already went through this fractured bullshit with Coffeescript, and a million other frameworks of the moment. The JS community just doesn't learn, and when you see a big player like Facebook making the same mistakes, there really isn't much hope.

awayfrommypc#
12+ years PHP and simple JavaScript programmer here. I loved programming and building websites.

Then I got into modern JavaScript with Reactjs, Nodejs, TypeScript, and other mess. Initially, I was excited because that's what everyone was and still is talking about and I love learning new things.
But it is too ugly in JavaScript land. People make fun of PHP but with PSR standards it is easy to enforce coding standards. In JavaScript land, everyone has their own standards, no easy way to enforce them, but most people don't follow their own standards. It is ugly spaghetti code mostly. Debugging tool is browser which makes it nearly impossible to troubleshoot when you are dealing with tons of minimized libraries. And even when you are dealing with simplest tasks JS developers start looking for libraries instead of just writing 5 line function.
I was ready to leave programming for management or other jobs but changed my mind and learning embedded systems, game dev, and some other cool techs. Hoping to transition to robotics or something else soon.

mrfusion2 replies#
What’s wrong with js?
bexsella1 reply#
Not OP, but I personally could not use JS, and would outright refuse to use, in production. It's fraught with headaches that seem trivial but drastically change control flow, == and === being my favourite example. Linters help, but it feels like a band-aid solution.

I've had good fun with JS in my own time (where else can you get a GLES window up in 3 lines of code?), and I've written my fair share of helper application that notify me of certain album releases. But I would never ship something using it (and in fact I generally switch to Dart if I get serious enough about a web project, another band-aid solution). It could be preference, or it could be the years of embedded programming expecting timely results with minimum overhead (make no mistake, a modern web browser is a hell of an overhead).

DeathArrow#
>where else can you get a GLES window up in 3 lines of code?

Everywhere somebody built an abstraction to do it.
#include
...........
SDL_Init(SDL_INIT_VIDEO);
SDL_Window *window = SDL_CreateWindow("MyApp", 0, 0, 1920, 1080, 0);

wlll1 reply#
It's rushed half-finished edge case riddled language with awful tooling. Some of the issues are outlined here: https://blogtitle.github.io/lets-talk-about-javascript/

Of the many programming languages I have used over the last 20 years, there are several I prefer, several I would rather not use, but PHP and Javascript are the only two I refuse to ever touch again because they are so utterly unpleasant to write anything in.
It also makes my life as an end user miserable on the web on account of the gigantic gobs of program I have to download to make even simple websites work these days, when most could work just as well as a simple HTML page served from a server that didn't somehow manage to spin the fans on my powerful laptop just so it could show me some fancy font and I utterly resent the language, and the developers choice of it for forcing this on me.
Apart from all that, there's nothing wrong with Javascript at all.

DeathArrow1 reply#
I find it ok for it's intended original use, which is browser scripting. It's totally fine to write small JS scripts to make the pages a bit more interactive.

People got it wrong when they started writing huge applications in JS.
Just because a language is Turing complete, it doesn't mean it's fitted for everything.
It's like you did your job fine as a carpenter using carpenter's tools and you get a dentist job, but you insist on using carpenter's tools because you already know them.

Continue this thread — 1 reply

kylestewart1 reply#
Jumping in this post to recommend the exact same idea. Learn a new language outside the type of language you're used to using. I've been using my extra time indoors to learn Clojure and Forth. The things I'm learning are already changing the way I write Swift. I'm also excited about making things on microcontrollers again because Forth gives me a way to escape the horrible tooling forced on us by the chip manufacturers.
TurboHaskal1 reply#
Forth was the answer, at least for me.

It's hard to explain, but no other language has given me such joy in perhaps decades.
If you look back on those times where you just had a booklet and a simple BASIC interpreter or C64 Assembler crafting your tiny little applications and games without third party libraries, distracting ceremony and best-practices anxiety. Those times where you could be so proud of every little achievement because it was truly yours, and that for some reason felt your most productive years... Then you might want to give it a go.
Just don't fall for the trap of developing your own Forth. Even if that's part of the philosophy of it :)
Now I just wished there was a book akin to "Land of Lisp" but in Forth. Maybe one should...

Continue this thread — 1 reply

Continue this thread — 5 more replies