5 ms·
While typing is a good way to reduce programmer errors, specially for large scale programs, it's much like autocomplete in a word processor. It's cool to have b
by khitchdee 8y ago
While typing is a good way to reduce programmer errors, specially for large scale programs, it's much like autocomplete in a word processor. It's cool to have but also a bad habit to form. The quality of prgrams would improve if such aids were reduced and the programmer was expected to form good programming habits instead.
- joncfoo 8y agoMaybe a quick spell check would've caught the misspelling of prgrams or maybe more proof reading is the answer. /s :D Types are a tool just like auto spell checking. Why not leverage them to reduce cognitive load?
- taeric 8y agoAmusing example, since my phone's autocorrect seems quite often to increase my cognitive load.
- drb91 8y agoWhat would a typeless language look like?
- khitchdee 8y agoC. 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,
- igouy 8y ago"In BCPL,flexibility is retained by eliminating the concept of data types and representing all quantities by bit patterns of the same length. A single vector may, for example, hold bit patterns representing numbers, booleans and pointers to other vectors. Variables are declared before use, but simply as variables, not as variables of any particular type." See chapter 13 example BCPL programs: http://www.cl.cam.ac.uk/~mr10/bcplman.pdf http://www.cl.cam.ac.uk/~mr10/bcplman.pdf See chapter 13 example MCPL programs: http://www.cl.cam.ac.uk/~mr10/mcplman.pdf http://www.cl.cam.ac.uk/~mr10/mcplman.pdf
- orbifold 8y agoSounds like a nightmare, this is basically the type system of vanilla verilog: Everything is just a bitvector of a certain length, each bit can have four states X,Z,0,1, so that it allows you to assign to a 32bit vector a 16bit vector resulting in the upper 16bit to be undefined. System verilog added structs, but if you declare them packed they allow unstructured assignment. Overall it is a complete nightmare given the fact that at the end you will tape out a chip that might cost >1 million to produce.
- pjmlp 8y agoBCPL main goal was to Bootstrap CPL, but then some people decided to use it on its own, and the rest is history.
- wool_gather 8y agoI assume you mean the static typing that Swift has, in favor of something like Python or Ruby, where the type of thing in a variable is both implicit and unfixed. Saying that there should be no types at all is...well, maybe it's just a failure of my imagination, but I don't even know how you could write a program. Even assembler has types.
- khitchdee 8y agoWell I think basic data types are enough to express what the variable is expected to hold. Any highewr level types above that, such as what higher level languages provide are, I think a luxury for lazy programmers
- ryanpetrich 8y agoWe should also remove airbags and seatbelts in automobiles. Surely then better driving habits would form.
- dep_b 8y agoRemoving protective padding and helmets might help in American Football. Rugby doesn't use them and it's actually a safer sport. But apart from that: the guy is wrong of course! Working in JavaScript still drives me crazy because I don't have decent autocomplete and no IDE warnings I'm using an API wrong.
- steve_adams_86 8y agoIt's worth checking out Visual studio code. It is a fairly advanced JavaScript IDE in my experience. Using it with TypeScript is amazing if you're willing to put up with the overhead of compiling to JavaScript (though you can run TypeScript without a compile step in the server using node-ts). These tools make JavaScript a lot nicer for me, and actually pretty enjoyable!
- khitchdee 8y agoIt's more like pre-tensioners in seatbelts are not as neccessary as seatbelts themselves.
- pram 8y agoThis seems like some bizarre luddite-esque argument. We should use computers to aid our work, but not too much!!
- khitchdee 8y agoIt's more an expression of "if it any broke don't fix it" or a minimalist approach to prorgamming.
- Jtsummers 8y agoProgramming is broken though. If it weren't, we wouldn't have so many issues with our main operating systems and popular applications. The desire to remain ignorant of the problems (by not using tooling which can reveal it) is remarkably popular, however. Enjoy your bliss!
- khitchdee 8y agoWell the tooling you are referring to is more like buildingin an automatic sensor into a basic tool. So it's an enhancement to a basic rtool functionality, not a new tool. I'm only questioning the usefulness of that enhancement, since it results in programmers not caring about a certain aspect of their programming. It's sort of like exception handling, while it exists, it rarely gets activtaed in real programs.
- dagenix 8y agoI've read many people complain about static typing + more advanced type systems making programming too hard. This is the first time I've ever read someone assert that they make programming too easy.
- khitchdee 8y agoThey try to make programming easier but fail at it. Experienced programmers take this change in their stride. New programmers are most effected.