Mainly because it's hard to read (& becomes cryptic below a few levels
of inheritance), languages built around it have historically been highly
inefficient, and it seems to lead to bad programming practices.
Once again I'll point to LSI's new card management tool, one of the
worst pieces of garbage I've ever come across. Everyone that can ditches
it in favor of a home-grown solution based on the C-based megacli tool
(which has problems of its own, I might add -- no documentation). Why?
It's resource footprint is enormous, even though all it has to do is
read from a couple memory addresses, present the results in a pretty
manner, and occasionally notify a list of people if a disk dies.
That's nothing more than the C-based package NAGIOS does, only on a
scale several times smaller than NAGIOS does, and using 10x+ the
resources. I'm not saying NAGIOS is a wonderfully efficient or
well-written package -- it has many, many bugs & isn't terribly
efficient about how it does at least a few things -- but it definitely
puts LSI's java/OOP beast to shame.
For that matter, from the little I've been able to discern through his
code about the guy who made the megacli, he seems to be more of a
hardware engineer than a software developer. If a novice software
developer can make a reasonably efficient software solution using C &
functional decomposition, is it unfair to expect the same of the
almighty java & its OOP methodologies?
Bud Manz wrote:
I am puzzled why you seem to have a disgust for OOP, Nemo.
Bud
On Tue, Apr 21, 2009 at 12:20 PM, Nemo Nihil <[email protected]
<mailto:[email protected]>> wrote:
Rob Ludwick wrote:
Give me a more politically correct term then. I just chose
'fringe' for lack of more descriptive terms.
I like using the term "Python" for describing Python. ;)
I actually like calling it 'not listed as a requirement by many
employers'. That's really the main part of my argument, too. In my
last search for software engineering positions I saw the following
languages repeated over and over (roughly in order from most
requested to least): Java, C/C++ (listed together), PHP & javascript
(usually listed together), perl, ADA
Not a single mention of python, tcl, or ruby, though those seem
fairly common in the freelance open source community. Sadly, since
the industry seems to want people proficient in java more than
anything, I'm probably going to have to learn it eventually, even
though I find the thought of OOP everywhere extremely repulsive.
So here's what I'm proposing. Since you dislike python's use of
whitespace, I will write a python braceificator and we can
compare and
contrast.
And here it is. I wouldn't use the term "Beautiful" to describe
this
piece of code. I prefer "Pragmatic". If it happens to look
beautiful,
that's merely a side effect.
def indentlevel(line):
count = 0
while len(line) and line[0] == " ":
line=line[1:]
count +=1
return count
def bracify(file):
infd = open(file,"r")
outfd = open(file+".by","w")
bracelevel = [0]
originalline = " "
while originalline != '':
originalline=infd.readline()
line = originalline.rstrip()
level = indentlevel(line)
if line.lstrip() == "":
outfd.write(line + "\n")
continue
if level > bracelevel[-1]:
outfd.write(level * " " + "{\n")
bracelevel.append(level)
while bracelevel[-1] > level:
outfd.write(bracelevel.pop() * " " + "}\n")
if line[-1] == ":":
outfd.write(line + "\n")
continue
while line[-1] == '\\':
outfd.write(line)
line = infd.readline().rstrip()
outfd.write(line + ';\n')
while len(bracelevel):
outfd.write(bracelevel.pop() * " " + "}\n")
And here is what the braceified version of the same code looks like:
def indentlevel(line):
{
count = 0;
while len(line) and line[0] == " ":
{
line=line[1:];
count +=1;
}
return count;
}
def bracified(file):
{
infd = open(file,"r");
outfd = open(file+".by","w");
bracelevel = [0];
originalline = " ";
while originalline != '':
{
....
Anyway you get the point.
I'd be more impressed if you hacked out something that turned it
into complete C code (minus low-level variable stuff, of course) ;)
You used OOP crap in there too, by the way...yuck. Really should
only need to use that for GUI-level stuff.
At this point it seems pretty trivial to write a debraceificator to
convert it back to normal python syntax. Replace the semicolons
with
linefeeds and count braces for indentation. And then you would have
something that with a little polish would replace whitespace with
braces.
Oh and the code ports easily to jave:
$jythonc -j braceificator.jar braceificator.py
Yuck.
--R
_______________________________________________
Fwlug mailing list
[email protected] <mailto:[email protected]>
http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org
_______________________________________________
Fwlug mailing list
[email protected] <mailto:[email protected]>
http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org
------------------------------------------------------------------------
_______________________________________________
Fwlug mailing list
[email protected]
http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org
_______________________________________________
Fwlug mailing list
[email protected]
http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org