9 ms·
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 interest
by elviejo 7y ago
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.
- tfleming 7y agoWhat was it about JavaScript that wanted you to leave programming? I'm just curious.
- airstrike 7y ago0.1 + 0.2 → 0.30000000000000004
- dkulchenko 7y agoThat'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 >>>
- yellowapple 7y agoInterestingly, 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 <http://www.sbcl.org/>. 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
- reitzensteinm 7y agoUnless they're using an alternate exact representation for floats by default, that's just rounding them when printing.
- yellowapple 7y agoThat'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/ 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 7y agoIt depends. Do you want deterministic compute time? Then you have to settle for something inaccurate.
- reitzensteinm 7y agoI am aware of numeric towers and actually checked whether that was going on. sbcl 1.4.16 uses single floats: https://ideone.com/ruw5qi 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 7y agosbcl (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.
- 7y ago
- airstrike 7y agoI know, it was just a tongue-in-cheek comment but oh well
- deleted 7y ago[deleted]
- aportnoy 7y agoThat’s because you are running it on hardware implementing IEEE 754 floating point.
- tomg 7y agoAs 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_k 7y ago'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 https://github.com/phoenixframework/phoenix_live_view
- 7y ago
- awayfrommypc 7y ago12+ 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.
- mrfusion 7y agoWhat’s wrong with js?
- bexsella 7y agoNot 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 7y ago>where else can you get a GLES window up in 3 lines of code? Everywhere somebody built an abstraction to do it. #include <SDL.h> ........... SDL_Init(SDL_INIT_VIDEO); SDL_Window *window = SDL_CreateWindow("MyApp", 0, 0, 1920, 1080, 0);
- wlll 7y agoIt'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/ 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.
- kylestewart 7y agoJumping 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.
- TurboHaskal 7y agoForth 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...
- irchans 7y agoI used to love Forth. I haven't written Forth code since the 80's. Maybe it's time to try it again.
- jolmg 7y agoBesides trying out new languages and paradigms, I would also suggest programming things of a kind different from what OP's used to. For example, if they mainly do CRUD webapps at work, maybe they can start looking into creating games, a language, (programmed) music, screensavers, etc. Whatever they think is cool. It doesn't need to be big.
- simplify 7y agoI second the nod to logic programming. I've been working on a board game engine in Prolog as a side project, and I'm having the most fun programming I've had in a very long time :)
- TomMarius 7y agoCan you recommend some prolog learning resources? I googled a lot but it's still kinda hard for me to grok - especially CLP.
- simplify 7y agoI recommend starting with [0] to get a feel for what's possible. [1] is great when you have time to dive deeper. [2] is good motivation, and [3] will show you how to build a practical roles & permissions system. Keep in mind that you don't have to build your app in 100% prolog to use prolog. There are likely implementations in your favorite language. For example, Rust[a] JavaScript[b], and Ruby[c]. [0] https://learnxinyminutes.com/docs/prolog/ https://learnxinyminutes.com/docs/prolog/ [1] https://www.metalevel.at/prolog https://www.metalevel.at/prolog [2] https://youtu.be/G_eYTctGZw8 https://youtu.be/G_eYTctGZw8 [3] https://github.com/TheClause/learn-prolog/blob/master/articles/roles-permissions-1.md https://github.com/TheClause/learn-prolog/blob/master/articl... [a] https://github.com/mthom/scryer-prolog https://github.com/mthom/scryer-prolog [b] http://tau-prolog.org/ http://tau-prolog.org/ [c] https://github.com/preston/ruby-prolog https://github.com/preston/ruby-prolog
- TomMarius 7y agoThank you!
- ramblerman 7y agoThis is going to be personal and dependent on the person, but for me the opposite advice was useful. I.e. stop programming for the sake of programming. A new paradigm, language or methodology to be more efficient. Instead solve problems, and use the tools at hand, my excitement from programming originally was the idea that I could build anything.
- ollysb 7y agoCouldn't agree more with this. After 15 years of OO with Java/Ruby/Javascript I switched to Elixir and Elm and have really enjoyed not just the freshness of something new but the elegance of the more mathematical approach that functional programming leans on. 3 years on and I'm enjoying coding more now than I ever have.
- soulnothing 7y agoWhen I first started learning to program. Every three months I switched languages/stacks, re-implemented a project in that language. Trying to learn the different approaches to development. I also brought this on when I was a tech lead. Twice a month we would do code katas. Where we would do exercises together in a new language, or library. To continue learning, see if we could do things better. I ended up in a similar place Functional(ocaml/ML) and multi platform (shared code for back end, mobile, web, and ops). One of the problems I'm having right now, and is making me want to leave software. I can't find many roles that match that style. My brain hard locks when I try and go back to OOP at this point. I love programming, and working with the community. But right now I feel like I'm banging my head into a wall. Has any one else had this problem?