4 ms·
I find the site a little tongue-in-cheek, but I genuinely like the ideas behind it. I honest-to-$DEITY prefer programming in C to any sort of Javascript. C is k
by bitofhope 8y ago
I find the site a little tongue-in-cheek, but I genuinely like the ideas behind it. I honest-to-$DEITY prefer programming in C to any sort of Javascript. C is kinda hellish for large, complex projects, which is good. The world needs fewer large and complex websites. OpenBSD also provides very good security features that mitigate the inherent security challenges of writing C. pledge(2) is just a very good idea.
I generally think websites should do their processing in the backend, whenever possible. Running code to generate the website should not be the user's problem. This also comes with the advantage of not being constrained to *Script languages. C is alright, but if you're of the defeatist camp who thinks writing C safely is impossible, you can adapt the BCHS philosophy just as well to C++, Rust, Go, D, Python, AWK, Common Lisp…
- rileymat2 8y agoC is also hellish for string processing. From memory management to buffer overflows to understanding the encoding types.
- mpweiher 8y agoObjective-C with a reasonable Foundation is such a great language for this... It has essentially the predictability and simplicity of C, just with a minimal amount of dynamic binding to make it comfortable. And NSString variants tend to take care of string handling and encodings.
- okket 8y agoAt that level, you can just switch to the clang compiler based Swift language, which is much nicer/modern. And look, there are already Swift web frameworks like https://vapor.codes https://vapor.codes
- gkya 8y agoI really dislike the Swift/Scala/Rust/Dart/Kotlin etc. style, heavy and centralised syntax. ObjC is not very beautiful, but it has an elegant way of combining composable primitives (functions and objects). The same kinda sorta goes for Perl too, which I think is a nicer alternative to C in this stack.
- mpweiher 8y agoEr...not really. First of all, the context was "C is pretty nice for this". Objective-C adds just a tiny bit on top of C, including safe/correct string handling, and is otherwise very similar in its characteristics. Swift is an entirely new language, more like Rust or Kotlin. It's also not based on the clang compiler, clang is a C/Objective-C/C++ front end for LLVM. As to "nicer/modern", well...it does clean up some of the effects of having a hybrid (syntax duplication). Other than that, it is in many ways a step back towards C++ style languages, static/brittle, incredibly complex and incredibly slow to compile.
- earenndil 8y agoSmall nit: swift is built in llvm, much like clang is, but it's not based on it.
- mhd 8y agoIf only WebObjects would've arrived without an unnecessary Java rewrite.
- peatmoss 8y agoI also remember when Apple was pushing Java as an option for writing Cocoa apps. What little I did back then never felt like a first class citizen compared to ObjC.
- bonaldi 8y agoIs there any reasonable way to get an objective-C equipped with an NSString variant on Linux? GnuStep seems mostly abandoned.
- jstimpfle 8y agoI recently wrote a couple dozen lines of code around Windows Fibers for cooperative multitasking. This makes for much nicer code than the callback style approach from Javascript. But anyway for a larger codebase that is about GUI interaction I figure you want more control than what these models provide. You don't want to write event handlers that "push" actions. You want to pull them and process them in a known context. String handling in C is in general much better than its reputation. You just need to write a couple lines that format to allocated buffers. And you want to error out in case of OOM. Can't check each allocation on the spot. And you need some sort of pool that can release all allocations of the same lifetime at once. (I don't know that this approach is practical for typical web applications, which are extremely string-heavy. It is indeed quite practical for games or compilers.)