Live data from Hacker News

Chris Lattner on the Realm WWDC 2017 Swift Panel

oleb.net

21–30 of 120 posts

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#21
post #4

Wow, he just really really does not like C++. He is certainly an extremely knowledgeable C++ guy, obviously Swift is written in C++, but it's hard to entirely agree with his opinion on it across all fronts.

As someone who spent over 20 years writing applications in C, anything built on C is crap and that includes C++ and Objective C. Writing code is fun and interesting. But most software development is not writing code. It's a little bit of build management, even more testing, but mostly it's debugging. Debugging is not as fun as writing code. Every language feature that makes debugging more necessary, harder to do and…

> As someone who spent over 20 years writing applications in C, anything built on C is crap and that includes C++ and Objective C.

Maybe that the problem, if you see C++ as something "built on C" then it logical that the see a lot of the same problem. C++ evolved from C to specifically address a lot of the weakness in C.

> Every language feature that makes debugging more necessary, harder to do and more time intensive sucks. Dangling pointers are the absolute worst.

language design is an exercise in compromise, and there is space for multiple compromise points on the spectrum. C++ decided (for better or for worst) to go for performance vs nice debugging experience.

> I can easily give up multiple inheritance for a more functional language that's far easier to write correct code in.

Am i the only getting tired of this kind of blanket statements ?

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#22
post #17

Earlier quoted context omitted.

Indeed, there is a debt to Go's simplicity: https://dave.cheney.net/2017/06/15/simplicity-debt https://dave.cheney.net/2017/06/18/simplicity-debt-redux And slowly, the language is expanding in very obvious conclusions. Personally, I think there needs to be a balance in a language, where it should not be too restrictive in its syntax, but on the other hand, it should not be overly complex and has too much syntax. I am…

Don't get me wrong, Go's simplicity comes with considerable tradeoffs and I'm not sure I'd use it in most cases again (started a greenfield codebase with it 3 years ago which is now around 200kloc). Just pointing out that syntactic edge cases can make writing easy, but most of programming (beyond one-off scripts) isn't writing. See: Scala and C++. Companies using these languages in production frequently disallow enti…

As I said in another comment, there seems to be a battle between extremes. On one end, the "complex" C++, Scala and others. On the other, simplistic stuff, such as JavaScript, Go, etc. It's probably gross injustice to put Go and JS in the same category, so I apologize, but for this argument, let's over look it. I think Swift and Rust are a good middle ground here.

With your large project, in hindsight would you prefer Go or C++? At least with C++, you can go as complex as you want, or stop and set some "rules" that should not be passed. But I err on the side of having the option rather than being restricted.

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#23
post #9

Earlier quoted context omitted.

There is some truth to what you are saying. I'm not a beginner so I probably can't appreciate how hard it is to learn new syntactical features. My experience is I've found it pretty easy to learn new ones from my peer's code, but I struggle with actually forcing myself to teach myself new and more complex language features when the existing ones work so well for me. I'd say Swift is probably harder to learn than it c…

I have to wonder if pandering to "fresh college grad" only is the way forward with new languages. We were once beginners - did you see challenges when you were studying the languages you are now fluent in? I have a feeling like the computer world is being torn between two extremes - either go all-out complex or "think of the children" simple approach. Not just in programming languages, but in software development in…

I realize this is probably unpopular, but I personally think we shouldn't aim for beginner-friendliness in our production languages. If we can do it then fine, but it shouldn't come at the cost of anything else.

People are only beginners for a (hopefully) short time, then they're not. Making things better for them in the post-beginner period is far more advantageous, since that's when the vast majority of productive work occurs.

There is certainly a place for beginner-friendly languages. People need to learn to program at some point, and something which is aimed at helping them do that is really useful. But there's no reason that it should be the same language used by professionals to do real work.

Imagine changing the design of a 747 to make it easier to fly for new pilots. We wouldn't dream of doing such a thing. The cockpit of a 747 is for experienced professionals. If you're learning to fly then you belong in the cockpit of something like a Cessna 152.

Note that I'm not advocating for difficulty just for the sake of difficulty, and I don't want to keep people out. And if a language can accommodate beginners without making things worse for professionals then let's go for it. But it shouldn't be a major goal of most languages.

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#24

Wow, he just really really does not like C++. He is certainly an extremely knowledgeable C++ guy, obviously Swift is written in C++, but it's hard to entirely agree with his opinion on it across all fronts.

Many of us feel that way.

We have a schizophrenic attitude towards C++.

On one way we love the language, the expressive power it gives us, the type safety taken from Simula and Algol, thanks to C++'s type system.

On the other hand like Chris puts it "has its own class of problems because itʼs built on the unsafety of C".

So some of us tend to work around it, by using safer languages and only coming down to C++ for those tasks, where those better languages cannot properly fulfil them.

But as the CVE database proves, it only works if everyone on the team cares about safety, otherwise it is a lost game, only fixable by preventing everyone on the team to write C style unsafe code to start with.

Sure nowadays there are plenty of analysers to ensure code safety, but they work mostly on source code and like any tool, suffer from people really caring to use them.

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#25
post #4

Wow, he just really really does not like C++. He is certainly an extremely knowledgeable C++ guy, obviously Swift is written in C++, but it's hard to entirely agree with his opinion on it across all fronts.

