• Activity
  • Votes
  • Comments
  • New
  • All activity
    1. A tildes thread for toki pona, the minimalist conlang

      Toki Pona is a minimalist conlang famous for having a vocabulary of under 130 words. There are communities of speakers on all major social media platforms. This is an introduction thread for...

      Toki Pona is a minimalist conlang famous for having a vocabulary of under 130 words. There are communities of speakers on all major social media platforms. This is an introduction thread for speakers, learners or the toki-curious to introduce themselves. I'll advise on learning resources, or just answer general questions if anyone is interested.

      I'm a toki pona speaker and creator of the YouTube channel 'seme li sin?' which translated news stories into toki pona.

      mi wile e ni: kulupu wawa pi toki pona lon lipu Tetesu. jan ale pi toki pona li jan pona mi. sina ken la o kepeken e toki pona lon lipu ni!

      26 votes
    2. I’m moving across the country in a few days

      I’m moving from the Midwest to California on Tuesday to start graduate school (I’ve been in an post-baccalaureate research position for the last two years). I’ve been so busy packing and making...

      I’m moving from the Midwest to California on Tuesday to start graduate school (I’ve been in an post-baccalaureate research position for the last two years). I’ve been so busy packing and making sure I see friends that I think it hasn’t truly hit me yet. I’ve lived around Chicago my whole life, even during college, so I suppose I’m a bit nervous about the change of location and being so far from friends and family. I’m incredibly excited of course to begin this new phase, but nervous nonetheless.

      Have any of you all ever had big moves in the past? Any advice for settling in a new locale?

      14 votes
    3. Should we be able to view comments/posts where mods/admins are doing their roles and not doing them separately?

      What I mean by this is: Sometimes @Deimos posts something related to his mod/admin work, like saying he will be locking a thread or adding something new, but that's not all he does, he makes...

      What I mean by this is:

      Sometimes @Deimos posts something related to his mod/admin work, like saying he will be locking a thread or adding something new, but that's not all he does, he makes regular topics and comments about regular things, he doesn't have need to use an alt-account for that. I feel that when he's talking or posting about his mod/admin work and talking about anything else that interests him should be able to be viewed separately.

      Thoughts?

      9 votes
    4. A brief look at programming paradigms

      Overview If you've spent any significant amount of time programming, then you've probably heard discussions about imperative, functional, and declarative programming. These discussions are often...

      Overview

      If you've spent any significant amount of time programming, then you've probably heard discussions about imperative, functional, and declarative programming. These discussions are often mired in technical knowledge and require a fair amount of intuition when trying to grasp the differences between the examples placed in front of us. These different programming styles, usually called programming "paradigms", are discussed as if they exist within a vacuum with complete and total isolation from one another. This only furthers the confusion and frustration among newer programmers especially, which runs counter to the goal of instructing them.

      In this post I'll be taking a look at the oft-neglected intersections where these paradigms meet with the hope that the differences between them will be better understood by reframing our existing knowledge of programming basics.

      Note: I'll be using PHP for my code examples and will try to provide comments when necessary to point out language quirks.


      Understanding Fundamentals is Imperative

      Let's start by first reviewing the most basic, fundamental programming paradigm: imperative programming. The term is a bit strange, but the important thing to understand about it is that imperative programming refers to writing software as a series of instructions where you tell the computer how to solve a specific task. For example, if we need to add together a bunch of numbers inside of an array, we might write code that looks like this:

      $numbers = [ 8, 31, 5, 4, 20, 78, 52, 18, 96, 27 ];
      $sum = 0;
      foreach($numbers as $number) {
          $sum += $number;
      }
      

      This is a pretty typical example that you've probably encountered in some form or another at some point in your programming studies or career--iterate over an array one element at a time from the first element to the last and add the current element to some accumulating variable that starts at 0. The kind of loop you use may differ, but the general format of the solution looks the same. This is very similar to the way the computer itself performs the task, so the code here is just a relatively human-friendly version of the actual steps the computer performs. This is the essence of imperative programming, the basic building blocks of everything you learn early on.


      Abstract Concepts

      As the software we write gets larger and more complex, we then tend to rely on "abstractions" to simplify our code and make it easier to understand, reuse, and maintain. For example, if we've written a program that adds arrays of numbers together, then we probably aren't doing that in only one place. Maybe we've written a tool that generates reports on large data sets, such as calculating the total number of sales for a particular quarter, gross profit, net profit, remaining inventory, and any number of other important business-related metrics. Summing numbers could be so common that you use it in 30 different places, so to avoid having to maintain 30 separate instances of our number adding code from above, we define a function:

      function sum($numbers) {
          $sum = 0;
          foreach($numbers as $number) {
              $sum += $number;
          }
      
          return $sum;
      }
      

      We do this so frequently in our code that it becomes second nature. We attach so many names and terms to it, too: DRY, abstraction layers, code reuse, separation of concerns, etc. But one thing experienced programmers learn is to write their functions and object and interface methods in such a way that anyone who uses them doesn't need to care about the underlying implementation details, and instead only need to worry about the method name, expected arguments (if any), expected return type (if any), and expected behavior. In other words, they don't need to understand how the function or method completes the intended action, they only need to declare what action they want performed.


      A Declaration of Understanding

      Anyone who has looked into the concept of the declarative programming paradigm should find those last words familiar: "they don't need to understand how the function or method completes the intended action, they only need to declare what action they want performed". This is the oft-touted explanation of what declarative programming is, the difference between detailing "how" and declaring "what", and I believe that it's this great similarity that causes imperative and declarative programming to become heavily entwined in a programmer's mind and makes it difficult to understand. Take this common example that authors tend to use to try to detail the difference between declarative and imperative programming:

      // imperative
      function sum($numbers) {
          $sum = 0;
          foreach($numbers as $number) {
              $sum += 0;
          }
      
          return $sum;
      }
      
      // declarative
      function sum($numbers) {
          return array_reduce($numbers, fn($x, $y) => $x + $y, 0);
      }
      

      The authors will go on to state that in the imperative example, you tell the computer how to sum the numbers, whereas in the declarative example you don't tell the computer how to do it since you don't know anything about the reduce implementation, but intuitively it still feels as if you're telling the computer how to perform its task--you're still defining a function and deciding what its underlying implementation details are, i.e. the steps it needs to take to perform the task, even if its details are abstracted away behind function or method calls that could have varying implementation details of their own. So how the hell is this any different from defining functions like we do in imperative programming?

      The answer is simple: it isn't. We've used so many names and terms to describe functions and methods in our ordinary imperative programming, but the truth is that a well-defined function or method serves as a declarative interface to an imperative implementation. Put differently, declarative programming is defining and utilizing simple interfaces that describe what you want accomplished while the underlying implementation details are inevitably written using imperative code.


      Functional Differences

      Now we can finally tackle one of the biggest trends in programming right now: the functional programming paradigm. But to understand this paradigm, it's important to understand what a "function" is... from a mathematical perspective.

      Yes, I know, math tends to be a enthusiasm sink for many, but don't worry, we're not actually going to be doing math. We only need to understand how math treats functions. Specifically, math functions usually look something like f(x) = {insert expression here}, which is loosely equivalent to the following code:

      function f($x) {
          return {insert expression here};
      }
      

      The important thing to note about functions in math is that you can run them a theoretically infinite number of times on the same input x and still get the same return result. Unlike in a lot of the programs we can write, math functions don't produce side effects. Files aren't written to or destroyed, database entries aren't deleted, some global counter somewhere isn't incremented, and your x doesn't suddenly change. The idea behind functional programming is to embody some of that nature of mathematical functions because they're predictable and always reproducible, and therefore simple to test as well. For example, take the following:

      // not functional
      function increment(&$x) { // pass by reference--$x will be modified outside of this function!
          $x++;
      }
      
      $x = 1;
      increment($x);
      increment($x);
      increment($x);
      
      // functional
      function increment($x) { // pass by value--$x will NOT be modified outside of this function!
          return $x + 1;
      }
      
      $x = 1;
      $y = increment($x);
      $y = increment($x);
      $y = increment($x);
      

      Note that the first example will change the value of $x on each call, meaning each subsequent call of increment($x) produces a different result. Meanwhile the second example doesn't change $x and so the return value of increment($x) is always the same. This may seem like a silly example, but in larger, more complex software this can be significant. So now that we have an understanding of functions from a mathematical perspective, we have everything we need to actually understand what functional programming is.

      Functional programming is a subset of declarative programming. Just like in declarative programming, you use simple interfaces to tell the program what you want to do rather than how to do it. But unlike declarative programming as a whole, functional programming imposes some additional restrictions on what you should and shouldn't do:

      • You should encapsulate behavior in pure functions, which always give a consistent output for a given input and don't have side effects.

      • You should write functions in such a way that you can compose them together, allowing you to combine and chain behavior to produce new functions or use the output of one as the input for another.

      • You should avoid side effects as much as possible.

      • You should avoid mutable state (e.g. changing the values in a variable).

      • You should avoid sharing state between components.

      These restrictions would require an entirely separate post on their own to properly cover and have been covered so many times in so many ways by others elsewhere that it would be superfluous for me to try to add anything more. It's important to note, however, that these restrictions are imposed because they provide some key benefits. By avoiding side effects and by avoiding mutable and shared states, the code you write becomes more predictable and tracing the behavior of an algorithm becomes far simpler. By writing pure, composable functions, you create reusable building blocks that can be strung together in virtually any configuration with predictable results. This makes writing, reading, maintaining, and debugging code easier and less error-prone.

      That said, I feel that it's important to note that in the real world when writing practical software that users can interact with, it's simply not possible to completely avoid side effects or mutable state. The very act of creating and updating database entries is itself an act of mutating state, which runs contrary to functional programming principles and is essential for many important software projects. But even if you can't adhere strictly to functional programming principles, it's possible to benefit significantly from being aware of them and integrating them into your own software development strategies.

      Let's consider a more practical example to illustrate this. Imagine that you've built a social media website and you're trying to test a push notification system that will be triggered when your user receives a new message. Now imagine your code and unit tests look something like this:

      function sendNotification(&$message) { // pass by reference--$message will be modified outside of this function!
          $notification_system = new NotificationSystem();
          if(!$message['sent_push_notification']) {
              $notification_system->sendPushNotification($message);
              $message['sent_push_notification'] = true;
          }
      }
      
      function testSendNotification() {
          $message = [
              'user_id'=>'{some_id}',
              'contents'=>'Hi!',
              'sent_push_notification'=>false
          ];
      
          sendNotification($message);
          sendNotification($message);
      }
      

      At a quick glance you probably wouldn't be aware of why the second message didn't send, but the fact that our sendNotification() function mutates the state of the data provided to it is the culprit. This is code that doesn't adhere to functional programming principles since the data provided to it is mutated. As a result, running the function multiple times on the same variable doesn't result in the same behavior as the first call. If we wanted to work around this without adhering to functional programming principles then we would need to manually set $message['sent_push_notification'] = false; between function calls, which makes our unit tests potentially more error-prone. Alternatively we can make a simple change to adhere better to those functional principles:

      function sendNotification($message) { // pass by value--$message will NOT be modified outside of this function!
          $notification_system = new NotificationSystem();
          if(!$message['sent_push_notification']) {
              $notification_system->sendPushNotification($message);
              $message['sent_push_notification'] = true;
          }
      
          return $message;
      }
      
      function testSendNotification() {
          $message = [
              'user_id'=>'{some_id}',
              'contents'=>'Hi!',
              'sent_push_notification'=>false
          ];
      
          sendNotification($message);
          sendNotification($message);
      }
      

      Now both notifications will be sent out, which is what we would intuitively expect. You should also notice that the above is also a blend of imperative, declarative, and functional programming. Our function definitions have imperative code, our sendNotification() function adheres to the functional programming principle of avoiding mutable state (well, mostly), and our NotificationSystem object provides a declarative interface for sending a push notification for a message.


      Final Thoughts

      By viewing these three paradigms not as completely separate concepts but as layers on top of one another, where functional programming is a type of declarative programming which is implemented using imperative programming, we can stop being confused by their similarities and instead find clarification in them. By understanding that imperative programming is the backbone of everything, that declarative programming is just simplifying that backbone with simple interfaces, and that functional programming is simply adding some additional guidelines and restrictions to the way you write code to make it more consistent, reusable, and predictable, we can start to see that we're not choosing one programming paradigm over another, but instead choosing how much consideration we place on the design of the programs we write. Except in purely functional languages, functional programming isn't some alien concept distinct from imperative or declarative programming, but is instead a natural evolution of the two.

      There are a lot of details I've glossed over here. Each of these programming paradigms is far too detailed to include a proper analysis in an already lengthy post that tries to separate them from each other and clarify their differences. Blog articles exist in a thousand different places that can do each one far more justice than I can, and programming languages exist that completely cut imperative programming out of the picture. But for your average programmer slinging JavaScript, C, Rust, PHP, or what have you, I hope that this serves as a crucial starting pointing to understanding just what in the hell these functional programming enthusiasts are on about.

      25 votes
    5. Weekly thread for news/updates/discussion of George Floyd protests, racial injustice, and policing policy - week of August 31

      This thread is posted weekly - please try to post relevant content in here, such as news, updates, opinion articles, etc. Especially significant updates may warrant a separate topic, but most...

      This thread is posted weekly - please try to post relevant content in here, such as news, updates, opinion articles, etc. Especially significant updates may warrant a separate topic, but most should be posted here.

      9 votes
    6. Crusader Kings III early thoughts and impressions?

      I've only played for a couple of hours so these really are "impressions". Positively i'll say its probably PDS's best release. Very few bugs and they are mostly minor that i have seen. There seems...

      I've only played for a couple of hours so these really are "impressions".

      Positively i'll say its probably PDS's best release. Very few bugs and they are mostly minor that i have seen. There seems to be enough generic and western european content to keep most fans happy, at least for a couple of weeks. I surprisingly like the UI colour and set up. I thought it was a bit modern in the dev diaries but it works well and is less tacky than a thematic scheme might look. The cycling of the map modes on zoom works well. The amount of "meme" is really overplayed on the reddits and marketing, ive only played a few hours but the flavour reminds me of early CK2 rather than late Glitterhoof CK2.

      My main negatives at the moment are i find there is often an overwhelming amount of information on screen between the side panels, the alerts tab at the top and how wherever you put your mouse seems to open one or more information popups its a bit cluttered.

      I thought the 3D characters would be more memorable than the 2D portraits but i find the opposite. I cant remember any of the characters by image, they all feel very similar. This might be until i am more familiar with the differences though.

      17 votes
    7. What creative projects have you been working on?

      This topic is part of a series. It is meant to be a place for users to discuss creative projects they have been working on. Projects can be personal, professional, physical, digital, or even just...

      This topic is part of a series. It is meant to be a place for users to discuss creative projects they have been working on.

      Projects can be personal, professional, physical, digital, or even just ideas.

      If you have any creative projects that you have been working on or want to eventually work on, this is a place for discussing those.

      11 votes
    8. Fitness Weekly Discussion

      What have you been doing lately for your own fitness? Try out any new programs or exercises? Have any questions for others about your training? Want to vent about poor behavior in the gym? Started...

      What have you been doing lately for your own fitness? Try out any new programs or exercises? Have any questions for others about your training? Want to vent about poor behavior in the gym? Started a new diet or have a new recipe you want to share? Anything else health and wellness related?

      6 votes
    9. Covid testing rant

      I'm in line at a free covid testing site. It is a CVS minuteclinic. I have to use the normal drivethrough, and self administer the nasal swab. What the hell is that bullshit? My wife went to a...

      I'm in line at a free covid testing site. It is a CVS minuteclinic. I have to use the normal drivethrough, and self administer the nasal swab.

      What the hell is that bullshit? My wife went to a 'real' test site where a professional swabbed and she described it as a pap smear on the back of her eye.

      So I'm going to a CVS so they can print a barcode, give me, an unqualified layperson a long qtip and a test tube to do my own test and drop in a collection box. Which they will likely ship to an actual lab.

      And for all of this 'work', they get to bill my insurance for hundreds or more, which will likely mean rate hikes later.

      Our healthcare system is a sham, and this is just further proof. Given I have to do it myself anyway, the government should just mail me a kit which I then drop off.

      It would not shock me in the slightest if they actually just drop the tests in a dumpster and just send a 'negative' a few days later.

      Edit: 40 min later, through line and swabbed. Yes, they just have Quest diagnostics empty the dropbox. 0 reason CVS should be involved.

      17 votes
    10. An update on the unofficial Tildes 2020 census

      Hey everyone, I hope your life is good, and if isn't, it'll get better, so don't you surrender. :) The census this year had a much improved response! As of writing this I've had 302 handed in...

      Hey everyone, I hope your life is good, and if isn't, it'll get better, so don't you surrender. :)

      The census this year had a much improved response! As of writing this I've had 302 handed in forms! I'd also like to thank everyone who graciously donated to offset the cost for JotForms premium. I've almost broken even (Like 2€ off so it's not a big deal really). This post just serves as a simple update and a gentle reminder if you haven't filled out the survey but want to, or haven't gotten around to it or simply forgot. If you don't want to participate that's fine too.

      https://form.jotform.com/202281385322348

      As responses are still dwindling in, I'll probably keep the thing open for another week or so. Have a fun weekend!

      26 votes
    11. Weekly coronavirus-related chat, questions, and minor updates - week of August 31

      This thread is posted weekly, and is intended as a place for more-casual discussion of the coronavirus and questions/updates that may not warrant their own dedicated topics. Tell us about what the...

      This thread is posted weekly, and is intended as a place for more-casual discussion of the coronavirus and questions/updates that may not warrant their own dedicated topics. Tell us about what the situation is like where you live!

      8 votes
    12. Looking for albums that are both beautiful and melancholic

      This is hard to describe, but I'm looking for albums that I can kind of wallow in a bit emotionally, but that are also beautiful musically, aesthetically, or lyrically. Because it's difficult to...

      This is hard to describe, but I'm looking for albums that I can kind of wallow in a bit emotionally, but that are also beautiful musically, aesthetically, or lyrically.

      Because it's difficult to put into words, here's an example of a song that kind of has the vibe I'm going for: Snail Mail's "Deep Sea". It's sad but not too sad, and I find the arrangement and melody to be resonant and, well, beautiful. I want something that feels like this, but across a whole album (note that the "feel" doesn't apply to the genre of the song so much as it does my emotional response to it).

      I'm open to any suggestions. Bandcamp preferred, but not required.


      UPDATE: A huge thank you to the community for all your recommendations! I have a lot of wallowing to look forward to.

      22 votes
    13. 4K screen on 15" laptop - worth it?

      Pricing up my next Thinkpad (I'm a lifer for Thinkpads I think now) and I keep hovering over the 4K screen option. I'm looking at a 15.6" screen. The FHD 14" screen I currently have is lovely and...

      Pricing up my next Thinkpad (I'm a lifer for Thinkpads I think now) and I keep hovering over the 4K screen option. I'm looking at a 15.6" screen. The FHD 14" screen I currently have is lovely and sharp with a decent colour gamut, and I don't think I can see pixels, even now when the machine is literally on my lap. I'd guess the screen is maybe 35cm from my eyes at the moment.

      I don't really game, I do edit photos, video (HD, not 4K) and do a little 3D work with Blender/FreeCAD/etc. I usually run Debian/Gnome, occasionally dropping into Windows because my 3D printer's preferred slicing software is Windows only (grrrr).

      The other bonus to 4K is HDR400 and twice as many nits of brightness but again, I'm not sure that's worth an extra £250. I'd probably turn the brightness down anyway. The HDR is potentially interesting but as I don't watch TV/movies on this machine and my camera doesn't output HDR, that's likely not very useful despite sounding good. I could buy quite a lot more compute power and ram with that money instead..

      I would go and look at one in person but I have no idea where the nearest 4K Thinkpad is, in person, and even if I did, I don't really want to go into shops right now.

      Any thoughts, experiences, advice, etc would be much appreciated.

      9 votes
    14. Added a page showing details of Tildes's financials, as well as a monthly donation goal

      On the home page of Tildes, there's now a monthly donation goal meter shown at the top of the sidebar. The "(more details)" link in the box goes to a new Financials page, which shows the current...

      On the home page of Tildes, there's now a monthly donation goal meter shown at the top of the sidebar. The "(more details)" link in the box goes to a new Financials page, which shows the current expenses and income for Tildes for this month.

      This is information that I've always been meaning to make public, and the original announcement blog post even mentioned it as an intention. So far it only includes the current month, but I'm intending to add information about past income and expenses eventually as well.

      The Financials page should mostly explain itself, but I want to talk a little more about the goal specifically and why it seems to be set unrealistically high. To be clear, it probably is unrealistically high at this point, but I think it's important to be honest about where the next "stage" in Tildes's sustainability is, and how far away from it we currently are. I could have set the goal to a lower number to make it more achievable, but that would really just be arbitrary and wouldn't represent any meaningful threshold.

      The first important milestone was making sure that all the actual expenses were paid every month, so that keeping the site up wasn't actively costing me money. We're long past that point and almost always have been, which is great on its own—so many businesses and sites never reach that "break even" point and are forced to shut down, but there's absolutely no danger of that happening with Tildes. For how small and young the site is, it's amazing that we've already reached that goal.

      The next milestone, which the current goal represents, is making it so that I'm not effectively donating my time to continue maintaining and developing the site, which means being able to pay myself enough that I can think of Tildes as a "real job". As you can see, we're still pretty far from that point right now, but I think it's a good reminder (especially to myself) to have the meter showing it. As I said in another comment recently, there are other things I should probably focus my efforts on more that would help, and this will be a prominent reminder of that.

      I also want to mention that the overall situation isn't quite as bleak as the goal makes it look. There have been multiple incredibly generous one-time donations made over the last year and a half that you won't see in the current month's numbers, and that's absolutely made a huge difference. I'll try to get the historical information added before too long so that the picture is more complete.

      Let me know if you have any thoughts or questions, and thanks again for all of your contributions, whether they're actual donations or just being active and contributing to the site in that way. It's all important, and I greatly appreciate all of it.

      And as usual, I've given everyone 10 invites, accessible on the invite page.

      95 votes