On Apr 21, 2009, at 12:27 PM, Bud Manz wrote:
I am puzzled why you seem to have a disgust for OOP, Nemo.

Bud

As am I.

I've been silently tracking this thread since inception trying to avoid feeding any trolls, but I finally feel inclined to chip in. Nemo and most of those in the C camp typically come across as extremely arrogant and closeminded. To think that C/C++ is the pinnacle of language design and the Only Way™ to do things is ridiculous. Each lasting language has its own place in the market and serves a purpose for its users. Sure, C is great for low-level stuff, but *I* don't typically write low level stuff. I don't get paid for it. It's not my specialty. Yet I somehow I manage to make a living writing in "fringe languages" (sorry guys, ruby, not python :) ) as a contractor for the US Government and several Fortune 500 companies. They don't seem to care.

Just because a language has marketshare doesn't make it a good fit. If all you care about in regards to programming is your 401K, sure, Java makes a lot of sense. But you wont catch me using it any time soon.

Also, your latest comment on OOP ("yuck") just backs up my observations. There is nothing inherently wrong with procedural, OOP, FP or any other methodologies. It's all in applying the proper technology to the task at hand. OOP has its place and I'm sure whatever you write works for you.

Sorry Nemo, I don't buy your arguments. I also believe your narrow opinions expose your inexperience with "fringe languages" and the specific needs that caused them to crop up in the first place.

Nate Todd



On Tue, Apr 21, 2009 at 12:20 PM, Nemo Nihil <[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]
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

_______________________________________________
Fwlug mailing list
[email protected]
http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org

Reply via email to