logoalt Hacker News

eruyesterday at 2:10 PM2 repliesview on HN

I can write numbers like three by just writing 3 in my code. When I want a named number I use a syntax like x = 3. Why should functions be any different? A language doesn't need different ways to name things for each type of thing. Integers, strings, functions etc: they can all use the same mechanism for naming.


Replies

somatyesterday at 9:39 PM

Fair enough, But I am of the opinion that blocks of code and magic numbers should almost always be named, There is a lot of intent that is lost when the name is skipped.

It is also my main complaint about traditional math notation, They enjoy trying to make the notation as concise as possible, single letter symbols, embedded subparts, no names for anything. I understand that having super a tight concise notation is a massive benefit while in the flow state, thinking about the problem. But man it makes it rough for us casual math enjoyers coming in fresh to the topic.

ueckeryesterday at 2:27 PM

I agree if your language is designed like this from the beginning as functional languages are, but in C you already have different syntax for functions. (edit: rephrased)