Earlier quoted context omitted.
I tried switching to US a few times, but every time muscle memory made me give up soonish - especially since there are big benefits to using same keyboard layout as other people in your office are using. Also practically everytime I need to write a comment, commit message or email I need my č, š and ž. It's kinda nice to have them only a single keypress away.
My hack: use caps key to switch to local keyboard layout while holding it.
Pretty.c
131–140 of 227 posts
Re: Pretty.c
#132Earlier quoted context omitted.
Today I learned that there exist people who use non-US layouts when coding. That’s spectacular!
I tried switching to US a few times, but every time muscle memory made me give up soonish - especially since there are big benefits to using same keyboard layout as other people in your office are using. Also practically everytime I need to write a comment, commit message or email I need my č, š and ž. It's kinda nice to have them only a single keypress away.
Re: Pretty.c
#133Earlier quoted context omitted.
This code is incorrect, but I don't blame them. :) Probably one of the most common float-related mistakes, even among people who "know how floats work". FLT_EPSILON is the difference between 1.0 and the next larger float. It's impossible for numbers less than -2.0 or greater than 2.0 to have a difference of FLT_EPSILON, they're spaced too far apart. You really want the acceptable error margin to be relative to the si…
Indeed, FLT_EPSILON is not a one-size-fits-all solution, but it's good enough for frequent case of comparing big enough numbers, which is not covered by regular ==. So it's a convenience/correctness trade-off I'm ready to make.
Re: Pretty.c
#134If you find this interesting, you might like libcello.h aswell! https://www.libcello.org
Re: Pretty.c
#135Earlier quoted context omitted.
There’s so many assumptions here about a person who’s starting to learn programming. For starters, that they’re on Linux, they feel comfortable running complex CLI commands, they can memorize the U.S. layout just like that, and that they can type without looking at the physical keys (because changing the virtual mapping means keys produce something else than what the label says). In reality, the learner’s first expos…
On the long term, using the native keyboard hinders yourself a lot. I tried to do so with the Spanish (es) layout, it's pretty much unergonomical. It's looks like being deliberately designed for press/office usage and not for proper programming.
The AltGr brackets are fine. The truly annoying character to type is the backtick (which is a quite new addition to the pantheon of special characters, C doesn’t use it).
My personal opinion is that Niklaus Wirth had the better overall ideas about clarity and inclusiveness in programming language design, but that battle is long lost. (What you consider the character set needed for "proper programming" is really a relatively new development, mid-1990s and later.)
Re: Pretty.c
#136It claims to be a scripting language but you still have to compile the programs. Boo! Add CINT ( https://root.cern.ch/root/html534/guides/users-guide/CINT.ht... ) and you can have instantaneous execution and even a REPL!
Well, who said that scripting language cannot be compiled? And yeah, Clang-REPL is another way to make it REPL-friendly.
Re: Pretty.c
#137It should be no harder than C#’s foreach(var i in list)
Re: Pretty.c
#138For each looks convoluted, you shouldn’t have to list the type. It should be no harder than C#’s foreach(var i in list)
Re: Pretty.c
#139For what it’s worth this makes the same mistake that Python 2 did: string and bytes are not the same type and shouldn’t be treated as such.
If it's "human-readable text", then fine, a string is not the same thing as an arbitrary byte array.
But lots of languages don't enforce that definition.
Re: Pretty.c
#140For what it’s worth this makes the same mistake that Python 2 did: string and bytes are not the same type and shouldn’t be treated as such.