Terrifying me as hell
I even doesn't know which one the most, proc or redundant visual noise in c/cpp ;
Is there some hack to change proc to def or func or fn ? My guess it wouldn't be so difficult to create a fork with just one word for change, and compile it, am i right ?
I think proc is a good keyword. Note that in older languages like Pascal, Modula, Oberon PROCEDURE was used, which is too long.
def is not that nice, because we can not only define code procedures, but other symbols like variables, types, constants...
fun may be ok if the code only returns a result but does not modify internal state. But note that programming can be fun, but not always is, so fun keyword is a bit silly.
No keyword for callable code as in C/C++ makes searching in editor for start of function more difficult.
So Nims proc and func keywords are fine for me, as I can not imagine something better currently.
And finally, if your post has serious intent and you really have a mental problem with proc, you may consider using Nim's source code filters -- I have considered using it for allowing tabs, but never really used.
Source code filters are a bit restricted, seems that the have to be placed at the top of a file, only one can be used, they don't work with regular expressions, and they work on all input data, also for strings. So it is no serious solution, but maybe helps you starting with Nim, as it did for me in early Nim days for using tabs. (I still miss them...)
#? replace(sub="def ", by="proc ")
proc test1 =
echo "Hello 1."
func test2 =
debugecho "Hello 2." # as echo can have side effects
def test3 =
echo "Hello 3, def "
test1()
test2()
test3()
Yeah, i know about history and predecessors ;) but anyway it sounds for me like proc[urrent] not like proc[essor] , so it's always scratch my ear as hell, even more simplified pr would much-much better
and i found it already really attractive, suddenly
def is not that nice
got it, you right
fun may be
not FUN at all, so what then!?
(kotlin is garbage)
ahaha, that's what I am talking about =)
C/C++
must die already, agree, almost century of «best practices»... just make it stop ;{
you really have a mental problem
definitely heh, it also remind me the first half of surname some person, that also just a little bug me, but hey, I'm switched to KDE Linux for total customising, to do everything as I need, so I believe that every Linux stuff must have the same mindset, besides, the most configurable product, that can suit for everyone without any drawbacks for others — will conquer the minds of majority!
Source code filters are
just what I need! Thanks mate!!
but what wrong with tabs?
Note that in older languages like Pascal, Modula, Oberon PROCEDURE was used, which is too long.
Oh, come on. Too long? Araq's complaint about capitalized keywords makes more sense than this. It's not as if you type PROCEDURE on every line, and with code completion in most editors these days you don't even have to type BEGIN and END...
Lots of redundant visual noise — will worsen readability and slows your down during refactoring
as for CAPS, CAPS is... just look at the SQL lang, it's a real time machine..
wanna go back?
That's a typical reaction of someone coming from Python and thinking that proc has the exact same usage as def. In Nim there's also func, iterator, and method.
Maybe I'd recommend adding more proc-alternative keywords to make definitions less verbose, like...
Now: proc uname*(a1: var Utsname): cint {.importc, header: "<sys/utsname.h>".}
New: importc sys.utsname.uname*(a1: var Utsname): cint
But I'm not sure... 🤔
it sounds for me like proc[urrent] not like proc[essor]
Actually, it is short for proc[edure]. What does procurrent even mean?
Naming this is hard, but I think “proc” is really nice - precise, the right sort of length, and unlikely to clash with a variable. I’m surprised it hasn’t been used in more languages.
It’s especially nice combined with “func” (same length, nice!) for side-effect free procedures. This sort of elegance is a big part of what attracts me to Nim.
After reading this article https://en.wikipedia.org/wiki/Pseudocode I'm starting to get involved (slowly)
yeah I noticed the length too, really nice look
I’m surprised
but I'm not =) it sounds weird, that's why..
anyway I found nice thread https://forum.nim-lang.org/t/2811 and I have some idea ;)