- Oct 2021
-
www.stilldrinking.org www.stilldrinking.org
Tags
Annotators
URL
-
- Sep 2021
-
docdrop.org docdrop.org
-
you're guilty of making the same mistake as people who used to say that templates and styles and JavaScript should be in separate files
At last, another one realizing that they ha dbeen structuring MVC web-apps counter-intuitively for decades.
Tags
Annotators
URL
-
-
-
Build data pipelines, the easy way
orchest
-
-
www.joelonsoftware.com www.joelonsoftware.com
-
This is what I call a leaky abstraction. TCP attempts to provide a complete abstraction of an underlying unreliable network, but sometimes, the network leaks through the abstraction and you feel the things that the abstraction can’t quite protect you from. This is but one example of what I’ve dubbed the Law of Leaky Abstractions:
-
-
-
I don’t even minify page assets
Good. Don't. The number of people who think this is a virtue is frightening. The rationale is usually not well-reasoned and whatever values they pretend to hold can almost always be shown to be hollow.
-
-
www.reddit.com www.reddit.com
-
At the same time, details about programming language semantics are quite precise and when articles like this get things sort of wrong, it just leads to more confusion.
-
-
viralinstruction.com viralinstruction.com
-
This post is about all the major disadvantages of Julia. Some of it will just be rants about things I particularly don't like - hopefully they will be informative, too.
It seems like Julia is not just about pros:
- Compile time latency
- Large memory consumption
- Julia can't easily integrate into other languages
- Weak static analysis
- The core language is unstable
- The ecosystem is immature
- The type system works poorly
- You can't extend existing types with data
- Abstract interfaces are unenforced and undiscoverable
- Subtyping is an all-or-nothing thing
- The iterator protocol is weird and too hard to use
- Functional programming primitives are not well designed
- Misc gripes (no Path type and no Option type)
Tags
Annotators
URL
-
- Aug 2021
-
-
I really hope they keep breaking it. Being the lead on a library for several years, most of the forced refactors were pretty straight forward and in almost every case made our code either more sound or easier to be consumed. Now I work on a runtime that embeds TypeScript and 3.5.1 has broken some code, thought it took me all of about 15 minutes to make the changes to adopt it, and in every case, it broke because we were being a bit loose with the types. While it didn't find any bugs, it made the code more "safe".
I really hope they keep breaking it.
-
-
-
Changing every built-in function to accept anys would also "break" no one, but that doesn't make it a good idea. Part of TypeScript's value proposition is to catch errors; failing to catch an error is a reduction in that value and is something we have to weigh carefully against "Well maybe I meant that" cases.
-
-
blog.alexdevero.com blog.alexdevero.com
-
Aside to global and local scope there is also something one could call a “block” scope. This is not an “official” type of scope, but it does exist. Block scope was introduced to JavaScript as a part of the ES6 specification. It was introduced along with two new types of variables let and const.
-
-
en.wikipedia.org en.wikipedia.org
-
github.com github.com
-
In javascript prettier-ignore ignores the next block, so what I did was just make the next few lines a block.
-
-
www.martinfowler.com www.martinfowler.com
-
Rubyists don't call these things annotations. One of the things I like doing is to find common techniques that cross languages, for me this is a common technique and 'annotation' seems like a good generic word for it. I don't know if Rubyists will agree.
-
-
www.martinfowler.com www.martinfowler.com
-
Languages may provide annotations in ways that don't reflect the syntax of the language
-
When writing about programming, I prefer to use 'annotation' as the general term. Although .NET was first, the word 'attribute' is just too widely used for different things.
-
An annotation on a program element (commonly a class, method, or field) is a piece of meta-data added to that program element which can be used to embellish that element with extra code.
-
-
-
www.martinfowler.com www.martinfowler.com
-
When people talk about internal DSLs I see two styles: internal minilanguages and language enhancements.
-
-
en.wikipedia.org en.wikipedia.org
-
Isolation ensures that concurrent execution of transactions leaves the database in the same state that would have been obtained if the transactions were executed sequentially
-
-
softwarequotes.com softwarequotes.com
-
Optimism is an occupational hazard of programming: feedback is the treament.
-
-
zio.github.io zio.github.io
-
We can also define these properties for data types that we do not control, for example providing a custom way of hashing a data type implemented by someone else
-
-
zio.github.io zio.github.io
-
However, there is a definite trade off in these three snippets. The first one is overly specific but is understandable to any Scala programmer. The last one is beautiful and elegant if you understand the necessary concepts but incomprehensible otherwise.
-
ZIO ecosystem libraries generally do not directly expose any functional abstractions but still expose a highly compositional interface because their design is based on algebraic properties like this. Users don't have to learn about these abstractions unless they want to, they just get to benefit from better library design.
-
-
blog.kowalczyk.info blog.kowalczyk.info
-
Open source is not a good business model.If you want to make money do literally anything else: try to sell software, do consulting, build a SAAS and charge monthly for it, rob a bank.
Open-source software is not money friendly
-
The only way for one person to even attempt cross-platform app is to use a UI abstraction layer like Qt, WxWidgets or Gtk.The problem is that Gtk is ugly, Qt is extremely bloated and WxWidgets barely works.
Why releasing cross-platform apps can make them ugly
-
- Jul 2021
-
realdougwilson.com realdougwilson.com
-
The visual and spacing differences between proportional and monospaced fonts
Proportional vs Monospaced fonts:
-
-
blog.jonudell.net blog.jonudell.net
-
https://blog.jonudell.net/2021/07/21/a-virtuous-cycle-for-analytics/
Some basic data patterns and questions occur in almost any business setting and having a toolset to handle them efficiently for both the end users and the programmers is an incredibly important function.
Too often I see businesses that don't own their own data or their contracting out the programming portion (or both).
-
-
www.joshwcomeau.com www.joshwcomeau.com
-
I try and act like a scientist. If I have a hypothesis about how this code is supposed to work, I test that hypothesis by changing the code, and seeing if it breaks in the way I expect. When I discover that my hypothesis is flawed, I might detour from the tutorial and do some research on Google. Or I might add it to a list of "things to explore later", if the rabbit hole seems to go too deep.
Soudns like shotgun debugging is not the worst method to learn programming
-
Things never go smoothly when it comes to software development. Inevitably, we'll hit a rough patch where the code doesn't do what we expect.This can either lead to a downward spiral—one full of frustration and self-doubt and impostor syndrome—or it can be seen as a fantastic learning opportunity. Nothing helps you learn faster than an inscrutable error message, if you have the right mindset.Honestly, we learn so much more from struggling and failing than we do from effortless success. With a growth mindset, the struggle might not be fun exactly, but it feels productive, like a good workout.
Cultivating a growth mindset while learning programming
-
I had a concrete goal, something I really wanted, I was able to push through the frustration and continue making progress. If I had been learning this stuff just for fun, or because I thought it would look good on my résumé, I would have probably given up pretty quickly.
To truly learn something, it is good to have the concrete GOAL, otherwise you might not push yourself as hard
-
-
www.flowerbrackets.com www.flowerbrackets.com
-
Multiple inheritance is one of the object oriented feature where a class or a sub class can inherit features from more than one parent class or super class.
-
Interface is collection of methods of abstract type (having empty body). It’s similar to Abstract class. Interface is blueprint of class. Interface specify what class must do and not how to.
A class which implements interface should define each and every method in the class. Interface is used to implement multiple inheritance in java (represent IS-A relationship).
-
-
wiki.c2.com wiki.c2.com
-
[Huh? Pass-by-reference ALWAYS requires passing a reference by value. That's how it works. The question is whether the referenced object is a COPY of the caller's object, or an ALIAS for the user's value. Most modern languages pass by reference for non-primitive types.]
This person is confused, though it's obvious and understandable to those who've been down the road before how it happens. Most mainstream languages that are taught to be "pass by reference" are actually of the "pass by reference value" sort. Lack of exposure to languages that actually implement pass by reference is the culprit. Of course if your experience is limited to C, C++, Java, and others that use the "pass by reference value" approach, then you'll come away thinking that "pass by reference value" is what "pass by reference" means and this is what any and every language "ALWAYS requires" when setting out to implement "pass by reference"—you just don't have the appropriate frame of reference to see how it could be otherwise.
-
-
unhosted.org unhosted.org
-
The world could benefit from a curated set of bookmarklets in the style of Smalltalk ("doIt", "printIt", etc buttons) that you can place in your bookmarks bar (or copy into a bookmarks document and open in it in your browser), where the purpose would be to allow you to:
- access a new scratch area (about:blank) for experimentation
- make it editable, or make any given element on a page editable
- let you evaluate any code written into the scratch space
scratch.js aims for something something similar, and though laudable it falls short of what I actually crave (and what I imagine would be be most beneficial/appreciated by the public).
-
-
plfa.github.io plfa.github.io
-
The keyword data tells us this is an inductive definition, that is, that we are defining a new datatype with constructors
Inductive, since multiple constructors are generalized to a type. And as seen in this example, data types can also facilitate mathematical induction.
Tags
Annotators
URL
-
-
stackoverflow.blog stackoverflow.blog
-
Useful advice for commenting code.
-
-
www.dreamsongs.com www.dreamsongs.comOUP Book1
-
The primary feature for easy maintenance is locality: Locality is that characteristic of source code that enables a programmer to understand that source by looking at only a small portion of it.
-
-
medium.com medium.com
-
It’s fun but when would we ever use things like this in actual code?When it’s well tested, commented, documented, and becomes an understood idiom of your code base.We focus so much on black magic and avoiding it that we rarely have a chance to enjoy any of the benefits. When used responsibly and when necessary, it gives a lot of power and expressiveness.
-
- Jun 2021
-
unix.stackexchange.com unix.stackexchange.com
-
In case writing to tmpfile fails for some reason, use && mv ... instead of ; mv ... -- that will keep $file from being overwritten with "bad" content.
-
-
stackoverflow.com stackoverflow.com
-
Different ways to prepend a line: (echo 'line to prepend';cat file)|sponge file sed -i '1iline to prepend' file # GNU sed -i '' $'1i\\\nline to prepend\n' file # BSD printf %s\\n 0a 'line to prepend' . w|ed -s file perl -pi -e 'print"line to prepend\n"if$.==1' file
-
-
www.wired.com www.wired.com
-
Johnson, Khari. ‘AI Could Soon Write Code Based on Ordinary Language’. Wired. Accessed 21 June 2021. https://www.wired.com/story/ai-write-code-ordinary-language.
-
-
graphql-ruby.org graphql-ruby.org
-
(Always call super to inherit the default behavior.)
-
-
naildrivin5.com naildrivin5.com
-
It also makes it hard to centralize type coercions and default values.
-
-
docs.gitlab.com docs.gitlab.com
-
Adding Object Oriented Principles (OOP) to a functional codebase adds yet another way of writing code, reducing consistency and clarity.
-
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
Same feature in TypeScript¶ It's worth mentioning that other languages have a shortcut for assignment var assignment directly from constructor parameters. So it seems especially painful that Ruby, despite being so beautifully elegant and succinct in other areas, still has no such shortcut for this. One of those other languages (CoffeeScript) is dead now, but TypeScript remains very much alive and allows you to write this (REPL): class Foo { constructor(public a:number, public b:number, private c:number) { } } instead of this boilerplate: class Foo { constructor(a, b, c) { this.a = a; this.b = b; this.c = c; } } (The public/private access modifiers actually disappear in the transpiled JavaScript code because it's only the TypeScript compiler that enforces those access modifiers, and it does so at compile time rather than at run time.) Further reading: https://www.typescriptlang.org/docs/handbook/2/classes.html#parameter-properties https://basarat.gitbook.io/typescript/future-javascript/classes#define-using-constructor https://kendaleiv.com/typescript-constructor-assignment-public-and-private-keywords/ I actually wouldn't mind being able to use public/private modifiers on instance var parameters in Ruby, too, but if we did, I would suggest making that be an additional optional shortcut (for defining accessor methods for those instance vars) that builds on top of the instance var assignment parameter syntax described here. (See more detailed proposal in #__.) Accessors are more of a secondary concern to me: we can already define accessors pretty succinctly with attr_accessor and friends. The bigger pain point that I'm much more interested in having a succinct shortcut for is instance var assignment in constructors. initialize(@a, @b, @c) syntax¶ jsc (Justin Collins) wrote in #note-12: jjyr (Jinyang Jiang) wrote: I am surprised this syntax has been repeatedly requested and rejected since 7 years ago. ... As someone who has been writing Ruby for over 10 years, this syntax is exactly that I would like. I grow really tired of writing def initialize(a, b, c) @a = a @b = b @c = c end This would be perfect: def initialize(@a, @b, @c) end I'm a little bit sad Matz is against this syntax, as it seems so natural to me. Me too!! I've been writing Ruby for over 15 years, and this syntax seems like the most obvious, simple, natural, clear, unsurprising, and Ruby-like. I believe it would be readily understood by any Rubyist without any explanation required. Even if you saw it for the first time, I can't think of any way you could miss or misinterpret its meaning: since @a is in the same position as a local variable a would normally be, it seems abundantly clear that instead of assigning to a local variable, we're just assigning to the variable @a instead and of course you can reference the @a variable in the constructor body, too, exactly the same as you could with a local variable a passed as an argument. A workaround pattern¶ In the meantime, I've taken to defining my constructor and list of public accessors (if any) like this: attr_reader \ :a, :b def new( a, b) @a, @b = a, b end ... which is still horrendously boilerplatey and ugly, and probably most of you will hate — but by lining up the duplicated symbols into a table of columns, I like that I can at least more easily see the ugly duplication and cross-check that I've spelled them all correctly and handled them all consistently. :shrug: Please??¶ Almost every time I write a new class in Ruby, I wish for this feature and wonder if we'll ever get it. Can we please?
-
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
www.w3schools.com www.w3schools.com
-
For attributes, methods and constructors, you can use the one of the following:
-
-
-
Introduce behaviour that is likely to surprise users. Instead have due consideration for patterns adopted by other commonly-used languages.
-
Emit clean, idiomatic, recognizable JavaScript code.
-
-
developer.mozilla.org developer.mozilla.org
-
The encapsulation is enforced by the language. It is a syntax error to refer to # names from out of scope.
-
-
github.com github.com
-
-
github.com github.com
-
stackoverflow.com stackoverflow.com
-
When defining accessors in Ruby, there can be a tension between brevity (which we all love) and best practice.
-
Yeah, "virtual attribute" seems like dated terminology to me, so conceptually just a method.
-
I see a 'virtual attribute' as something we're forced to implement when using frameworks, ORMs and the like. Something that lets us inject our code into the path of whatever metaprogramming has been put in place for us. In a simple PORO like this, I don't see how it has meaning; it's just a method. :)
Hmm, good point. Maybe so. Though I think I'm fine with calling it a virtual property here too. :shrug:
-
has_sauce is a "virtual attribute", a characteristic of the model that's dependent on the underlying toppings attribute.
-
in languages (like JavaScript and Java) where external objects do have direct access to instance vars
-
Setting an instance variable by going through a setter is good practice, and using two access modifiers is the way to accomplish that for a read-only instance variable
Tags
- distinction
- idiomatic Ruby
- safety (programming)
- languages: differences
- Ruby: instance variables
- encapsulation
- terminology
- balance
- best practices
- brevity
- JavaScript: private instance accessors
- doesn't apply in this/every case
- JavaScript
- programming languages: external objects have direct access to instance variables
- accessors
- programming: access modifiers (public/private)
- programming: virtual (computed) property/attribute
- Ruby
Annotators
URL
-
-
getpocket.com getpocket.com
-
“We want to be an example of what a modern, fast web app can do,” he says. “And we want to blow a few minds while we’re at it.”
No app as and end product, really speeds up the releasing cycle, avoids the the review process both in app store and google play store, Moreover, the apple tax and upfornt developer membership cost which is 100$ / year.
Tags
Annotators
URL
-
-
basarat.gitbook.io basarat.gitbook.ioClasses1
-
Having a member in a class and initializing it like below:class Foo { x: number; constructor(x:number) { this.x = x; }}is such a common pattern that TypeScript provides a shorthand where you can prefix the member with an access modifier and it is automatically declared on the class and copied from the constructor. So the previous example can be re-written as (notice public x:number):class Foo { constructor(public x:number) { }}
-
-
disqus.com disqus.com
-
The answer is no, we use a pattern where we do this, and have a `static` method for manufacturing the constructor.e.g.static from({prop1, prop2}) => new this(public prop1, public prop2)
-
-
-
TypeScript includes a concise way to create and assign a class instance property from a constructor parameter.
-
-
betterprogramming.pub betterprogramming.pub
-
Then, people from programming communities (mainly front-end) realized that CoffeeScript is out of date and is starting to lag behind the ever-evolving Javascript environment. As of today, January 2020, CoffeeScript is completely dead on the market (though the GitHub repository is still kind of alive).
-
-
-
www.hebergementwebs.com www.hebergementwebs.com
-
stackoverflow.com stackoverflow.com
-
Programmers should be encouraged to understand what is correct, why it is correct, and then propagate.
new tag?:
- understand why it is correct
-
I don't think it is too clever. I think it solves the problem idiomatically. I.e., it uses reduce, which is exactly correct. Programmers should be encouraged to understand what is correct, why it is correct, and then propagate. For a trivial operation like average, true, one doesn't need to be "clever". But by understanding what "reduce" is for a trivial case, one can then start applying it to much more complex problems. upvote.
-
Thanks, this was just what I was looking for! This is a perfect appropriate use of instance_eval. I do not understand the nay-sayers. If you already have your array in a variable, then sure, a.reduce(:+) / a.size.to_f is pretty reasonable. But if you want to "in line" find the mean of an array literal or an array that is returned from a function/expression — without duplicating the entire expression ([0,4,8].reduce(:+) / [0,4,8].length.to_f, for example, is abhorrent) or being required to assign to a local, then instance_eval option is a beautiful, elegant, idiomatic solution!!
Tags
- reduce
- idiomatic Ruby
- Ruby: instance_eval
- quotable
- too clever
- clever
- programming: understand the language, don't fear it
- idiomatic (programming)
- I have a differing opinion
- I agree
- spreading/propagating good ideas
- programming languages: learning/understanding the subtleties
- having a deep understanding of something
- not:
- good advice
- combating widespread incorrectness/misconception by consistently doing it correctly
- where it shines / best application
- annotation meta: may need new tag
- clever solution
- appropriateness
- appropriate use case
- my comments
Annotators
URL
-
-
dba.stackexchange.com dba.stackexchange.com
-
I added NULLIF() to defend against division-by-zero errors.
-
-
www.groovy-lang.org www.groovy-lang.org
-
-
gist.github.com gist.github.com
- May 2021
-
-
Adapters are required to make Request globally available if it isn't already part of the target platform. It's part of the (currently undocumented) contract — see e.g. adapter-node
-
-
-
After suggestions from comments below, I read A Philosophy of Software Design (2018) by John Ousterhout and found it to be a much more positive experience. I would be happy to recommend it over Clean Code.
The author recommends A Philosophy of Software Design over Clean Code
-
-
github.com github.com
-
madned.substack.com madned.substack.com
-
What I did have going for me was what might be considered hacker sensibilities - lack of fear of computers in general, and in trying unknown things. A love of exploring, learning by experimenting, putting stuff together on the fly.
Well described concept of hacker sensibilities
-
-
dilushakumarage.medium.com dilushakumarage.medium.com
-
Method 1: We can grab the PDF Versions of Google’s TotT episodes or create our own posters that are more relevant to the company and put them in places where both developers and testers can’t be ignored.Method 2 : We can initiate something called ‘Tip of the day’ Mailing System from Quality Engineering Department.
Ways to implement Google's Testing on the Toilet concept
-
They started to write flyers about everything from dependency injection to code coverage and then regularly plaster the bathrooms in all over Google with each episode, almost 500 stalls worldwide.
Testing on the Toilet (TotT) concept
-
Dogfooding → Internal adoption of software that is not yet released. The phrase “eating your own dogfood” is meant to convey the idea that if you make a product to sell to someone else, you should be willing to use it yourself to find out if it is any good.
Dogfooding testing method at Google
-
-
spin.atomicobject.com spin.atomicobject.com
-
It's Faster
Makefile is also faster than package.json script
-
It's even more discoverable if your shell has smart tab completion: for example, on my current project, if you enter the aws/ directory and type make<TAB>, you'll see a list that includes things like docker-login, deploy-dev and destroy-sandbox.
If your shell has smart TAB completion, you can easily discover relevant
make
commands -
Variables. Multiple lines. No more escaped quotation marks. Comments.
What are Makefile's advantages over package.json scripts
-
-
stackabuse.com stackabuse.com
-
you want to pass a function as an argument to higher-order functions
Functional programming - passing functions as arguments, as opposed to data objects.
-
-
www.cs.cornell.edu www.cs.cornell.edu
-
standard JavaScript advice to avoid top-level function declarations and use modern arrow syntax
-
- Apr 2021
-
news.ycombinator.com news.ycombinator.com
-
This project will be great for instruction and portable reproducible science
This is what I'm aiming for with triplescripts.org. Initially, I'm mostly focused on the reproducibility the build process for software. In principle, it can encompass all kinds of use, and I actually want it to, but for practical reasons I'm trying to go for manageable sized bites instead of very large ones.
-
-
docs.microsoft.com docs.microsoft.com
-
To prevent race conditions and deadlocks, we highly recommend that each of the communication channels is serviced on a separate thread that maintains its own client buffer state and messaging queue inside your application. Servicing all of the pseudoconsole activities on the same thread may result in a deadlock where one of the communications buffers is filled and waiting for your action while you attempt to dispatch a blocking request on another channel.
-
-
en.wikipedia.org en.wikipedia.org
-
-
A good heuristic is to not trust the libraries you did not write either.
-
Within functions, you may want to check that you are not referencing something that is not valid (i.e., null) and that array lengths are valid before referencing elements, especially on all temporary/local instantiations.
-
-
stackoverflow.com stackoverflow.com
-
It seems inelegant to me to split this into two different modules, one to include, the other to extend.
the key thing (one of them) to understand here is that: class methods are singleton methods
-
Trust this answer. This is a very common idiom in Ruby, solving precisely the use case you ask about and for precisely the reasons you experienced. It may look "inelegant", but it's your best bet.
-
-
gist.github.com gist.github.com
-
Apparently when you create a subclass, that subclass's singleton class has # its superclass's singleton class as an ancestor.
This is a good thing. It allows class methods to be inherited by subclasses.
-
-
github.com github.com
-
Learn more about the Ruby's Object, Class & Module and the method receiver chain.
-
Detect undesirable changes to classes made by other libraries.
-
-
github.com github.com
-
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.1.0')
-
-
medium.com medium.com
-
I wish to define methods within the class they belong to. Using class << self demonstrates that approach clearly — we are defining methods within the actual singleton class scope.
-
When we usedef self.method, though, we are defining a method across scopes: we are present in the regular class scope, but we use Ruby’s ability to define methods upon specific instances from anywhere; self within a class definition is the Class instance we are working on (i.e. the class itself). Therefore, usingdef self.method is a leap to another scope, and this feels wrong to me.
-
-
www.redblobgames.com www.redblobgames.com
- Mar 2021
-
github.com github.com
-
ProMotion is a RubyMotion gem that makes iOS development more like Ruby and less like Objective-C.
-
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
If this is okay, then it might even be nice if #dig took a block as well as a fallback value: [].dig(1) { 'default' } #=> "default"
-
Would it be desirable to specify the new object in a block? That would make it somewhat symmetrical to how Hash.new takes a block as a default value.
-
-
en.wikipedia.org en.wikipedia.org
-
The distinction in computer programming between classes and objects is related, though in this context, "class" sometimes refers to a set of objects (with class-level attribute or operations) rather than a description of an object in the set, as "type" would.
-
-
en.wikipedia.org en.wikipedia.org
-
a class is an implementation—a concrete data structure and collection of subroutines—while a type is an interface
-
-
en.wikipedia.org en.wikipedia.org
-
Title: "goal the use case is trying to satisfy"[23]:101 Main Success Scenario: numbered list of steps[23]:101 Step: "a simple statement of the interaction between the actor and a system"[23]:101 Extensions: separately numbered lists, one per Extension[23]:101 Extension: "a condition that results in different interactions from .. the main success scenario". An extension from main step 3 is numbered 3a, etc.
Not sure why I find this example so interesting.
Probably because it is a human-readable outline that uses machine-readable (programming language source code) constructs, namely loops/iteration.
The format in which this is written in, then, is itself a kind of (high-level, human-oriented) programming language.
Example:
- numbered list of steps [introduces/names the loop/iterator/enumeration being done]
- Step: "a simple statement of the interaction between the actor and a system" [defines the inner part of the loop that gets "executed" once per iteration]
- numbered list of steps [introduces/names the loop/iterator/enumeration being done]
-
-
trailblazer.to trailblazer.to
-
Currently, I’m working on designing the interfaces and it’s real fun!
-
-
Tags
Annotators
URL
-
-
smallcultfollowing.com smallcultfollowing.com
-
Put another way, it’s become clear to me over time that the problems with data races and memory safety arise when you have both aliasing and mutability. The functional approach to solving this problem is to remove mutability. Rust’s approach would be to remove aliasing. This gives us a story to tell and helps to set us apart. A note on terminology: I think we should refer to aliasing as sharing. In the past, we’ve avoided this because of its multithreaded connotations. However, if/when we implement the data parallelism plans I have proposed, then this connotation is not at all inappropriate. In fact, given the close relationship between memory safety and data races, I actually want to promote this connotation.
-
-
github.com github.com
-
www.activepapers.org www.activepapers.org
-
There are currently three implementations of the ActivePapers concept: the Python edition, the JVM edition, and the Pharo edition
There is only one reasonable approach, and it's not even mentioned as an option here: the browser edition. (I.e., written to target the ubiquitous WHATWG/W3C hypertext system.)
-
-
www.theverge.com www.theverge.com
-
“There is very little incentive for Microsoft to make a significant change to features that are used extremely widely by the rest of the massive community of Excel users.”
Microsoft did the right thing here. Most users are not geneticists and they rely on automatic date conversion.
-
-
www.sitepoint.com www.sitepoint.com
-
JavaScript needs to fly from its comfy nest, and learn to survive on its own, on equal terms with other languages and run-times. It’s time to grow up, kid.
-
If JavaScript were detached from the client and server platforms, the pressure of being a monoculture would be lifted — the next iteration of the JavaScript language or run-time would no longer have to please every developer in the world, but instead could focus on pleasing a much smaller audience of developers who love JavaScript and thrive with it, while enabling others to move to alternative languages or run-times.
-
For instance, those who prefer classical inheritance may enjoy the addition of the class keyword, while others may reject it as conflicting with the idea of a prototypical inheritance model.
Tags
- good idea
- avoid giving partiality/advantage/bias to any specific option
- runtime environment
- object-oriented programming: classical inheritance
- neutral/unbiased/agnostic
- separation of concerns
- everyone has different preferences
- neutral ground
- software freedom
- programming languages
- programming languages: choosing the best language for the job
- competition in open-source software
- everyone has different opinions
- object-oriented programming: prototypical inheritance
- level playing field
- object-oriented programming
- rejecting an idea
- JavaScript: as a process VM
Annotators
URL
-
-
github.com github.comd3/d31
-
To the consternation of some users, 3.x employed Unicode variable names such as λ, φ, τ and π for a concise representation of mathematical operations. A downside of this approach was that a SyntaxError would occur if you loaded the non-minified D3 using ISO-8859-1 instead of UTF-8. 3.x also used Unicode string literals, such as the SI-prefix µ for 1e-6. 4.0 uses only ASCII variable names and ASCII string literals (see rollup-plugin-ascii), avoiding encoding problems.
-
-
-
multi-dimensional erector set that we're going forever
"A multi-dimensional erector set that will go on forever..."
No, unfortunately not forever.
-
-
en.wikipedia.org en.wikipedia.org
-
multi-paradigm: functional, imperative
-
-
stackoverflow.com stackoverflow.com
-
When you code in a semantic way, you basically give meaning to the data you're describing.
-
HTML elements have meaning. "Semantically correct" means that your elements mean what they are supposed to.
-
-
trailblazer.to trailblazer.to
-
In production, you will never trigger one specific callback or a particular validation, only. Your application will run all code required to create a Song object, for instance. In Trailblazer, this means running the Song::Create operation, and testing that very operation with all its side-effects.
-
There’s no need to test controllers, models, service objects, etc. in isolation
-
Internally, it creates and returns a fresh, subclassed activity (via patching) whilst replacing the step for given :id. Be advised that this does not change the original activity class.
Tags
- subclassing/inheritance
- testing: tests should resemble the way your software is used
- testing: avoid unnecessarily testing things in too much isolation, in a different way than the code is actually used (should match production)
- unnecessary
- testing: test the side effects
- testing: avoid testing implementation details
- object-oriented programming
- isolation (programming)
Annotators
URL
-
-
kirby.kevinson.org kirby.kevinson.org
-
yyyy-mm-dd hh:mm:ss
ISO 8601 date format. The only right date format
-
-
github.com github.com
-
Using ::delegates works exactly like the Forwardable module in Ruby, with one bonus: It creates the accessors in a module, allowing you to override and call super in a user module or class.
-
-
trailblazer.to trailblazer.to
-
Please note that the I/O DSL is only providing the most-used requirements. Feel free to use the low-level taskWrap API to build your own variable mapping with different scoping techniques.
-
-
trailblazer.to trailblazer.to
-
Remember, in a railway activity each task has two standard outputs with the “semantics” success and failure.
-
-
trailblazer.to trailblazer.to
-
The flow pipetree is a mix of the Either monad and “Railway-oriented programming”, but not entirely the same.
-
- Feb 2021
-
trailblazer.to trailblazer.to
-
In order to customize the latter one and add another step tidy_storage, you’d normally have to subclass all three activities and override steps.
-
The DSL will, per default, wrap every task with the Binary interface, meaning returning true will result in Activity::Right, and false in Activity::Left.
-
Note that you can return either a boolean value or a [signal subclass] in order to dictate the direction of flow.
-
a method that doesn’t have access to variables outside its scope
-
-
www.schneems.com www.schneems.com
-
The link name is not very helpful, it doesn’t explain what it does very well.
-
-
trailblazer.to trailblazer.to
-
-
Each step receives the return value of its predecessor. The return value decides about what next step is called.
-
In order to invoke, or run
-
the ability to “error out” when something goes wrong
-
Six lines of code create an executable object that, when invoked, will run your code in the order as visible in our diagram, plus the ability to “error out” when something goes wrong.
-
While you could program this little piece of logic and flow yourself using a bunch of Ruby methods along with a considerable amount of ifs and elses, and maybe elsif, if you’re feeling fancy, a Trailblazer activity provides you a simple API for creating such flow without having to write and maintain any control code. It is an abstraction.
-
Modelling the flow of a program where chunks of code are executed in a certain order, with a successful “happy path” and an “error-out” path is called a Railway. It popped up in functional languages
first sighting: railway-oriented programming
-
provide interfaces so you don’t have to think about them
Question to myself: Is not having to think about it actually a good goal to have? Is it at odds with making intentional/well-considered decisions?  Obviously there are still many of interesting decisions to make even when using a framework that provides conventions and standardization and makes some decisions for you...
Tags
- abstractions
- powerful
- Trailblazer
- good abstraction
- standardization
- software design patterns
- railway-oriented programming
- error/exception handling
- reduce/minimize/simplify/remove control flow code
- interfaces (programming)
- first sighting
- different names for the same/identical thing (synonyms)
- control flow
- programming: invoke/run/call
- I have a question about this
- intentional/well-considered decisions
- too many ifs: bad
- framework
- tutorial
- so you don’t have to think about it
- good explanation
- example
- good tutorial
Annotators
URL
-
-
en.wikipedia.org en.wikipedia.org
-
in functional programming, the terms "conditional expression" or "conditional construct" are preferred, because these terms all have distinct meanings
-
-
-
en.wikipedia.org en.wikipedia.org
-
The forms of the final keyword vary:
-
What Böhm and Jacopini's article showed was that all programs could be goto-free.
-
-
github.com github.com
-
But now, you can do the same thing in functional style!
-
Brings functional programming to Python land
-
Make your functions return something meaningful, typed, and safe!
-
-
sobolevn.me sobolevn.me
-
Let’s start with the same number dividing example, which returns 0 when the error happens. Maybe instead we can indicate that the result was not successful without any explicit numerical value?
-
Now you can easily spot them! The rule is: if you see a Result it means that this function can throw an exception. And you even know its type in advance.
-
You can use container values, that wraps actual success or error value into a thin wrapper with utility methods to work with this value. That’s exactly why we have created @dry-python/returns project. So you can make your functions return something meaningful, typed, and safe.
-
Exceptions are just like notorious goto statements that torn the fabric of our programs.
Tags
- rule of thumb
- safety (programming)
- traditional exception handling (try/catch; begin/rescue)
- type checking
- monad: monadic value (wrapping a value within the monad)
- programming: goto
- good example
- easy to see/notice
- Python
- type annotations
- analogy
- railway-oriented programming
- monad: Either
Annotators
URL
-
-
-
I'm not a fan of listing exceptions functions can throw, especially here in Python, where it's easier to ask forgiveness than permission.
-
-
www.morozov.is www.morozov.is
-
Railway Oriented Programming is a way to gracefully handle errors in your application
-
However, you don’t need to have an extensive knowledge of monads to use ROP in your code.
-
Railway Oriented Programming comes from functional programming, so it is tightly related to the usual FP concepts like monads, composition, and many others.
-
-
en.wikipedia.org en.wikipedia.org
-
The latter are important examples which usually also exist in "purely" functional programming languages.
How can they exist and it still be considered pure??
I guess that's not quite the same / as bad as saying something had side effects in a purely functional programming context, right?
-
-
www.martinfowler.com www.martinfowler.com
-
It reminds us that rather than asking an object for data and acting on that data, we should instead tell an object what to do.
-
-
dry-rb.org dry-rb.org
-
Another solution is using the Safe Navigation Operator &. introduced in Ruby 2.3 which is a bit better because this is a language feature rather than an opinionated runtime environment pollution
-
-
jrsinclair.com jrsinclair.com
-
The .chain() method allows us to switch over to the left track if an error occurs. Note that the switches only go one way.
-
This stuff is intoxicating once you get into it.
-
-
en.wikipedia.org en.wikipedia.org
-
In functional programming, a monad is an abstraction that allows structuring programs generically
-
Whatever language or default programming paradigm a developer uses, following the monad pattern brings many of the benefits of purely functional programming.
-
To emphasize how Just acts on the underlying value by wrapping it, it can be redefined as a function too, called eta for now
-
This is done to avoid confusion by differentiating between cases where a variable carries a defined value and those where it does not.
-
Research beginning in the late 1980s and early 1990s established that monads could bring seemingly disparate computer-science problems under a unified, functional model.
-
-
mmhaskell.com mmhaskell.com
-
So every program starts in the IO monad. From here you can get any input you need, call into relatively "pure" code with the inputs, and then output the result in some way. The reverse does not work. You cannot call into IO code from pure code like you can call into a Maybe function from pure code.
-
-
en.wikipedia.org en.wikipedia.org
-
Each of the programming language generations aims to provide a higher level of abstraction of the internal computer hardware details, making the language more programmer-friendly, powerful, and versatile.
-
-
en.wikipedia.org en.wikipedia.org
-
It turns out that, given a set of constraints defining a particular problem, deriving an efficient algorithm to solve it is a very difficult problem in itself. This crucial step cannot yet be automated and still requires the insight of a human programmer.
-
-
en.wikipedia.org en.wikipedia.org
-
Purely functional programming may also be defined by forbidding state changes and mutable data.
-
purely functional programming usually designates a programming paradigm—a style of building the structure and elements of computer programs—that treats all computation as the evaluation of mathematical functions.
-
Purely functional data structures are persistent. Persistency is required for functional programming; without it, the same computation could return different results.
-
-
en.wikipedia.org en.wikipedia.org
-
Most C++ template idioms will carry over to D without alteration, but D adds some additional functionality
-
-
-
fsharpforfunandprofit.com fsharpforfunandprofit.com
-
This is a useful approach to error handling, but please don’t take it to extremes! See my post on “Against Railway-Oriented Programming”.
-
-
fsharp.org fsharp.org
Tags
Annotators
URL
-
-
developpaper.com developpaper.com
-
This is the most popular article “railway oriented programming” on one of the most popular websites of F #.
I may have seen it before but not really paid attention to it, but this just might be the first time I stopped to look it up.
Because I saw the code below, didn't recognize the language, and was intrigued.
-
-
en.wikipedia.org en.wikipedia.org
-
which entails computer programming (process of writing and maintaining the source code), but also encompasses a planned and structured process from the conception of the desired software to its final manifestation
-
-
github.com github.com
-
One of the main reasons to work with components is re-usability and portability, but also a delegation of responsibilities. Adding a component should be as easy as simply adding the component without having to know the inner workings (or markup) of this component. A consumer should only be aware of the properties, methods and events of a component. In order to style a child component one has to be aware of the markup as well, which violates this 'delegation of responsibility'-principle.
-
-
trailblazer.to trailblazer.to
-
Using a terminus to indicate a certain outcome - in turn - allows for much stronger interfaces across nested activities and less guessing! For example, in the new endpoint gem, the not_found terminus is then wired to a special “404 track” that handles the case of “model not found”. The beautiful thing here is: there is no guessing by inspecting ctx[:model] or the like - the not_found end has only one meaning!
-
A major improvement here is the ability to maintain more than two explicit termini. In 2.0, you had the success and the failure termini (or “ends” as we used to call them). Now, additional ends such as not_found can be leveraged to communicate a non-binary outcome of your activity or operation.
Tags
- programming: return values / result objects that communicate a more precise/complete representation of the outcome
- improvement
- non-binary
- state charts
- unambiguous
- strong (extreme/great/high/intense degree/level/concentration/amount/quality of)
- Trailblazer
- advantages/merits/pros
- interfaces (programming)
Annotators
URL
-
-
www.washingtonpost.com www.washingtonpost.com
-
The Quest for Truth
The quest for Truth is everywhere and not limited to the economic topics linked here. This is just a topic that started a thought process where I had access to a convenient tool (Hypothesis) to bookmark my thoughts and research.
Primary thought is: The Quest for Truth. Subcategories would provide a structured topic for the thought. In this case the subcategory would be: US Economy, Inflation
The TRUTH is a concept comprised of inconsistencies and targets that frequently move.
Targets (data, methods, people, time, semantics, agenda, demographic, motive, means, media, money, status) hold a position in time long enough to fulfill a purpose or agenda. Sometimes they don't consciously change, but history over time shines light and opens cracks in original narrative that leads to new truth's, real or imagined.
Verifying and validating certain Truth is very difficult. Why is That?
-
-
-
You can rescue at the method level, but more likely you’d want to rescue at the statement level.
-
-
github.com github.com
-
Examples of different ways of defining forms
Wow, that's a lot of different ways.
The inline_form way in particular seems interesting to me, though it's worth noting that that method is just an example, not actually part of this project's code, so it's not really a first-class option like the other options.
-
-
en.wikipedia.org en.wikipedia.org
-
I think a better, more immediately understandable name for this concept would be command object, because it lets you pass around commands (or a list of commands) as objects.
That's the only thing you really need to know abut this pattern. The rest seems like boring implementation details that aren't that important, and that naturally follow from the primary definition above.
-
The central ideas of this design pattern closely mirror the semantics of first-class functions and higher-order functions in functional programming languages. Specifically, the invoker object is a higher-order function of which the command object is a first-class argument.
-
-
en.wikipedia.org en.wikipedia.org
-
In programming language design, a first-class citizen (also type, object, entity, or value) in a given programming language is an entity which supports all the operations generally available to other entities. These operations typically include being passed as an argument, returned from a function, modified, and assigned to a variable.
-
-
en.wikipedia.org en.wikipedia.org
-
In object-oriented programming, information hiding (by way of nesting of types) reduces software development risk by shifting the code's dependency on an uncertain implementation (design decision) onto a well-defined interface. Clients of the interface perform operations purely through it so if the implementation changes, the clients do not have to change.
-
-
www.infoworld.com www.infoworld.com
-
Stating that some language feature or common programming idiom (like accessors) has problems is not the same thing as saying you should never use them under any circumstances.
-
-
www.javaworld.com www.javaworld.com
-
Programming to interfaces is at the core of flexible structure.
-
-
softwareengineering.stackexchange.com softwareengineering.stackexchange.com
-
The more important point comes from a program design perspective. Here, "programming to an interface" means focusing your design on what the code is doing, not how it does it. This is a vital distinction that pushes your design towards correctness and flexibility.
-
My understanding of "programming to an interface" is different than what the question or the other answers suggest. Which is not to say that my understanding is correct, or that the things in the other answers aren't good ideas, just that they're not what I think of when I hear that term.
-
Programming to an interface means that when you are presented with some programming interface (be it a class library, a set of functions, a network protocol or anything else) that you keep to using only things guaranteed by the interface. You may have knowledge about the underlying implementation (you may have written it), but you should not ever use that knowledge.
-
The problem with this is that it creates a strong coupling between your code and the implementation, exactly what the interface was supposed to prevent.
-
If the program was important enough, Microsoft might actually go ahead and add some hack to their implementation so the the program would continue to work, but the cost of that is increased complexity (with all the ensuing problems) of the Windows code. It also makes life extra-hard for the Wine people, because they try to implement the WinAPI as well, but they can only refer to the documentation for how to do this, which leads to many programs not working as they should because they (accidentally or intentionally) rely on some implementation detail.
Tags
- programming to an interface
- +0.9
- using non-guaranteed/non-standard/private information
- software development: coupling
- focus on _what_ it should do, not on _how_ it should do it (implementation details; software design)
- what comes to mind (what one thinks of; meaning) when they hear something
- supposed to prevent
- implementation detail
- interfaces (programming)
- Wine
- important distinction
- good advice
- software design
- different way of thinking about something
- guarantee
- good point
Annotators
URL
-