Switching from Java to D: Beginner questions, multiplatform issues, etc.

DS6 ds6 at example.com
Thu Feb 27 02:23:39 PST 2014


Though this post may seem long, my questions are indeed asked. I 
just kinda started typing and didn't stop; I guess this is both a 
question post and a vent post. Please bear with me.

Hello, I'm a hobbyist programmer, and I'm tired of the way things 
are going. I'm looking for a change.
I must admit, I've been pampered most of my programming life: 
I've consistently used higher-level languages, like Java (which I 
have been using as of late), that do all the work for you. But I 
find it's hard to quickly prototype and implement new ideas and 
to test new code because of that. Creating a solution to an 
otherwise simple task takes numerous new and extended classes and 
lots of time. There's always the option of choosing a dedicated 
external library or otherwise development environment to build 
off of a central idea, but I want to keep things simple and work 
with the core essentials and not resort to learning the ins and 
outs of another codebase. Sadly, Java's "core essentials" are 
absolutely humungous and hard to keep track of. If I feel the 
need to search for an alternative development environment just to 
get a more focused feature subset that may or may not already 
exist in part or in full in a language, I don't really think that 
language is right for me and what I want to accomplish, whatever 
that may be at the time.
As an example, I would occasionally find myself making some code 
that does nearly the same thing as an already-implemented class 
in the JDK/JRE, simply because I forgot to do any research on the 
topic beforehand or I didn't think there was already a solution 
for my problem.

Overall, using Java takes massive dedication for the language and 
a large, pre-defined, solidly-built goal, and I may not have some 
or all of the previous at any point in time while both fleshing 
out my ideas and working on already-established projects. When 
programming in Java, there is a large number of classes that are 
available for one to use, that are fully-featured and complete, 
and function extremely well for their intended purpose. However, 
the way Java is set up makes me feel like I have to twist and 
bend those classes into the idea I see in my head, instead of 
using them as a base like they're intended to be used. I could 
always start from scratch and build my classes how I want, using 
other classes only when necessary, but what's the point in that 
when there's already classes out there that do what I want, and 
probably more efficiently? Instead I dig through them until I 
find something that works how I want it to and may occasionally 
miss something that works better or fits my desires better 
because I simply didn't notice it or got fed up with looking and 
stopped. It's been like that for all of the more expansive 
higher-level languages I've used, not just Java.

(Aside: Don't get me wrong, I am NOT bashing Java. It's an 
excellent, solid framework that can handle damn near anything you 
throw at it, and usually in a very skilled, complete, and 
well-thought-out manner. It's great for both small- and 
large-scale, enterprise operations, and is able to function at 
full-capacity in the most intense of circumstances. It certainly 
has its place, a place it holds firmly and effectively, but I 
don't really think it's good for me; I'm not exactly some bigwig 
company that needs XYZ huge projects produced.)

It really comes down to what you're looking for. Honestly, I'm 
still not sure what I'm looking for, but I know I love 
programming and I want to find my calling for it. I've always 
wanted to get into general game design but I've never really 
found anything that truly clicks with me. I've tried other game 
design-specific solutions, even ones designed for Java like 
jMonkeyEngine, but development with these types of applications 
is usually very closed and has that pre-built "here use this 
class" feeling like Java does.
I must sound pretty hypocritical/demanding here; I want a solid 
base to work off of but I don't want it to feel pre-built? I 
suppose what I mean is that I want it to work as-is, but I also 
want things to be bare enough so that I can create what I want 
without worrying about what class to use or what method to 
override. Java isn't just your average framework, it has 
everything you could ever need... And that's not really what I 
want. I want a skeleton, so that I can fill in the parts that I 
need to how I want, without resorting to using X number of 
classes. Not only do I feel that restricts my creative abilities, 
but it's generally difficult. That's part of the reason I chose 
D: It has all the advantages of using a low-level language, 
mainly in its simplicity, but with the ease of use and 
completedness that comes from using a higher-level language, or 
as so I've read about it.

I want programming to be challenging and engaging, and moreover 
fun and enjoyable, while having it not being a chore just to 
accomplish little goals. Java kinda feels like that one aunt that 
is really nice but always makes too much food and tries to feed 
you all the time; great intentions but too much to digest at 
once, especially if you're only looking for a small meal.
I want a language that is fully-featured but doesn't try to have 
a class for every potential problem I have, which I originally 
though could be a good thing but hasn't really turned out too 
well for me in my experience. So, in order to step away from the 
raging, overbearing sea that is Java, I decided I'd try out a 
lower-level language, to see if it was any easier/more efficient 
to prototype code. I chose D over the omnipresent C/++ (which I 
was largely contemplating using), due to how it seems more 
stable. C's niche is that it's been around for too long; it's too 
widespread and its specifications too lax to have a good, 
concrete base. Equally so, trying to cater to the older crowd by 
trying to implement new features while staying true to 
backwards-compatibility is NOT a very effective or 
forward-thinking solution!

Okay, down to the questions I have about D:
  - Why should I use D over another language? What general 
benefits does it provide me, in relation to the points I made 
about it above? Is it a solid base to build off of, but still 
simple in nature? Aside: I do NOT mean simple as in easy to use, 
I'm fine with a little difficulty and "putting your nose to the 
grindstone" as the saying goes; I mean simple as in not having to 
learn the names of thousands of classes, methods, and fields, 
just to accomplish rather trivial goals.
  - How is multiplatform compilation handled by D? I've never much 
looked into how lower-level languages handle compilation and 
such, so I can't claim to understand the topic very well; as I 
said above I've been pretty pampered by the high-level languages 
of our day and age, and as such haven't looked into a lower-level 
language this intensely. Can I compile Linux binaries from 
Windows, and vice-versa? Is this possible, and if not, why?
  - How well supported is D? I've read that D is still 
relatively... Not new, or young, but less known than other 
languages. Does it have support for major libraries, like SDL? 
Aside: Whether or not these libs are "official" or not doesn't 
matter to me, they usually aren't anyway.
  - After some idle searching, I found the Derelict3 GitHub 
project. That was quite the impressive list of bindings. That 
leads me to my next question: How are bindings and other 
libraries of the sort handled by D? I understand my questions and 
musings thus far have been about the core D experience, but some 
extra information on the more popular/useful external libraries 
wouldn't hurt. Aside: External libraries to extend the 
capabilities of a language and to add new features, as opposed to 
providing a more focused feature set that don't even need to be 
used to achieve the same functionality, like many Java libraries 
do, are okay in my book.
  - How is D used in the enterprise world? Is it used by 
professional career-bound programmers? How viable is D in a 
general enterprise situation? If it isn't viable, what other 
choices are there for such endeavours? What kinds of situations 
can D handle and where would it excel over other languages?
  - Lastly, and probably most important, is D code scalable and 
easy to maintain? You never know, something I make could gain 
popularity and I would suddenly need to mass-produce and heavily 
modify my code to suit the needs of whatever crowd of people 
suddenly want my services, whatever services I may offer. Is 
going large-scale from an initially small-scale project or 
otherwise prototype at least comparable, say, Java (which is 
quite easy to manage large-scale if you do things right)?

In closing, I in advance appreciate and thank any responses to my 
rambling. It's 3 AM and I think I'm going to sleep now. I look 
forward to any possible discussion tomorrow.


More information about the Digitalmars-d-learn mailing list