"Cursitor Doom" <
cd999666@notformail.com> wrote in message
news:vg3575$3bio0$1@dont-email.me...You can call me old fashioned, but I still believe there's never been a
more elegant computer language than the original K&R C. You can keep the
rest; I'll stick with that.
Having just got back from a vacation I thought I'd give my input to this before looking into whether it's worthwhile getting back
into sinewave oscillators.
When I first did anything serious in c, with Borland c++ 1.0, it became apparent that even if I didn't need any c++ features it was
better to use a c++ compiler because I found it harder to write an incorrect program using a c++ compiler than a c compiler.
Sure I had to do things like add function prototypes and be more rigorous with type declarations and other things but that helped
make sure that my code was correct.
And I could do things such as complex j = complex(0,1) and go from there.
Not long after that I learned Java. There are two things I like about Java. Object oriented and threads.
Now I could pretty much make my own variable types and I could do class something implements runnable and have it go off and do
something while the main program did something else. Much like real hardware can do any number of things in parallel.
Ok you can't do operator overloading in Java but who needs that?
If I did need real (digital) hardware I could always get Cypress Warp to turn my VHDL into a 22V10 or other device.
Whoever wrote Warp's ability to turn VHDL into hardware must have been a genius. Other (way more expensive) VHDL compilers would
just choke on my code.
I haven't touched c for must be at least 20 years by now and I never really got into c++ except as described above.
Now if I need to code anything I'll reach for either php if it needs to be web page oriented or otherwise python.
While I'm sure it can be done, I can't imagine trying to write something like this in c
#Make a copy of the list so we can iterate over iplist and modify outlist.
outlist = iplist.copy()
with open(args.blackfile) as cidrs:
for ip in iplist:
iptocheck = ipaddress.ip_address(ip)
cidrs.seek(0)
for cidr in cidrs:
cidrtocheck = ipaddress.ip_network(cidr.strip())
if iptocheck in cidrtocheck:
try:
outlist.remove(ip)
except ValueError: #Ignore the exception if it's already removed.
pass
break #No need to keep looking if we found it.
Writing it in python is almost like asking AI to do it (and I have sometimes found online AI code generators useful).
You can have it done in a few minutes.
I don't see why anyone would think python's indentation is stupid, unless they haven't used it to any real extent or haven't used
notepad++
So in my case it's not possible to stick with c because I believe in using the best tool for the job. I left c behind a long time
ago.
I'm not saying c shouldn't be used. Not at all. If you need a replacement for assembler then use c because that is what it was
designed for.
I forget when I last use assembler. Maybe 68020 about 30 years ago.
These days I'd expect to see megabytes of code compiled from a high level language doing what could be done on a 6502 with a bit of
thought.
But thinking is hard, and in any case management will say that the 6502 code isn't portable so can't be used.