Forums
What features of Cobra is this code not taking advantage of
3 posts
• Page 1 of 1
What features of Cobra is this code not taking advantage of
I was thinking about submitting the attached code for a Sample, but was thinking that it might warrant some changes to make it more "cobranic" (if that's the word.. just doesn't roll off the tongue like pythonic does).
- Attachments
-
- wordMatcher.cobra
- This is a program that will try to make a somewhat naive guess as to translated words, given a TMX.
- (16.27 KiB) Downloaded 219 times
- torial
- Posts: 229
- Location: IA
Re: What features of Cobra is this code not taking advantage of
Cobratastic?
I didn't have time to scrutinize it line by line, but skimming over it, it seemed to be just fine.
One thought that crossed my mind is that the functionality and the UI seemed to all be mixed together. Another way to structure a program is to write library-style code that performs the functions (matching, file I/O, etc.) and then UI code that uses that. The first kind of code is often called "domain code" or referred to as "domain objects".
In such a structure, it's often easier to bring contracts and unit tests to bear on the domain objects as well as use them in other contexts (utilities, web service, web site, system service, etc.).
But maybe this was outside the scope of what you wanted to do.
I didn't have time to scrutinize it line by line, but skimming over it, it seemed to be just fine.
One thought that crossed my mind is that the functionality and the UI seemed to all be mixed together. Another way to structure a program is to write library-style code that performs the functions (matching, file I/O, etc.) and then UI code that uses that. The first kind of code is often called "domain code" or referred to as "domain objects".
In such a structure, it's often easier to bring contracts and unit tests to bear on the domain objects as well as use them in other contexts (utilities, web service, web site, system service, etc.).
But maybe this was outside the scope of what you wanted to do.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: What features of Cobra is this code not taking advantage of
Agreed -- I had been thinking about that as well. I'm getting my wings of making UIs w/o a GUI, and find that I'm picking up my old wxPython bad habits
I will definitely wish to refactor that. Thanks for taking a look.
I will definitely wish to refactor that. Thanks for taking a look.
- torial
- Posts: 229
- Location: IA
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 47 guests