Jump to content

  • Log In with Google      Sign In   
  • Create Account


Bubsy

Member Since 09 Nov 2012
Offline Last Active Sep 16 2013 10:07 AM
-----

#5067143 Difference between software engineer and programmer

Posted by Bubsy on 03 June 2013 - 12:07 PM

Software engineering is a broad field that contains knowledge about programming, but also about architecture, design, testing, planning, configuration, etc... A software engineer is someone who has studied this field.

A programmer is someone who writes code. They may be a software engineer, but they might also just be a hobbiest with a programming book, or a mathematician, or a computer scientist, or an electrical engineer, etc ;)

It used to be the case that companies would hire a small number of "architects" to design programs, and then a large numbe of "programmers" to implement them. In my experience, this structure is very outdated. I've only been in one job that worked this way, and it was horrible (the senior programmers were better architects than the "architect")...

The formal education curriculums that produce "programmers" these days also include a lot of SoftEng/CompSci knowledge, so companies these days usually hire jack of all trades "programmers" that can do both their own architecting and implementing. Large-scale architectural choices are typically made by a senior programmer, rather than some dedicated architect who doesn't actually write code...

 

This, I tend to frown up those so called architects who doesn't have a clue on how to materialize the envisioned into a real, usable system. A system architect should not (IMO) be a job title, but a role that a software engineer (usually the most senior) embraces.




#5059173 java swing link to new window

Posted by Bubsy on 04 May 2013 - 09:21 AM

http://www.roseindia.net/tutorial/java/swing/createLinkButton.html here some info on creating links on swing.

 

 

P.S. I've not tested this code, so I don't know if it has errors or such




#5042327 Thread Pool - how big should it be?

Posted by Bubsy on 12 March 2013 - 08:55 AM

If the threads will be doing cpu intensive work I recommend one thread per physical core, as the cpu will likely be the bottleneck. If the tasks are mostly IO bound, it's harder to choose the optimum pool size, as it will depend on which system component will be the bottleneck.




#5038887 How do I update text (or anything) in a game, in real time?

Posted by Bubsy on 03 March 2013 - 06:40 PM

Preferably only update when a change is made to this page, rather than load the page every time someone loads the game up

 

Just load the page at startup, It'll be easier to implement and it's a relatively cheap operation. (To prevent UI blockage during the load-time, you should load the page on a background thread)




#5036563 C++ book?

Posted by Bubsy on 25 February 2013 - 08:45 PM

I guess it's a little old, but it's free as in beer ;) http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html 




#5035635 Close file sooner or later?

Posted by Bubsy on 22 February 2013 - 07:15 PM

Besides the size issue, it depends on how you can process the file's data. If you can process the data in an event fashion (much like a SAX parser parsing XML data), I'd tell you to go with a stream based approach instead of loading all data into memory.

 

I think this approach will lead to less memory usage and less heap fragmentation (or lesser stack overflows occurrences, if you're allocating your buffers on the stack)




#5035435 Close file sooner or later?

Posted by Bubsy on 22 February 2013 - 09:27 AM

@swiftcoder Fairly high you mean wink.png

 

You should close as soon as possible. I guess it's best to use the RAII pattern to manage the file handler lifecycle, 




#5015459 Try/catch absurdity and calling destructors...

Posted by Bubsy on 29 December 2012 - 10:44 AM

In Java, it's considered a good pratice to use yoda style comparation when comparing to a non primitive constant using the equals() method. It's garanteed that the constant never will be null, so you could get away with a null checking.




#5010974 "Correct" Music Note Structure?

Posted by Bubsy on 15 December 2012 - 10:01 AM

On MIDI, AFAIR track voice info is not bound to notes, but is controlled by channel events. And is compose by bank and voice.

Of course, since you're abstracting away the MIDI protocol, you could put that info on notes. But you'll have cope with those diferences when you're actually sending MIDI info to the MIIDI devices.

E.G. Sending the voice change event would require you to look ahead on the note stream to see if the next note has a different voice program, and actually send the voice change event a little earlier.


#5009532 Is C++ too complex?

Posted by Bubsy on 11 December 2012 - 02:16 PM


You misinterpreted ChaosEngine.

It's not about the C++ runtime model (on which the pure virtual class acts like an interface indeed), what he criticized was the source code allegedly separation between declaration (header files) and implementation (.cpp files), which IMO violates the DRY principle.

The C# interface-implementation combination seems to violate DRY exactly as much as a pure virtual class and an inheriting concrete class do in C++. Your point was...?

More so, AFAIK the compiler and the preprocessor don't enforce this source code separation, so it's sintatically legal to write code in the header files.

Correct. But ChaosEngine said a C# interface is a much cleaner expression of intent than a C++ header file, and my counterpoint was that you can write an equivalent expression in a C++ header file that is not appreciably "less clean". A class which contains nothing but public virtual functions is an interface; there's no way to confuse it for anything else.


You misinterpreted, it's .h/.cpp source code schema that violates the DRY principle, not the pure virtual base class and its concrete implementation. It's the definition of a single/complete entity into two or more files that is being criticized by me.


#5009487 Is C++ too complex?

Posted by Bubsy on 11 December 2012 - 12:26 PM

Yeah, totally forgot about the templates.

So one could argue that the header/source-code model fail to provide a clear separation between declaration and implementation, becoming (taking in account only this feature) ultimatelly a hindrance to the programmer, that must keep two files in sync instead of only one.


#5009479 Is C++ too complex?

Posted by Bubsy on 11 December 2012 - 12:06 PM

You misinterpreted ChaosEngine.

It's not about the C++ runtime model (on which the pure virtual class acts like an interface indeed), what he criticized was the source code allegedly separation between declaration (header files) and implementation (.cpp files), which IMO violates the DRY principle. More so, AFAIK the compiler and the preprocessor don't enforce this source code separation, so it's sintatically legal to write code in the header files.


#5006882 IDE=runs Jar File=hangs

Posted by Bubsy on 03 December 2012 - 07:18 PM

Hmmm to turn the console on type on the prompt javaws -viewer, on the last tab there's a node which is called java console. Turn it on and see if something pop on it.

You can also try turning the debugger on the webstart application by using the Java's remote debugging facility. I never had to used it, but I know it is feasible.


#5005511 books to go further in C/C++/Java

Posted by Bubsy on 29 November 2012 - 06:21 PM

Cool that you want to venture into optimization and coding tricks, but don't forget the bigger picture. GoF Design Patterns will teach you how to structure your code better. Sometimes a good architecture will make it easier to optimize your program in the long run.


#5004966 Short jobs and thread management

Posted by Bubsy on 28 November 2012 - 08:17 AM

The process whose responsibility is execute those verilog scripts stay resident or must be executed upon each iteration ?

You have access to the Verilog Simulator's source code ? It's possible to change the simulator to take the input from a socket, a shared memory or any other IPC mecanism ? or is the simulator capable of taking the input via stdin and output the results via stdout ?

If the simulator could stay resident, accepting the input (and the output) from an IPC mecanism (or the stdin/stdout), you could create a pool of those simulators and use it from within your application. If the simulator is CPU bound, you should resist the urge to create more threads when they're being used. The optimal of threads may vary but, in theory, with a single threaded, primary CPU bounded process, should be the number of CPU cores (not sure about this last one, people with more experience in multicore programming could provide you a better insight)




PARTNERS