Thread overview | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
May 04, 2015 This Week in D #15: hackathon, mem management, ARM, tip for C coders | ||||
---|---|---|---|---|
| ||||
I covered two weeks this time, as I missed last week. http://arsdnet.net/this-week-in-d/may-03.html The tip this week might be a bit controversial but I actually feel kinda strongly about this. So many times, I see people asking questions about how to do task X in D. I think that's the wrong question: you should just be asking how to do task X. The programming language isn't terribly important: if you can do it in C, you can do it in D basically the same way; D provides similar language features to other common languages like C and Java, so a LOT of knowledge carries over from them... as long as you aren't afraid to use it. I think that when people are new to D, we ought to press this carry-over point. They don't have to forget everything and suddenly do everything the D way, using only Phobos, doing it all with lazy ranges, etc. It doesn't have to be all that new, unfamiliar territory at once. Similarly, I get a bit bothered when I see a lot of work done to add a bit of common functionality to a C library. Now, don't get me wrong, I reinvent the wheel as much as the next guy (actually, I don't even like the term "reinventing the wheel" exactly because so much knowledge carries over. Just because I'm re-coding it doesn't mean I'm reinventing it. By carrying over knowledge of the problem domain from any source, it makes coding it again a lot easier - I already know what needs to be done and where the pitfalls are, unlike a truly novel invention, where all that is a mystery going into it. But I digress). I almost never use third party libraries personally for a variety of reasons, so I get the desire to rewrite things, especially when D offers so many ways to do it better than ever before. But at the same time, I'm also a working programmer accustomed to things like last-minute client requests, deadlines, and other schedule constraints (including just simply not *wanting* to spend that kind of time on a problem, believe it or not, I don't actually care for programming all day every day....) In these cases, being able to say "yes we can, and I can do it today, though it might look like C" is so much more valuable than saying "maybe... if I figure out how to make it idiomatic D" So I guess it is more a peeve of mine than anything else, but I wanted to talk about it anyway and used the tip of the week as my vehicle. D code that looks like C isn't a bad thing, indeed, I think it is a selling point. |
May 04, 2015 Re: This Week in D #15: hackathon, mem management, ARM, tip for C coders | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On 4/05/2015 3:23 p.m., Adam D. Ruppe wrote:
> I covered two weeks this time, as I missed last week.
>
> http://arsdnet.net/this-week-in-d/may-03.html
>
> The tip this week might be a bit controversial but I actually feel kinda
> strongly about this. So many times, I see people asking questions about
> how to do task X in D.
>
> I think that's the wrong question: you should just be asking how to do
> task X. The programming language isn't terribly important: if you can do
> it in C, you can do it in D basically the same way; D provides similar
> language features to other common languages like C and Java, so a LOT of
> knowledge carries over from them... as long as you aren't afraid to use it.
>
> I think that when people are new to D, we ought to press this carry-over
> point. They don't have to forget everything and suddenly do everything
> the D way, using only Phobos, doing it all with lazy ranges, etc. It
> doesn't have to be all that new, unfamiliar territory at once.
>
> Similarly, I get a bit bothered when I see a lot of work done to add a
> bit of common functionality to a C library. Now, don't get me wrong, I
> reinvent the wheel as much as the next guy (actually, I don't even like
> the term "reinventing the wheel" exactly because so much knowledge
> carries over. Just because I'm re-coding it doesn't mean I'm reinventing
> it. By carrying over knowledge of the problem domain from any source, it
> makes coding it again a lot easier - I already know what needs to be
> done and where the pitfalls are, unlike a truly novel invention, where
> all that is a mystery going into it. But I digress).
>
> I almost never use third party libraries personally for a variety of
> reasons, so I get the desire to rewrite things, especially when D offers
> so many ways to do it better than ever before.
>
> But at the same time, I'm also a working programmer accustomed to
> things like last-minute client requests, deadlines, and other schedule
> constraints (including just simply not *wanting* to spend that kind of
> time on a problem, believe it or not, I don't actually care for
> programming all day every day....)
>
>
> In these cases, being able to say "yes we can, and I can do it today,
> though it might look like C" is so much more valuable than saying
> "maybe... if I figure out how to make it idiomatic D"
>
>
>
> So I guess it is more a peeve of mine than anything else, but I wanted
> to talk about it anyway and used the tip of the week as my vehicle. D
> code that looks like C isn't a bad thing, indeed, I think it is a
> selling point.
A pet peeve from the community section might be a great idea!
|
May 04, 2015 Re: This Week in D #15: hackathon, mem management, ARM, tip for C coders | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe Attachments: | On Mon, 04 May 2015 03:23:07 +0000, Adam D. Ruppe wrote:
> So I guess it is more a peeve of mine than anything else, but I wanted to talk about it anyway and used the tip of the week as my vehicle. D code that looks like C isn't a bad thing, indeed, I think it is a selling point.
i found that i can write code "in C style" first, and then gradually converting it to be more "D-like". btw, it's a great way to start using D for begginers with C expirience: just do it as you are used to, and then change some parts as you learned new trick.
it's very useful when converting C libraries to D. i have some libraries that is hard/impractical to rewrite from scratch in D, but i want 'em in D to ease hacking and improving. so i'm first converting code using D as "better C", and then adding better interfaces or rewriting some parts.
|
May 04, 2015 Re: This Week in D #15: hackathon, mem management, ARM, tip for C coders | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Monday, 4 May 2015 at 03:23:08 UTC, Adam D. Ruppe wrote: > I covered two weeks this time, as I missed last week. > A switch was added to git to start profiling the GC itself, as part of a general push toward better memory management in D. That should read: A switch was added to *DMD* |
May 04, 2015 Re: This Week in D #15: hackathon, mem management, ARM, tip for C coders | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On 05/03/2015 11:23 PM, Adam D. Ruppe wrote:
> I covered two weeks this time, as I missed last week.
>
> http://arsdnet.net/this-week-in-d/may-03.html
>
> The tip this week might be a bit controversial but I actually feel kinda
> strongly about this. So many times, I see people asking questions about
> how to do task X in D.
>
Actually, I came over to this forum thread just now specifically to say that I liked that tip quite a lot. It's a very good (and well-written) point that perhaps doesn't always get communicated as well as it should.
|
May 04, 2015 Re: This Week in D #15: hackathon, mem management, ARM, tip for C coders | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On 5/3/15 8:23 PM, Adam D. Ruppe wrote: > I covered two weeks this time, as I missed last week. > > http://arsdnet.net/this-week-in-d/may-03.html http://www.reddit.com/r/programming/comments/34uji5/d_hackathon_roundup_and_tip_of_the_week_dont_be/ https://twitter.com/D_Programming/status/595287061990506497 https://www.facebook.com/dlang.org/posts/1062292857117728 Andrei |
May 04, 2015 Re: This Week in D #15: hackathon, mem management, ARM, tip for C coders | ||||
---|---|---|---|---|
| ||||
Posted in reply to Rikki Cattermole | On Monday, 4 May 2015 at 03:50:57 UTC, Rikki Cattermole wrote:
> A pet peeve from the community section might be a great idea!
If you ever want to rant, type it up and email it to me, I'll work it in!
BTW I also have a window open on my browser somewhere to chat with you about audio stuff. Been pretty busy lately but want you to know that I haven't forgotten!
|
May 04, 2015 Re: This Week in D #15: hackathon, mem management, ARM, tip for C coders | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | On Monday, 4 May 2015 at 09:01:31 UTC, Gary Willoughby wrote:
> That should read: A switch was added to *DMD*
ah right, I made it "to dmd git"; what I meant was the git version but it can always be clearer.
|
May 05, 2015 Re: This Week in D #15: hackathon, mem management, ARM, tip for C coders | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On 5/05/2015 7:01 a.m., Adam D. Ruppe wrote:
> On Monday, 4 May 2015 at 03:50:57 UTC, Rikki Cattermole wrote:
>> A pet peeve from the community section might be a great idea!
>
> If you ever want to rant, type it up and email it to me, I'll work it in!
>
> BTW I also have a window open on my browser somewhere to chat with you
> about audio stuff. Been pretty busy lately but want you to know that I
> haven't forgotten!
Awesome sweet!
|
Copyright © 1999-2021 by the D Language Foundation