Click here to Skip to main content
15,889,808 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: general advice on starting to work with DB programming ? Pin
jschell20-Feb-15 13:36
jschell20-Feb-15 13:36 
AnswerRe: general advice on starting to work with DB programming ? Pin
manchanx12-Feb-15 13:19
professionalmanchanx12-Feb-15 13:19 
GeneralRe: general advice on starting to work with DB programming ? Pin
BillWoodruff14-Feb-15 11:28
professionalBillWoodruff14-Feb-15 11:28 
AnswerRe: general advice on starting to work with DB programming ? Pin
Jörgen Andersson12-Feb-15 21:43
professionalJörgen Andersson12-Feb-15 21:43 
GeneralRe: general advice on starting to work with DB programming ? Pin
BillWoodruff14-Feb-15 12:42
professionalBillWoodruff14-Feb-15 12:42 
GeneralRe: general advice on starting to work with DB programming ? Pin
Jörgen Andersson15-Feb-15 10:51
professionalJörgen Andersson15-Feb-15 10:51 
GeneralRe: general advice on starting to work with DB programming ? Pin
BillWoodruff15-Feb-15 22:25
professionalBillWoodruff15-Feb-15 22:25 
QuestionBetter language for complex GUI and input/output devices? Pin
ai_mc9-Feb-15 14:38
ai_mc9-Feb-15 14:38 
Hello.
First, let me introduce myself:
I am a Java (6 years exp), Python(2 years exp), and C (2 years exp) developer.

This thread is both a question for all programmers (feel free to reply!) and a little bit informative for some Smile | :)

So, I have been working on a relatively complex system (link[^]) that does the following:

a- (OpenCV) reads frame by frame and detect motion, from a webcam
b- reads from a second webcam without processing, just to watch
c- controls a parallel port or usb device
d- generates custom simple sounds
e- logs everything described here.
f- has a Graphic User Interface to control all of the above parameters.

So 2 webcams, audio out, usb device, and graphic user interface, is in short what this system has.

I've done this in python and it took me some 10k lines of code and weeks/months of time. So far works with some random errors, and a below-decent (in my opinion) interface.


I wanted to ask this community if Java might be a better language at accomplishing this task, which is my hypothesis, but would like a second opinion or your general opinion about this:

1- OpenCV
2- Generating audio
3- Controlling a USB device
4- multithreading
5- GUI


-------

I don't want to bias your opinion, but so far here is what i currently believe based on my work and exp programming on both languages:

1- OpenCV: Probably the same in both languages. Maybe Java is easier/more mature but IDK
2- Audio: Probably the same (someone might have done an audio class before)
3- Low level peripherals: I don't know. Probably Java has a disadvantage here?
4- Java's multithreading and multiprocessing seems to be far superior. Here's why:
. When you launch threads in Java, the JVM will allocate it on a free processor if available. If you have 8 processors and you launch 8 threads, ideally it will allocate one in each.
. While in Python , multithreading will use the same process for all threads. I managed to work around this by using multiprocessing [^] and what i gained was to make use of quad core and some better stability (OpenCV would complain with TKinter running at the same time, stability issues if using just one process, believe me).
. In Java, launching many threads will continue letting you use all variables in the "main program" ; it might be bad practice but it will let you anyway
. In Python, the main program must open joblists and pipes to send / receive information from the (many) modules and processes running simultaneously. This bloated my original code a lot (classes that had 200 lines before, now have 300 or more to handle jobs and queues, etc) , but was absolutely necessary because using just one process wouldn't have worked (i tried).

5- GUI:
. Java: i would have used JFrame, JPanel, and all that Swing package, which would look nice and behave properly
. Python: I used Tkinter AND also Glade GTK
I used both because Tkinter comes by default with Python but looks horribly (and behaves somewhat bad when interacting with so many processes . "Segmentation fault" Mad | :mad: ).
So i introduced a second GUI: Glade GTK. Which looks good and behaves better than TK but it needs additional packages installed.

I'm in no way ranting; i even almost finished my Python code, but i am just wondering if i have done it in Java would have been better ?





So what would you use? Python ? Java? Any other language?
Sorry for the long post! cheers !

Just a programmer.

AnswerRe: Better language for complex GUI and input/output devices? Pin
Pete O'Hanlon9-Feb-15 19:54
mvePete O'Hanlon9-Feb-15 19:54 
QuestionLookups Table Design Problem Pin
Kevin Marois8-Feb-15 8:29
professionalKevin Marois8-Feb-15 8:29 
QuestionBetter language for email polling, C# or C++? Pin
Member 84569711-Feb-15 12:07
Member 84569711-Feb-15 12:07 
QuestionRe: Better language for email polling, C# or C++? Pin
Richard MacCutchan1-Feb-15 22:30
mveRichard MacCutchan1-Feb-15 22:30 
AnswerRe: Better language for email polling, C# or C++? Pin
Member 84569712-Feb-15 0:03
Member 84569712-Feb-15 0:03 
GeneralRe: Better language for email polling, C# or C++? Pin
Pete O'Hanlon2-Feb-15 0:19
mvePete O'Hanlon2-Feb-15 0:19 
GeneralRe: Better language for email polling, C# or C++? Pin
Richard MacCutchan2-Feb-15 0:31
mveRichard MacCutchan2-Feb-15 0:31 
QuestionHow do I load a UI based on a user specific role Pin
phyxian29-Jan-15 2:13
professionalphyxian29-Jan-15 2:13 
AnswerRe: How do I load a UI based on a user specific role Pin
Eddy Vluggen29-Jan-15 3:15
professionalEddy Vluggen29-Jan-15 3:15 
GeneralRe: How do I load a UI based on a user specific role Pin
phyxian29-Jan-15 14:27
professionalphyxian29-Jan-15 14:27 
GeneralRe: How do I load a UI based on a user specific role Pin
Richard MacCutchan29-Jan-15 23:02
mveRichard MacCutchan29-Jan-15 23:02 
GeneralRe: How do I load a UI based on a user specific role Pin
phyxian30-Jan-15 0:10
professionalphyxian30-Jan-15 0:10 
GeneralRe: How do I load a UI based on a user specific role Pin
Richard MacCutchan30-Jan-15 0:13
mveRichard MacCutchan30-Jan-15 0:13 
GeneralRe: How do I load a UI based on a user specific role Pin
Eddy Vluggen30-Jan-15 0:31
professionalEddy Vluggen30-Jan-15 0:31 
AnswerRe: How do I load a UI based on a user specific role Pin
BillWoodruff29-Jan-15 5:47
professionalBillWoodruff29-Jan-15 5:47 
AnswerRe: How do I load a UI based on a user specific role Pin
Mycroft Holmes30-Jan-15 13:34
professionalMycroft Holmes30-Jan-15 13:34 
AnswerRe: How do I load a UI based on a user specific role Pin
BillWoodruff31-Jan-15 18:34
professionalBillWoodruff31-Jan-15 18:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.