[SOLVED] Need advise on which Programming language would best fit this scenario.
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Need advise on which Programming language would best fit this scenario.
I have a program I wrote in vb.net as console app for what I thought would be a short lived item. Now it must be a part of our daily routine.
Program must run like a stay resident app, watch a directory for a specific file type, read file data and manipulate the text data based on program variables, write new data to another location, then wait for another file.
I have Windows servers running and they would work but we have had issues with them hanging when we get busy. My Slackware 14.2 Samba box works and just keeps working. I want to utilize this system more as we have been slowly moving workflows over to open source alternatives.
What language would I want to use best for text manipulation in files that would stay resident on reboot of system. I know how to start scripts to load programs during reboot, if ever needed.
I have the time to learn a new language and currently my skill level needs some attention when development is concerned and I have been using Slackware for some time with Samba and such but never really wrote any program or scripts for something new in the Linux environment.
My preference is to use perl, but I've been coding in it for several years. It's particularly good for text manipulation.
Just my two cents
I have very basic knowledge of PHP, AWK, C++, Perl, Java. I have used extensively vb.net, turbo pascal V6(DOS), I am reasonably good at debugging and using assembly to break things, but I am relatively new at creating software to work; I have used Access to create databases used in production environments using VBA.
I used to use parts of what others have done and pieced it together for my own uses; but on this project I want to actually build from scratch to actually contribute a part of me, not a part of someone else for me. I have thought about using Perl, my only concern is how well it reacts with OS when watching for changes in a directory or would it be better to use something else, inotify maybe?
You should absolutely use inotify - from perl if you choose. You might not be surprised to learn you are not the first to need this. Check CPAN and I'd bet you'd find something like what you need on someones' blog.
Quote:
Originally Posted by newbeliever
... watch a directory for a specific file type, read file data and manipulate the text data based on program variables, write new data to another location, then wait for another file.
This should be ok so long as you don't save changes to the source file - else you risk getting into a inotify loop/race.
I have Windows servers running and they would work but we have had issues with them hanging when we get busy.
Hmmm - no indication of what's making them busy, but I'd think bash might not be a great way of trying to sell Linux as the solution to the business suits if it's likely to get over-whelmed.
I have very basic knowledge of PHP, AWK, C++, Perl, Java. I have used extensively vb.net, turbo pascal V6(DOS), I am reasonably good at debugging and using assembly to break things, but I am relatively new at creating software to work; I have used Access to create databases used in production environments using VBA.
I used to use parts of what others have done and pieced it together for my own uses; but on this project I want to actually build from scratch to actually contribute a part of me, not a part of someone else for me. I have thought about using Perl, my only concern is how well it reacts with OS when watching for changes in a directory or would it be better to use something else, inotify maybe?
I once was hired to support and create software in a language I'd never heard of because of my background of supporting and creating software in other languages. The hiring manager's thought at the time (and mine now) is that programming languages are only different syntaxes to do the same thing...the important skill is to be able to think logically, and apply that to the development. It sounds like that's where you are.
If you choose perl, you'd best let go of "actually build from scratch." You can, of course do that, but
Quote:
The Comprehensive Perl Archive Network (CPAN) is a repository of over 250,000 software modules and accompanying documentation
so the odds are that whatever you want to do, someone has already done, and you should apply your skills to hooking all that available code together. It saves a LOT of time!
PS: I worked for that manager for five years, then worked with that language on two other jobs for a total of 13 years.
I have a program I wrote in vb.net as console app for what I thought would be a short lived item.
Think back to when you did that originally in vb.net. What did you do? My guess is that you wrote something quick to "get it done" because it needed getting done, or you wrote a personal utility and then other people noticed and decided they'd like to use it. Now there are additional requirements. Great. But very similar approach as before, you write something in a language you feel would work for it and for you. No real magic here, just honest work.
Quote:
Originally Posted by scasey
My preference is to use perl, but I've been coding in it for several years.
The point there is that it is perfectly fine to program in something you have experience with, but you can also extend your experience by doing newer things, or even using a similar language to what you've used in the past.
Quote:
Originally Posted by newbeliever
I used to use parts of what others have done and pieced it together for my own uses
That's what a lot of initial programming turns out to be. Maybe not your entire project, but I'm betting that there are functional things you'll need to accomplish, like a sort, or linked list or something and you'll be able to find a wide variety of examples in various languages and scripts on the web.
Quote:
Originally Posted by scasey
programming languages are only different syntaxes to do the same thing...the important skill is to be able to think logically, and apply that to the development.
Quite right! All the way down to assembly language. All these things do is read and write from memory and make decisions based on test criteria. The languages are just the things which give us tools to build upon the binary basis of the computer.
Since you feel you have time and license to learn, then explore a bit and decide for yourself. Rather than us recommend to you, how about starting with a language you've always felt that you'd like to learn?
Text-manipulations and transformations of all kind are best done in an interpreted (script-) language. Not because these are more “powerful” or have an “adapted” syntax, but because of the nature of your project and the close resemblance of
* mastering language syntax
* mastering the syntax of in- and output
Bizarrely, even the “constructs” (intellectual and in terms of utilities) provided to achieve both are either resembling each other or identical...
For the same reason, the resulting code will be easier to maintain.
From my study of regular expression engines, I have to believe (cannot confirm anything), that Perl should still be the first choice. But, alas, I have as good as *NO* experience with Perl. Other script-languages have been sufficient for me.
You categorically do not need to do everything using 1 tool. In our culture generally you use one thing for one job and chain them together.
e.g: a little "daemon" that will wait for a file and then call another program:
Code:
while date; do
for file in *
do
case "$file" in
*.lis) echo do this to $file ;;
*.x) echo do that to $file ;;
esac
done
sleep 3
done
You don't have to write a monolith to do the whole job as happens in the Windows world.
and you don't have to use the most esoteric tools when a simple script will often do.
You can start with simplicity, like above and make it more robust if you need to later.
Last edited by bigearsbilly; 09-07-2018 at 03:41 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.