4 ms·
Static typing is easy for newbie developers. It sets hard boundaries, and when you remember those rules, it's easy to follow what the code does. You don't have
by slavoingilizov 13y ago
Static typing is easy for newbie developers. It sets hard boundaries, and when you remember those rules, it's easy to follow what the code does. You don't have to step through it in your head and think about it much to figure it out.
With that said, I think Apple are pushing the language in that direction, because recently everyone started developing for iOS, even people who didn't program at all. Apple is trying to make it easy for them. I see nothing wrong with that. It may not be the best from a programmer viewpoint, but I can understand it.
P.S. I think this is why Microsoft has embraced static typing throughout its developer ecosystem. It makes learning from scratch much easier and developers (although not very experienced ones) flock to your platform. Of course this same thinking created ASP.NET and shortened the lives of many good men. But you cannot judge them, really.
- bsaul 13y agoI really don't see how static typing can be associated to "newbie" coding in any way. Haskell, Golang, Ocaml, and even Scala, clearly aren't aimed at newbies "let's code an app cause that's cool" kind of developers, and they both embrace static typing. The only reason i see why you wouldn't want the "compiler" to understand what data structure your function is accepting or returning is when this data structure is far too complex to be represented as a single type in a meaningful way (such as json deserialization returning "Array Or Dictionary" kinds of types). But apart from that, i can only see advantages in terms of IDE assist (autocompletion, refactoring), code clarity and safety.
- chc 13y agoI think what slavoingilizov is that it makes it easier for companies to make use of inexperienced programmers, not that it helps non-programmers get up and running quickly. The additional automatic checks and IDE assistance enabled by static analysis can help partially paper over a novice's shortcomings.
- to3m 13y agoEasily comprehensible code? Hard boundaries, and the ability to figure out what the code does without having to mentally step through it? Perhaps you can even click a button when the cursor is on an identifier, and be taken to the definition of the entity of that name, or the small subset of possible entities of that name that this identifier could refer to? Possibly the computer could check your work without your even having to run it, and actually prove that certain types of error cannot possible occur? That actually sounds really helpful and I'm not sure why people don't embrace it. (One point you do make that is quite correct is that static typing is helpful for novices. And yet so many languages designed for beginners' use try to make things "easier" by turning typos into new variables, letting variables switch type, and generally poking their user in the eye. Never figured this one out - though I suppose this is good training for the novice programmer, because programming is such a straightforward activity and without having the language itself to keep them on their toes they might find it insufficiently exacting, not demanding enough, and requiring basically nothing in the form of concentration, thought and precision.)
- enjoy-your-stay 13y agoActually Microsoft's earlier and very successful development tools were all dynamically typed versions of Basic. Visual Basic, Access, Excel and ASP were all dynamically typed, and were very responsible for exploding Windows' market share from Windows 3.0 onwards as it encouraged many to start programming who never would have considered it before. Unfortunately they created an ecosystem of novice developers that many within MS I think despised and looked down on and which gave their platform a bit of an unprofessional reputation. Then along came Java and showed them that a relatively sophisticated and strongly typed language could raise the entry bar just a bit, but result in generally much higher quality of end product, so along came C# and out went VB and COM. 'Classic' ASP has also been responsible for much hair loss in early webmins.
- poizan42 13y agoSorry for nitpicking, but COM is in no way out - it forms the basis for WinRT. Also COM in itself doesn't have much to do with dynamic typing - sure there is IDispatch which allows your code to be called from dynamic languages, but that's about it.
- _random_ 13y agoUsually dynamic languages are recommended for newbies - such as Python. Newbies don't care about basic correctness or safety of their programs, it's more important to "get something on the screen" quickly to stay motivated.