4 ms·
C. Just basic data types.
by khitchdee 8y ago
C. Just basic data types.
- drb91 8y agoC is in no way typeless. Furthermore, i would expect a well behaved dev to avoid c at all cost.
- khitchdee 8y agoWell, this article is about Result types in Swift, and my point is, I think this kind of thing is overkill. It tends to make the learning curve for a new programmer steeper because there's all these extra bells and whistles provided by the language that have to be learnt before you can get going, and then you have sample code and tutorials and so on. Learning and using C was and is a lot simpler than say Swift.
- drb91 8y agoThis is completely true. However, after having learned both sides, I certainly appreciate the compiler’s help. I think it’s the classic tradeoff between specialization and accessability at play here.
- khitchdee 8y agoI think the designers (Apple) have targeted a certain class of apps with Swift, XCode and the underlying libraries (Cocoa). A majority of their existing developer base will likely benefit from what they've done. But from the point of view of new developers and someone who's just trying to use the hardware in an effective way, this is not a step forward.
- pjmlp 8y agoI keep hearing for about 30 years now, how writing correct code in C is just a matter of being good.
- khitchdee 8y agoIt's a matter of getting good at it and that takes time and effort, but the end result is far better than not getting good at it and using a more automated, higher level lanuggae to take the easy way out
- pjmlp 8y agoIf not even Linux kernel developers with their merge review process and stress tooling are good at it, what to say of the more mundane developer... https://www.cvedetails.com/product/47/Linux-Linux-Kernel.html?vendor_id=33 https://www.cvedetails.com/product/47/Linux-Linux-Kernel.htm... http://openwall.com/lists/oss-security/ http://openwall.com/lists/oss-security/
- khitchdee 8y agoSome people develop good coding techniques, like Donald Knuth. If you're new, you set out on your own or read up on what they've done or get lucky and work with a good programmer. That's how you pick it up. But, it's all pedal to the metal. Knuth's entire work is for C. Nowadays, everything is done at a high level using some kind of pre-existing framework and the type of code being written is cookie-cutter so none of this applies. Swift belongs to this new age trend in coding,
- pjmlp 8y agoSo you are stating no one on Linux kernel development is a match to Donald Knuth, and given the CVE track record they should improve themselves to Donald Knuth level. If there is anything new about Swift, it is a return to the past of proper programming languages. "Oh, it was quite a while ago. I kind of stopped when C came out. That was a big blow. We were making so much good progress on optimizations and transformations. We were getting rid of just one nice problem after another. When C came out, at one of the SIGPLAN compiler conferences, there was a debate between Steve Johnson from Bell Labs, who was supporting C, and one of our people, Bill Harrison, who was working on a project that I had at that time supporting automatic optimization...The nubbin of the debate was Steve's defense of not having to build optimizers anymore because the programmer would take care of it. That it was really a programmer's issue.... Seibel: Do you think C is a reasonable language if they had restricted its use to operating-system kernels? Allen: Oh, yeah. That would have been fine. And, in fact, you need to have something like that, something where experts can really fine-tune without big bottlenecks because those are key problems to solve. By 1960, we had a long list of amazing languages: Lisp, APL, Fortran, COBOL, Algol 60. These are higher-level than C. We have seriously regressed, since C developed. C has destroyed our ability to advance the state of the art in automatic optimization, automatic parallelization, automatic mapping of a high-level language to the machine. This is one of the reasons compilers are ... basically not taught much anymore in the colleges and universities." -- Fran Allen interview, Excerpted from: Peter Seibel. Coders at Work: Reflections on the Craft of Programming
- TimJYoung 8y agoI understand what you're saying, and I agree to some extent. I'm not sure if these kinds of types are actually making things easier or more difficult for learning the underlying language. There's something to be said for stopping at a certain point, or taking more caution with "kitchen sinking" the language design. For example, I think that promises in JS are a mess, and Go has it right with coroutines. The underlying problem was callback hell, and promises just replaced one set of problems with another and are, IMO, not nearly as easy to reason about.