1. 5

    For beginners, the most lucrative programming language to learn is SQL.

    Yes.

    it’s not the whiteboard per se. It’s the collaboration on a whiteboard.

    and yes.

    1. 1

      After highlighting:

      The competent programmer is fully aware of the strictly limited size of his own skull.

      I think it misses the most important point: our will to refuse to do tasks that we’re not prepared to do.

      And this works at personal level (“don’t fake it until you make it”, nor “I’ll learn it in the job”) and also embarking in projects where the technology and organisation is not ready for it without flagging that we’re experimenting and the project has a high probability of failure.

      Not doing so not only shows lack of humility, but also lack of professionalism.

      1. 11
        1. 25

          A few days ago someone tweeted a question asking which of the following PHP snippets was better than the others, or whether there might be an even better approach . . .

          I tweeted my answer:

          Place the if/else cases in a factory object that creates a polymorphic object for each variant. Create the factory in ‘main’ and pass it into your app.

          Is this parody?

          edit:

          by Robert C. Martin (Uncle Bob)

          Oh. Right.

          1. 11

            Is this parody?

            I also initially did a double-take when I read that, but I wonder whether you carefully read what follows. His assumption is that much more depends on the 0/1 here and the if/else (or case) would metastatize across the codebase if no measures were taken. Having not seen any context for the original question, that could be a valid assumption.

            In general though, it feels like premature abstraction. And the wrong kind of abstraction is more costly that not being DRY (paraphrasing Sandy Metz (I think))

            1. 5

              What he says is nothing crazy.

              Having the Base class delegate functionality on its subclasses is something pretty standard in Smalltalk and is a nice way of simplifying code following the SOLID principle.

              1. 2

                It’s not crazy just more complex than is probably needed.

              2. 4

                Is this parody?

                I hope so,

                edit:

                by Robert C. Martin (Uncle Bob)

                Oh. Right.

                I don’t know whether this proves it one way or the other.

                1. 10

                  I don’t know whether this proves it one way or the other.

                  It’s definitely parody, but without any of the self-awareness that would normally lend it humor.

                2. 3

                  Why would it be parody? In the context of the whole article it is clearly not. The snippet you chose to quote would be by itself, of course, but that’s why the rest of the article is there…

                1. 3

                  The Old Reader. Highly recommended!

                  1. 2

                    Now we need to be able to use an excel as a server-less application service.

                    Upload the excel to the servers, and call the init function.

                    1. 2

                      It’s not complete, but covers enough I’ve used this once or twice to do that: https://pypi.org/project/pycel/

                      1. 2

                        fwiw GSheets makes for a great ui for your internal non programming fellows, you can easily link it with a cloud function and have it populate a proper app database. I used it for a quick and dirty RBAC dashboard before, no regrets.

                        1. 1

                          How do you access it via api? Don’t you need oauth?

                          1. 1

                            I added a big “save” button in the google sheet that triggered a cloud function. Cloud function did an immutable update in the db table.

                            If you are referring to the permissions of the sheet to exec the functions, yes you need to oauth it. I did then invite the right users to share the sheet. It was for minor company stuff, and I’m aware that security is terrible, but for a quick and dirty app that was good enough.

                            I would NOT recommend on a public sheet!!

                      1. 3

                        There’s a patter used in many validated environments, where to take an operational action (or even signing a document) the systems asks you for your password.

                        It works nicely and it translates to the idea of signing an authorisation to proceed.

                        1. 8

                          The issue with that is you get used to typing your password without thinking, and doesn’t prevent you from running the wrong action (e.g. targeting more machines than you intended).

                        1. 2

                          Do we know why he wants/needs this?

                          In my experience this looks like a functionality “wish list”, rather than something that anyone needs.

                          1. 2

                            What I mentioned on the article on my need was:

                            I want a database that allows me to create decentralized client-side applications that can sync data.

                            I’m not trying to solve anyone’s problem but my own, and more than a wish list it’s a hand picked collection of trade offs, like on how to deal with complexities of conflicts from uncoordinated writes.

                            1. 2

                              The sync protocol, and conflict handling, are IMHO a lot more interesting problems than the implementation of the local DB. Take a look at Dat and Scuttlebutt … neither is perfect, but they have interesting designs. (And they make good use of append-only data structures at the sharing/protocol level.)

                              For a lower level approach to syncing, the CouchDB replication protocol, at a very high level, is a decent design. We still use the same architecture in Couchbase Lite, although the details of the protocol are completely different because sending zillions of HTTP requests is too expensive.

                              1. 1

                                This is a flyby Comment so I apologize if this isn’t what you mean but that sounds a bit like https://realm.io/

                                1. 1

                                  Thanks for confirming, but like snej says below this is a different set of problems, many of them unrelated to a database.

                                  And not that cannot be done, but I seriously doubt anyone will work on it again in the short/mid term. This kind of problem was nicely solved by Lotus Notes and even if today the solution looks old, they created their own industry in distributed data/apps before internet become commonplace. Obviously it will not cover all the items in your checklist, but I don’t think they’re really needed (like immutability, that is only needed for some specific regulatory needs, or SQL compatibility).

                                  Anyway, check Lotus Notes architecture for pointers.

                                2. 1

                                  Nothing wrong with that though, is there?

                                1. 5

                                  Great paper! It looks it makes sense to move critical code to safer C dialects. Performance is not impacted and modifying the code is not as difficult as I was expecting.

                                    1. 1

                                      I was completely unaware of Strand, many thanks!

                                    1. 4

                                      You might want to add Aquarius Prolog to the list. Its developer was on Hacker News talking about how parts of it were designed to be closer to the metal for better performance.

                                      1. 2

                                        And interestingly, Aquarius Prolog’s lineage includes Peter Von Roy PhD thesis. Thanks for the link!

                                        1. 1

                                          So, I waited till I got time to find it. Didn’t find anything. What I was looking for was either he or someone pretending to be him was the one that gave it to me on Hacker News. He had a nice description of what he did, too. It was at bottom of thread.

                                          Now, all I can find are references to it by silentbicycle and I. Oh well.

                                          1. 2

                                            Haha, you’ll have to open source you treasure trove of papers one day ;)

                                            1. 1

                                              That and a push-button, verification/testing toolset were going to be my next projects had not I come back to the Lord and COVID hit.I kept that stuff in back of mind. I though of how to get others on it. For papers, the job of checking the copyrights and stuff. I havent forgotten.

                                              The more disorganized part I had been dumping them into is 8,189 items at 3.2GB of space. That doesnt count the books and slightly-more-organized papers that came before them. That should give you an idea of why Im holding off due to whatever costs might be involved.

                                              Meanwhile, one drum of alcohol is sometimes going for $1000+ on top of hundreds in shipping. The COVID-related apps and data entry Im attempting cost me 16+hrs for data collection alone. I was blessed with plenty of savings. It could be wiped out by a few supply purchases (esp gone wrong) or one project. So, I gotta hold off on nice, secondary projects till folks don’t need my help on life-critical stuff.

                                              Hell, high-assurance thinking and Red-Black separation paid off more in my after-work cleaning practices than INFOSEC haha. You could say taint tracking would be another metaphor. Ive occasionally thought about putting it up online but just reminds me how Im not doing enough. Gotta update it in way that’s more miserable…

                                        2. 2

                                          Interesting, it’s older than ISO Prolog and does not run on x86

                                          1. 2

                                            Aquarius was incredible innovative (they forego the WAM), but at the end of the day and with all the the HW development it was not so influential.

                                            Aquarius code is available and it’s an interesting read.

                                          1. 6

                                            As someone that did programmed in RMCobol in UNIX I don’t agree with “to truly develop COBOL, you need a mainframe.” But if you want a mainframe, download Hercules

                                            Also, Grace Cooper did not create Cobol… but anyway.

                                            1. 3

                                              What makes you say she didn’t create cobol I would love to know your viewpoint on this

                                              1. 10

                                                She was a pioneer in language development, and thanks to her effort in FLOW-MATIC we have Cobol (and high level languages), but we have to realise Cobol was a multi team, multi company effort. Cobol, by the way, is a good example of a successful language designed by a committee.

                                                Also, she was not part of Codasyl exec. committee, but an advisor to it. Also, she was not part of the six main designers, two of them women: Jean Sammet and Gertrude Tierney.

                                                So, was she influential? Yes, incredibly so… not only in Cobol but in the development of high level programming languages. But did she create Cobol? Saying that is not only inaccurate, but a disservice to multiple teams that worked to create Cobol.

                                                There’s a wonderful paper on this matter by Jean Sammet: The early story of Cobol that I highly recommend.

                                                1. 2

                                                  https://en.wikipedia.org/wiki/COBOL

                                                  I guess it’s because COBOL is based on a language designed by Grace Hopper?

                                              1. 7

                                                Working on my semantic web framework/database called Lyncex. Maybe this week I can create a website. It’s made in Prolog.

                                                1. 1

                                                  Could you keep us posted? I’m really interested to see what you’re creating.

                                                  1. 2

                                                    Yes, of course! It’s my end of degree project, so I will finish “something” at some point. There’s a GitHub repo but no docs and I still think is not very useful yet.

                                                1. 20

                                                  My advice from painful experience: Do not do this.

                                                  Keep code in your git repo in, hopefully, a single language. Keep your data in a database. Try not to mix the two. Then you can definitively answer questions like “What version of the app is running right now?” Yes it’s possible to version the code in the database via migrations, but why? The only true upside I’ve ever seen is performance, which is a valid one, but reserve this for critical sections that are proven to be too slow.

                                                  1. 6

                                                    There are (rare) cases where it’s not only faster but also clearer - when you are correlating data at different levels of rollup at the same time.

                                                    For instance I have an app that tracks where in a store stock is kept.

                                                    When taking an order, you want to know how much stock the whole store has (minus outstanding orders). That’s a horrendous thing to compute application side (7-way join, N+1 queries are very hard to avoid). The equivalent sql is quite tidy and readable.

                                                    1. 3

                                                      The other upside is to have a single image of code/data in production. Migrations and deployment of new servers is a easy as copying the database to the new server.

                                                      In some industries, like payroll, this facilitates migration of client data between multiple providers.

                                                      1. 0

                                                        My advice from someone who used to think this was a bad idea over a decade ago, but now has been doing it for everything for the last decade (or so), learn what you were doing wrong, because you’re probably still doing it.

                                                        I don’t agree with any of your suggestions.This approach is is faster, more secure, easier to audit and review, easier to develop and scale. In every case that you’re not doing it Wrong™, so stop doing it Wrong™ instead of figuring out how to make the Wrong™ thing work.

                                                        1. 1

                                                          I agree (I think; this post took me four tries to read and I’m still only 90% sure I understood), with the proviso that there are very real advantages to being able to use existing tools (ex: rails), even if they don’t support the Right way to do some bits.

                                                          If you’re a staff engineer at a bigco you can fix the framework (and probably get it merged upstream), but in agency/startup land you definitely do not have time for that.

                                                      1. 1

                                                        I really like structural type systems, it’s the purest way of polymorphism.

                                                        But I never though how messy it looks when the language supports classes, because coming from C++ we’re used that inherence is used for polymorphism (and code reuse).

                                                        1. 3

                                                          TDLR: A logging function was causing nodes to crash for unknown reasons.

                                                          The article is from 2015, and the last few paragraphs seem duplicated. Also, it ends with “The investigation continues…” but it seems there was never a follow-up. It seems they run Windows on servers, with most of the code being python. Weird combination.

                                                          1. 1

                                                            I’ve suggested adding the date to the submission title.

                                                            You write:

                                                            It seems they run python on servers, with most of the code being python. Weird combination.

                                                            Typo?

                                                            1. 2

                                                              Yes, thank you. The first one was meant to be Windows.

                                                            2. 1

                                                              They’re heavily invested in Stackless Python but I don’t know if they moved to something different.

                                                            1. 1

                                                              @sievers, many thanks for these kind of posts.

                                                              DB programming is becoming a lost art (especially in the internets) and is extremely useful for server side coding.

                                                              1. 26

                                                                I think by criticising Go the author actually ended up stating some of the reasons for Go’s popularity and success.

                                                                A developer working in Go and only Go will help his business’s bottom line, and the shareholders will be happy

                                                                Yes, the number one reason we are employed as software engineers.

                                                                I’ve been trying learn Rust, and I have a little server project called Monologued that I’ve been hacking on since early December. I haven’t gotten it working. I already had some major components working, and I decided to try at write Monologued in Go. It took about six hours.

                                                                Great, job done.

                                                                Go might not be as intellectually stimulating as some other languages, but we’re not being paid to solve puzzles for fun. We’re being paid to produce working, production software.

                                                                1. 5

                                                                  Sometimes I’m in awe of how candid are some people when writing blog posts. You can say this having a beer with your friends, but you don’t publish something that shows how little you understand your job and your role in a company.

                                                                  That’s how I feel writing in Go. I didn’t learn anything writing in Go.

                                                                  Frankly, I hope this is not read by the next guy that decides if you join a new job. They’re not paying you for learning “about something”, they’re paying you to deliver.

                                                                  No one will ever write great software in Go.

                                                                  Because spending six hours programming a finger server gives you the insight to determine Go future.

                                                                1. 5

                                                                  This is amazing! Looks like the symbol table is just a linked list that grows and shrinks with lexical scope? That’s a surprise, I was expecting something more involved like a hash map. Makes perfect sense though, from a kiss perspective.

                                                                  1. 2

                                                                    On this there’s a funny story in The School of Niklaus Wirth: The Art of Simplicity By László Böszörményi

                                                                    I still vividly remember the day that Wirth decided to replace the elegant data structure used in the compiler’s symbol table handler by a mundane linear list. In the original compiler, the objects in the symbol table had been sorted in a tree data structure (in identifier lexical order) for fast access, with a separate linear list representing their declaration order. One day Wirth decided that there really weren’t enough objects in a typical scope to make the sorted tree cost-effective. All of us Ph.D. students were horrified: it had taken time to implement the sorted tree, the solution was elegant, and it worked well – so why would one want to throw it away and replace it by something simpler, and even worse, something as prosaic as a linear list? But of course, Wirth was right, and the simplified compiler was both smaller and faster than its predecessor.

                                                                    1. 2

                                                                      I had no idea this book existed, thanks!

                                                                  1. 5

                                                                    I don’t know why he tagged it a rant. Maybe is because I’ve been working with with GNU make since I started in computing but the post is pretty reasonable.

                                                                    I understand many of the complains of people not used to make, but I found few complains that are specific to make and do not apply to other building systems.