1. 2

    Until a couple of months ago, I was kind of looking for something like this to get my son started in programming. I ended up using a Raspberry Pi with a C64 emulator using retropie.

    I used to think that learning BASIC was the best way to get into programming because that’s how I got into it. Only recently have I realized that learning BASIC worked in the 80s and 90s when technology was just more limited. You would turn on a computer and you would be met with a monochromatic prompt. I remember learning how to use BASIC to change the text color on the screen and it blew my mind and prompted me to keep exploring.

    I bought the old book that I used when I was in the 5th grade to learn programming (called Basic Fun: Computer Games, Puzzles, and Problems Children Can Write). I remembered it being awesome but a lot of the exercises in there are pretty boring in 2018 :(

    1. 2

      They may feel boring in 2018 because our minimum expectation has been raised by modern marketing/entertainment training us over time to have shorter and shorter attention spans.

    1. 3

      https://github.com/zainhoda/orbgo

      Free and open source Tableau alternative that generates Python Pandas code. Still in early stages but I’d love to bounce some ideas around if you know anything about IPython.

      1. 1

        If you’d like some feedback: when I first opened the website I tried dragging a couple of things into the big white gap at the bottom of the screen and nothing happened so I got a bit confused. Is it a graphical editor for designing charts?

      1. 2

        Microsoft Sculpt Ergonomic Keyboard

        1. 1

          Same. The Fn key switch is a bit annoying but most of the Fn functions I use are accessible through alternative combos.

          When it comes to my overall health and comfort, however, changing to an ergonomic keyboard helped a little but correcting my desk and posture helped a lot.

          1. 2

            I prefer the Fn key switch to a Fn button that requires a combo key press

            1. 1

              Unfortunately, it seems that many of the things I prefer in the short term (such as combo key presses) wind up hurting my hands in the long term. :-/

        1. 9

          totally happy with a Microsoft ergonomic keyboard.

          1. 4

            Same here.

            I’d love to have a fancy mechanical keyboard with lots of option keys etc. but I don’t have endless spare time to research let alone configure something like that.

            1. 2

              Same on both counts

            2. 1

              The MS Natural 4000 is perfect for me: I went from pain after an hour to no pain no matter how much I type. It’s only $30! Great stuff.

              I’ve got an ergodox, but getting used to the thumb keys at work but not having it on my laptop at home was just too much to get used to.

            1. 3

              No mention of app engine?

              1. 2

                Sorry, I should have mentioned that I only reviewed services I used. Due to load balancer upload limits on App Engine I wasn’t able to use App Engine as the application server so I didn’t look into it too deeply. It definitely looks good though.

                1. 4

                  If you can make your use-case fit into AppEngine’s constrained data & runtime model then it is absolute nirvana. If you can’t then you’re stuck using something else.

              1. 0

                So far I’ve only found one solution that is actually robust. Which is to manually check that the value is not nil before actually using it.

                This seems reasonable to me. If anything, I’d consider knowing how and when to use this kind of check a part of language competency knowledge as it is how Go was designed.

                1. 9

                  We expect people to be competent enough to not crash their cars, but we still put seatbelts in.

                  That’s perhaps a bad analogy, because most people would say that there are scenarios where you being involved in a car crash wasn’t your fault. (My former driver’s ed teacher would disagree, but that’s another post.) However, the point remains that mistakes happen, and can remain undiscovered for a disturbingly long period of time. Putting it all down to competence is counter to what we’ve learned about what happens with software projects, whether we want it to happen or not.

                  1. 9

                    I wish more languages had patterns. Haskell example:

                    data Named = Named {Name :: Text} deriving Show
                    
                    greeting :: Maybe Named -> Text
                    greeting (Just thing) = "Hello " + (Name thing)
                    greeting _ = ""
                    

                    You still have to implement each pattern, but it’s so much easier, especially since the compiler will warn you when you miss one.

                    1. 3

                      Swift does this well with Optionals

                      1. 5

                        You can even use an optional type in C++. It’s been a part of the Boost library for a while and was added to the language itself in C++17.

                        1. 4

                          You can do anything in C++ but most libraries and people don’t. The point is to make these features integral.

                          1. 1

                            It’s in the standard library now so I think it’s integral.

                            1. 4

                              If it’s not returned as a rule and not as an exception throughout the standard library it doesn’t matter though. C++, both the stdlib and the wider ecosystem, rely primarily on error handling outside of the type-system, as do many languages with even more integrated Maybe types

                        2. 2

                          Yep. Swift has nil, and by default no type can hold a nil. You have to annotate them with ? (or ! if you just don’t care, see below).

                          var x: Int = nil // error
                          var x: Int? = nil // ok
                          

                          It’s unwrapped with either if let or guard let

                          if let unwrapped_x = x {
                              print("x is \(x)") 
                          } else {
                              print("x was nil")
                          }
                          
                          guard let unwrapped_x = x else {
                              print("x was nil")
                              return
                          }
                          

                          Guard expects that you leave the surrounding block if the check fails.

                          You can also force the unwraps with !.

                          let x_str = "3"
                          let x = Int(x_str)! // would crash at run-time if the conversion wouldn't succeed
                          

                          Then there’s implicit unwraps, which are pretty much like Java objects in the sense that if the object is nil when you try to use it, you get a run-time crash.

                          let x: Int! = nil
                          
                      2. 7

                        Hey, I’m the author of the post. And indeed that does work, which is why I’m doing that currently. However, like I try to explain further in the post this has quite some downsides. The main one is that it can be easily forgotten. The worst part of which is that if you did forget, you will likely find out only by a runtime panic. Which if you have some bad luck will occur in production. The point I try to make is that it would be nice to have this be a compile time failure.

                        1. 1

                          Sure, and that point came across. I think you’d agree that language shortcomings - and certainly this one - are generally excused (by the language itself) by what I mentioned?

                      1. 2

                        Wow. I was using Atom until I read this post. I had dismissed VSCode because Microsoft but WOW, this is zippy!

                        1. 2

                          For too long, finance has been a net consumer of open source.

                          The nature of finance is such that it’s largely a zero-sum game so cooperation between companies is not the norm.

                          1. 1

                            I don’t understand the point you’re making. What does lack of cooperation have to do with companies in the finance space funding OSS projects?

                            (Asking out of a sincere desire to know, not debating or doubting your claim)

                          1. 3

                            Another great example is Autozone. Remember when they had the text consoles where people could very quickly lookup parts. It’s all be replaced by a GUI app now. If you learn all the keyboard shortcuts, it can be close to the original, but most people I just watch click and click and click.

                            1. [Comment removed by author]

                              1. 2

                                This is part of why the Bloomberg Terminal is still as successful as it is despite the fact that the interface looks like it’s stuck in the 1980s.

                              1. 2

                                I just turned on HTTPS in my App Engine web app – it’s integrated with Let’s Encrypt. It was surprisingly easy compared to the times I’ve used old school CAs.

                                1. 3

                                  Creating a simple Go appengine service with datastore as a db for future project. Starting from CRUD, than adding integrations to Slack/Github.

                                  1. 2

                                    lmk if you have any questions/issues. The product I’m developing right now uses Go appengine with datastore and an Elm frontend.

                                    I’m a big fan of the dev_appserver

                                    1. 1

                                      dev_appserver

                                      yeah, dev_appserver is a beast and works like a charm :)

                                      I had an issue with context.Background(), before I’ve found solution appengine.NewContext(r) (r is a http.Requset).

                                      And one more: moving away from datastore.Client, ’cause cloud.google.com/go/datastore and google.golang.org/appengine are unequal things.

                                  1. 4

                                    Interesting but not really alarming.

                                    This article is saying that if someone breaks into my house, they can hack the Echo and use it to record my conversations. If someone is going to break into my house to monitor me, I’d be more concerned that they’d hack my router.

                                    1. 3

                                      Agreed that this isn’t very concerning. If somebody’s willing to break into my house to get information on me, Alexa is the least of my worries.

                                      That said, I don’t own an Echo because the prospect of Amazon (or any company) listening in on me is creepy.

                                    1. 1

                                      I don’t code in Python but it seems to be that many of these are solutions to the fact that Python is dynamically typed.

                                        1. 2

                                          the most generic implementation of the code tends to be very inefficient

                                          I’ve found this to be true in the data analytics space regardless of the language being used. Some composition of generalized functions yields the numerically correct result but often very inefficiently.

                                            1. 4

                                              I still want to interview the person that switched from Rust to Cobol. In anyone knows them, please get in touch :).

                                              1. 6

                                                I found them by looking at the GitHub repository associated with the article, pulling out the exact phrasing used, googling it, and looking at the only results that weren’t associated with the original article.

                                                Turns out it’s just a guy making a joke. Ah well.

                                            1. 7

                                              I’m starting to wonder how difficult it would be to approximate how curl is used around the world.

                                              curl clearly has a lot of functionality baked in which would take a lot of development to duplicate, but if it turns out 95% of use cases simply dump an HTTP served file to disk, perhaps another tool can be written in the likes of Go or Rust which could meet most of the use cases fairly quickly.

                                              Edit: Found this - curl-to-go

                                              1. 2

                                                Oh, that’s really neat to see. One of my investigations a while back was conversion of shell scripts that stuck around for significant time to a HLL with lots of automated verification. A series of them that would’ve been piped can get faster or secure IPC w/out manual work. It gets compiled into native code for a speed boost, too. Scheme was along those lines. One or two of the examples on this site is about how I visualized the comparison part looking minus security or formal stuff.

                                                Also, good to have an efficient, safer implementation of key functionality in Curl. Such things are good projects by themselves.

                                                1. 1

                                                  Good find!

                                                1. 5

                                                  :) Very entertaining read. I’ve been picking up some smaller components in GO lately. I’ve also rewritten a component I originally built in Python in GO. Which gives a nice but anecdotal comparison:

                                                  Python: 11 days of development, performance, 160ms for ranking 3600 activities GO: 3 days of development, performance, 6ms for ranking 3600 activities

                                                  The project is quite simple. It reads a ranking formula and turns it into a function which runs scoring on a large list of activities. Here’s an example ranking config:

                                                  {
                                                  "functions":{
                                                    "simple_gauss":{
                                                      "base":"decay_gauss",
                                                      "scale":"5d",
                                                      "offset":"1d",
                                                      "decay":"0.3"
                                                    },
                                                    "popularity_gauss":{
                                                      "base":"decay_gauss",
                                                      "scale":"100",
                                                      "offset":"5",
                                                      "decay":"0.5"
                                                    }
                                                  },
                                                  "defaults": {
                                                      "popularity": 1
                                                  },
                                                  "score":"simple_gauss(time)*popularity"
                                                  

                                                  }

                                                  So you basically you need to parse the score expression, translate it to AST, configure the defaults in the context, setup partials for the specified functions, add a bunch of builtin functions and create a huge set of test cases to make sure you’ve covered every possible way in which people can break it :)

                                                  With Python most of the time was spent on benchmarking and performance optimization. The GO code started out at 15ms and with some super simple optimization came down to 6. (GO also had the unfair advantage of a better expression parsing library being available.)

                                                  I used to believe that GO gives you better performance at the cost of developer productivity. For certain projects it definitely seems to beat Python at both productivity and performance though.

                                                  1. 6

                                                    Is it possible that some of the drop in development time was due to being familiar with the application because you had already written it once before?

                                                    1. 3

                                                      You beat me to it. There’s been a lot of rewrite stories debunked because the developers just got better at solving the problem since the first try. That included one with formal methods at IBM that got me where nobody mention it was a second implementation.

                                                      The proper comparison is doing them both the same way with same primitives. That is closer to apples to apples.

                                                      1. 2

                                                        Yeay, it’s comparing apples and oranges :) On the other hand this was my first non-hello world GO project. I’ve been working with Python for 10 years now. GO is super easy to switch to if you’ve been working with Python.

                                                        Most of the time with the Python version was spent on performance optimization. I think GO hits a sweet spot. The language is easy to use and quite productive. Maybe not as easy as Ruby or Python, but pretty close. GO is also not as fast as C++ or Java (it depends a bit on the code you’re running, but in general it’s a little bit slower).

                                                        Basically you get close to C++ level performance at close to Python level ease of use. Now for most use cases i’d still recommend Python. (usually it’s just glue between heavily optimized databases and the overhead of python doesnt matter). But for use cases where the language performance matters, GO really hits a sweet spot.

                                                        1. 3

                                                          Nit: it’s Go, not GO.

                                                          1. 3

                                                            People are never going to get this right. It’s Go: not Golang, GO, Google’s Go, etc.

                                                            1. 2

                                                              haha, that’s probably the hardest aspect of learning Go :)

                                                      1. 6

                                                        It’s been over a decade since I’ve programmed in C. I read through the source code for this project and now I remember what I hated about C.

                                                        There’s a ton of laziness in this code about checking types. It’s not self-documenting at all. There’s a lot of if (!timeout), if (!ptr), if (!...) where that ... could be an int, a pointer, a char, or any number of other things. Then you see a lot of commits trying to fix bad assumptions that those values would be 0. For example, in the timeout case the code initially only checked whether it was 0 or nonzero. Then later there was a commit to take into account the fact that the timeout could be negative.

                                                        I have no idea what this function does but in any sane modern language that function would return a type that you could switch over if the expected behaviors are for timeout < 0, timeout == 0, and timeout > 0.

                                                        The commit that changed

                                                        else if('\\' == *ptr) {
                                                        

                                                        to this

                                                        else if('\\' == *ptr && ptr[1]) {
                                                        

                                                        is only because of C’s uniquely bad string type

                                                        There are literally hundreds of commits fixing memory leaks.

                                                        My bet is that if you were to re-write curl in a newer language, you might miss out on some functionality but you wouldn’t have nearly as many security holes.

                                                        1. -4

                                                          Give me examples of similarly usable software written in some better language.

                                                          1. 10

                                                            I’m super curious where you thought you were going with this? Some weird form of “since theres no alternative, (this is the best way|stop bitching about it)”? Or maybe “well if it’s so bad, then you get in there and fix it!”?

                                                            Are we not allowed to comment on bad source code simply because its widely used or that we haven’t written a similarly popular library? Objectively bad source code can and does exist. This code wasn’t written by just one person, it was written by many.

                                                            Maybe you were genuinely asking for examples on other software. If so, you should know that your demand for examples comes off as vaguely hostile. And then to ask everyone who doesn’t understand you to “grow up” reinforces the perceived hostility in your original comment.

                                                            My apologies if you’re already aware of all this, the last thing I want is a confrontation.

                                                            1. 1

                                                              I read an airy

                                                              My bet is that if you were to re-write curl in a newer language, you might miss out on some functionality but you wouldn’t have nearly as many security holes.

                                                              and I asked for for backup on the implied comparison. It’s easy to assert that something that works is terrible compared to what you imagine it should be, but there are actual engineering reasons why such a high percentage of the internet machinery is written in C/C++ or Java and not in some “newer language”. What are the examples of solid, widely used, systems components written in something newer or better and what does the CVE track of those examples look like. If you have them, that would be interesting. If you don’t then the critique is lacking traction.

                                                            2. -4

                                                              How obnoxious to claim this question is “troll”. Grow up.