5 ms·
when I first saw Golang, I hated it, but now I think it's the best server side language. Galang is an insanely pragmatic language. It's not fancy, just works.
by crazychrome 12y ago
when I first saw Golang, I hated it, but now I think it's the best server side language. Galang is an insanely pragmatic language. It's not fancy, just works.
Facing Swift, I had mixed feelings. It's a beautiful language, probably as pretty as Ruby, but what really makes it unique, or extremely productive? I can't find any.
Am I the only one agrees with the author that generics probably do more harm than good. I'd argue that generic gives programmers a fake feeling of control and easily leads programmers spending time on over design.
- orbifold 12y agoWhat will make it unique is its painless support of Apple libraries and platforms.
- zoomerang 12y ago> Am I the only one agrees with the author that generics probably do more harm than good It's really the same debate as 'Dynamic' vs 'Static' languages, since without generics your code is relying on runtime type checking in anything remotely complex, thus is effectively a dynamic language. Personally, I'm of the opinion that people that don't like static typing only feel that way because they've only used the shitty implementations in Java or C#. Regardless, This is a religious war that has raged for decades, and isn't likely to be answered anytime soon. The answer really comes down to "It Depends". I fall firmly in the 'static typing is good' camp, mainly because I have hard evidence to back up my opinion that it results in significantly fewer defects. (Specifically, very clear reports from from issue tracking systems showing our defect rate in production dropping by 90% (!!!) when we switched from Groovy to Scala, with a notable increase in productivity). Some of the developers complained, since they had to learn knew tools. But being professionals, they learned new tools and were better off for it. Now while I'm an extremist religious zealot about proper static typing being the one true way, I'm quite mindful that, for many developers, that tasks they are working on just aren't complex enough for it to make much of a difference in practice - they are able to test all edge cases and deploy stable software to production, just with a little more runtime testing than they'd otherwise need. Some languages - such as Go, or pre-enlightenment Java, do not implement Generics, and thus require runtime casting in many cases. In these languages, there's still a degree of compile time checking, just not as thorough as it should be. As with dynamic languages, they can work with no perceived issues for projects up to a certain size and provide a reasonable halfway point. Beyond this, you're going to hit a wall. As to your argument that Generics do "More harm"? I'd strongly disagree. If you're unfamiliar with the gotchas generics introduce (i.e. Variance can be a mindfuck), then they can seem difficult and problematic. But like any other professional tool, once you've gotten over the learning curve you're more productive with it than without. tl;dr If I wanted to bang a few pieces of wood together, I'd feel comfortable using a Hammer. the learning curve small, and I can connect those two pieces of wood in no time. My Uncle is a carpenter. As a professional carpenter, he bangs pieces of wood together all day long, every day, for his entire career. As such, a nailgun is a more appropriate tool. While being more complex to use and having a steeper learning curve, he's a professional, and uses a professional tool to do a professional job. Occasionally he might want to bang some quick project together in his shed, and getting out the nailgun is overkill, so he uses a hammer for the odd thing here and there. I'm a professional programmer. I use professional tools, even if they have a steeper learning curve and might be more complex. Occasionally I want to whip up a quick script, so will just hack it together in Python.
- crazychrome 12y agoI do agree with your points, but i think you've over generalised them into a degree that discussion is not only unnecessary but also childish. Let's restore the context back to Swift in iOS programming to match its targeting market, shall we? Could you come up with 1 use case which: .. generic is really useful. .. the problem hasn't solved by well recognised 3rd party lib/framework.(by "well recognized" i mean github starred or forked more than 500.) .. should be used in 10% of the top 100 apps on Appstore.
- josephlord 12y ago> Could you come up with 1 use case which: .. generic is really useful. Errm arrays/dictionaries that return typed objects so that you don't have to cast everything from id either with an ugly explicit isKindOf test or just hoping for the best? There is nothing that strong typing fixes that can't be fixed by just coding it right but when has everything been coded absolutely right without bugs? And even if it is coded right to start with when you make a change if you forget one rare case where it is used during your refactor you can end up with a crash in the field or with Swift a compile time error that you fix in a second.
- zoomerang 12y ago> generic is really useful Container types are the most obvious. Lists, Arrays, Dictionaries, Vectors, Stacks. You'd be hard pressed to find code that doesn't use a container type of some kind.
- lerno 12y agoIncidentally the problem is much smaller than in a statically typed language with containers. Compare the difference between a Java list prior to generics and afterwards. Using it in Java was an orgy of object casts. This is not the case for dynamically typed languages. In fact, the common approaches to containers valid in a statically typed language is largely wrong in a dynamic language.
- nikon 12y ago
- iopq 12y agoGolang is an evolutionary dead end. It missed out on the last 25 years of language research. I'm following Rust more closely because it has new ideas for systems programming. Go has no new ideas.
- crazychrome 12y agoRust is interesting one. The only part I dislike is the pointer ownership. Can they work out a better model/analogy after 15 years of Boost?
- iopq 12y agoPointer ownership prevents memory bugs and concurrency bugs. When you have the combination of aliasing, mutability and concurrency is when you have all of these Heisenbugs. Rust attacks it from the angle of not having aliasing. You can have mutability and concurrency, but only one thread should have ownership of the thing being modified.
- keeperofdakeys 12y agoPointer ownership is the most important feature of Rust, and everything is built around it. The management of memory, auto-freeing of resources (a mutex unlocks simply when it goes out of scope). It also ensures that no piece of memory has more than one pointer which is mutable at any one time, allowing many optimisations that const in C++ does, but without actually having to annotate all your variables. You can also guarantee that a new thread shares no memory with another thread, preventing many types of race conditions. Goodbye to memory leaks, goodbye to buffer overflows, goodbye to use-after-free, goodbye to null pointer crashes.