Hillel Profile picture
May 6 11 tweets 4 min read
One of my favorite things with learning about new programming languages is seeing all the "small ideas" that could easily be picked up by other languages. Here are some examples:
D has a special "unittest" block as part of the language syntax, instead of relegating it to a framework. You can have the unittests checked on every program run if you want

dlang.org/spec/unittest.…
In Eiffel you can mark any method as "obsolete". JVM and .NET do something similar as an attribute, I think it's neat how in Eiffel it's a part of the language semantics

eiffel.org/doc/eiffel/ET-…
Clojure vars can have arbitrary metadata, which doesn't effect value comparison. So you can distinguish between data that's important for the program execution and data you're tracking to help out the developer

clojure.org/reference/meta…
In Chapel, variables and constants can be made into `configs`, which makes them changeable with CLI flags. ie if you have `config var foo = 1;`, you can run `./program --foo=17`

chapel-lang.org/docs/primers/v…
Powershell functions can have an explicit `Param` block where you define attributes for each function parameter, like default values, help docs, validation constraints, etc.

docs.microsoft.com/en-us/powershe…
Ruby has a few interesting bits. Method names can end in `?` or `!`, and by convention `name?` returns a boolean value and `name!` is a "dangerous method"

docs.ruby-lang.org/en/3.1/syntax/…
Ruby also has `backtick syntax` to run shell commands, which makes replacing a bash script with a ruby one super easy, though that's now considered an antipattern

hilman.io/blog/2016/01/s…
Frink has special syntax for date values. You can write `# 2001-08-12 #` to mean the *date* 2001-08-12, instead of writing something annoying like `Date(2001, 7, 12)` an remembering that months start at 0

frinklang.org/#DateTimeHandl…
I like small ideas because other languages can more easily explore them. It's easier to add date literals to a language than it is to add a borrow checker
Oh, one I forgot from #jlang! J has extended numeric notation:

3e3 = 3000
(1r2 + 1r7) = 9r14
3p2 = 3π²

e is especially nice because you can literally write avogadros number as 6.02e23

code.jsoftware.com/wiki/Vocabular…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Hillel

Hillel Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @hillelogram

May 6
Here is the difference I think *they* are trying to make:

* "Coding" is a general term for developing any kind of software
* "Scripting" is a subset of coding, for making bounded linear "uncomplicated" batch jobs that assist people.
Scripting has a lower entry barrier than general-purpose coding. It's also a lot "easier": a beginner scripter can do a lot more with scripting than a coder can do with coding. For these reasons, general-purpose coding is considered more prestigious than scripting.
In my opinion, this is a very good thing. Scripting SHOULD be easier than coding, because then it's accessible to more people. You shouldn't have to know about testing, version control, packaging, modularization, and API design if you just need to scrape a few websites
Read 7 tweets
May 6
Nuclear take: XML is actually a great format for adding metadata to unstructured text. It just sucks for representing structured data, which is, uh, what all the tooling and tutorials assume you're using it for
Why would you want to add metadata to unstructured text? To get metafiles, of course! I'm using it to store a series of iterations to a piece of code in one file, which I then use for making tutorials <spec name="threads_liveness" num="4"> -
You can tell this is Not Intended Use Case because all the tools are super weird about text following tags that aren't in other tags, even though that's the whole benefit of XML over JSON and YAML— inline markup
Read 5 tweets
Jan 17
Someone on Lobsters shared this perfect example of how to detect crackpottery. Notice the "topic mania", how it leaps from topology to category theory to blockchains to hypergraphs to particle physics to economics w/out actually justifying anything

medium.com/@lee.papa/a-br…
Other signs of crackpottery:

- A fixation on grand unifying theories of everything
- Use of common crackpot topics, like fractals and hypergraphs
- Tons of namedropping and vaguely-relevant quotes
- Love of fancy technical terms (to give veneer of authenticity)
What's so amazing about crackpottery is its universality. I've seen these same signs in crackpot physics, biology, history, math, and CS. You wouldn't expect the detection heuristics to apply everywhere... but they do!
Read 5 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(