As someone who spent over 20 years writing applications in C, anything built on C is crap and that includes C++ and Objective C. Writing code is fun and interesting. But most software development is not writing code. It's a little bit of build management, even more testing, but mostly it's debugging. Debugging is not as fun as writing code. Every language feature that makes debugging more necessary, harder to do and…

Avoiding dangling pointers requires a bit of discipline in pre-ARC Objective-C and C++, but now that we have ARC, isn't ObjC pretty much as safe as Swift? (Unless you explicitly use "assign" properties, of course.)

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#26
post #23

Earlier quoted context omitted.

I have to wonder if pandering to "fresh college grad" only is the way forward with new languages. We were once beginners - did you see challenges when you were studying the languages you are now fluent in? I have a feeling like the computer world is being torn between two extremes - either go all-out complex or "think of the children" simple approach. Not just in programming languages, but in software development in…

I realize this is probably unpopular, but I personally think we shouldn't aim for beginner-friendliness in our production languages. If we can do it then fine, but it shouldn't come at the cost of anything else. People are only beginners for a (hopefully) short time, then they're not. Making things better for them in the post-beginner period is far more advantageous, since that's when the vast majority of productive…

The cynic in me sees these approaches as a corporate-friendly way to be able to hire more "juniors" to save money. Entire frameworks and languages seemingly exist to enable low barrier entry to junior developers without any effort of the corporate to invest in these junior developers. There needs to be a balance between the need for junior developers to be productive and restricting technology just so as many as possible junior developers can be productive at low cost for the corporate. With stuff like React Native and Electron, I feel the former takes the lead at the expense of technology.

Agree that simplistic languages could work well in academia, as the first language that students see. I studied C as my first language, and I am not sure that is optimal. Nor do I think Java is that language, as many study that first, these days.

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#27

Earlier quoted context omitted.

The issues with inheritance based OOP are that it fits very few problems well, that it usually causes lots of problems and that many programming languages only have inheritance based OOP in their toolbox. Java is the extreme case of this. Patterns like abstract visitor factories are hacks to express situations that cannot be expressed in an obvious way.

> The issues with inheritance based OOP Inheritance is just one of multiple facets of safe code reuse in OOP. Aggregation, composition, encapsulation are as are much as fundamental notions in OOP as inheritance. So i think reducing OOP in general, and java in particular to "inheritance based OOP" is a miss characterization > are that it fits very few problems well, that it usually causes lots of problems and that man…

> Aggregation, composition, encapsulation are as are much as fundamental notions in OOP as inheritance.

You say that as if these things are not just as easily expressed in FP -- if not even easier.

Aggregation is just records-of-records.

Encapsulation is just "abstract data types", e.g. ML modules with abstract members, or non-exported data constructors in Haskell. Another option would be simply closing over whatever you're trying to hide. Another option would be existential types. (There's some overlap among all of these.)

Composition... well, actually I'm not sure what exactly you mean by "composition" in the context of OO. Can you explain what you mean?

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#28
post #4

Earlier quoted context omitted.

As someone who spent over 20 years writing applications in C, anything built on C is crap and that includes C++ and Objective C. Writing code is fun and interesting. But most software development is not writing code. It's a little bit of build management, even more testing, but mostly it's debugging. Debugging is not as fun as writing code. Every language feature that makes debugging more necessary, harder to do and…

Avoiding dangling pointers requires a bit of discipline in pre-ARC Objective-C and C++, but now that we have ARC, isn't ObjC pretty much as safe as Swift? (Unless you explicitly use "assign" properties, of course.)

Apparently, the elegance of ObjC's handling of nil objects is considered also "unsafe" these days. I disagree with that specifically.

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#29
post #9

Earlier quoted context omitted.

There is some truth to what you are saying. I'm not a beginner so I probably can't appreciate how hard it is to learn new syntactical features. My experience is I've found it pretty easy to learn new ones from my peer's code, but I struggle with actually forcing myself to teach myself new and more complex language features when the existing ones work so well for me. I'd say Swift is probably harder to learn than it c…

I have to wonder if pandering to "fresh college grad" only is the way forward with new languages. We were once beginners - did you see challenges when you were studying the languages you are now fluent in? I have a feeling like the computer world is being torn between two extremes - either go all-out complex or "think of the children" simple approach. Not just in programming languages, but in software development in…

In the old days we learned directly with a mix of BASIC and Z80 (or 6502) Assembly, at the age of 10.

I was already doing C++ for MS-DOS while at the technical school (15-18 years old) and learned OOP via Turbo Pascal 5.5 and 6.0 before getting into C++.

Just look at kids today doing C++ with Arduino at school with similar ages.

So I really fail to understand the whole pandering "fresh college grad" concept.

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#30
post #6

BTW: Before we get too deep in specific language criticisms, let's not forget that Chris Lattner is awesome. The fact that two super smart guys with huge work ethics like Chris and Elon Musk couldn't get along is very disappointing to me.

> The fact that two super smart guys with huge work ethics like Chris and Elon Musk couldn't get along is very disappointing to me.

I'm storing popcorn for the day all the people who've been burned working for Musk finally come together and speak out about his insanity as a manager.

I suspect the thing holding them back is that Musk's goals are laudable and everyone still wants them to succeed.

But be glad you're a (potential?) customer of Musk's, not an employee.

Post reply on HN