Hot answers tagged

22

Bear in mind that the main reason Agile processes were created was to cope with shifting requirements. If requirements are set in stone (truly fixed requirements are rare but I'll take you at your word here!) then some of the best practices for dealing with changing requirements - e.g. Negotiable stories - become somewhat irrelevant. That said, following a ...


18

You want your ideas expressed clearly in the language that hosts them. That means using host language idioms. Take the popular Underscore library: js and lua. The lua port is functionally equivalent for the most part. But when it's appropriate, implementations are slightly different. For example: _.toArray() becomes _.to_array() This change makes the ...


14

As with any hard and fast claim that Joel Spolsky spews out... You are not supposed to take it literally! He likes to paint a dramatic argument for a common problem and common situation, but like anything in the real world there is always that gray area, no matter how small. He intends to get people thinking and to create an aversion to being "re-write ...


12

You have two separate issues: How to code a C or C++ program which can easily be ported to several operating systems. The easiest way is to use some cross-platform framework library like Qt or POCO (or perhaps libsdl or GTK) which has been ported to several platforms and provides a common set of abstractions. You could also restrict yourself to purely C99 ...


11

My view is this: You should rewrite when it would be easier to start from scratch than to refactor. For instance, if the refactoring effort would involve months of retrofitting procedurally-written OOP code to proper OOP before you could even start to refactor the code, then a rewrite is the better option because you have to change everything. Another ...


10

Of course Scrum is useful. It's a methodology that does two things for you: It allows your project to adapt to change and It allows you to track progress, and get an idea on when it will be finished So, there's some value in using it. I think some of your preconditions are not correct and that's where you are getting lost. I can't see how each story ...


10

I really doubt this will work. You might be able to translate your code into Java byte code, but it will not magically translate library calls into equivalent calls to the Java runtime and libraries. There may not even be equivalent Java runtime calls! Even if you eliminate all proprietary libraries you're still left with the C++ standard library. To make ...


10

Translations (both to a different natural language and to a different programming language) are considered to be Derived Works. When creating a derived work that is so radically different from the original as a translation to a different (not closely related) programming language results in, it is actually quite hard to understand how the requirements from ...


9

although it compiles and even runs... how can I be sure is is working as expected? The same way that you made sure the original code was working as expected. By extensively testing it. can I be sure that underlying runtime does not change in a way that it introduces new and unexpected runtime bugs? You can never be 100% sure of that, but if it is a well-...


7

Porting can be hard work and getting it to compile is only the first step. But getting it to compile is a big milestone and something to aim for. The problem with porting is that it can be very intimidating to look at a massive list of a 1000 errors (Visual Studio caps the errors in the error window). It seems hopeless. The good news is that even though ...


7

Ignoring features in such a case does not make sense to me. The typical reason for using Python for prototyping is exactly because you can implement things in a fraction of time and "space" (=lines of code) than in C - by making use of features Python has, but C does not. If you would restrict yourself only to Python features which have a 1:1 correspondence ...


7

Based on my experience writing compilers and related tools in C and similar languages, I would NOT choose to write a compiler in C if I had any other, better choices. And in 2016, there are plenty of better choices. But, it's your compiler, and YMMV. The TL;DR backstory: "We should forget about small efficiencies, say about 97% of the time: ...


7

Those calls can't be ported, at least not directly. gcnew is not a C++ keyword, it is from "C++/CLI", which is a different language currently not supported by gcc. This older SO question says there was once an attempt to support it, but it seems to be dead since 2009. The only reasonable way for this is to port all of the the managed code to standard C++, ...


6

I don't think it's possible to write unit tests in a different language. However, what you can do is write integration/acceptance/user interface / whaterver_you_name_it tests that would be very high level and would not be tied to the language your software is written with. If your application is a webservice, you can test it with whatever language you want,...


6

Legal? -> ask a lawyer. Anyway, this depends strongly on the country you distribute your adaptation. Ethical? -> ask the authors. All of them. Some may see this as a tribute, others as a robbery.


5

If I understand correctly, what you seem to be describing is that you have a highly-optimized C implementation of some codec that you need to bring to a platform-agnostic managed environment like .NET. There are some problems with this. A codec that has been optimized for several CPU architectures includes a lot of platform-specific code, because that's ...


5

Not really. There's no purpose in moving to C++ if you don't make use of the C++ language and library features. It would be effort for nothing, and there are some costs, like ABI. OTOH, if you do make use of the language features (especially RAII, EH and templates), you will get a far superior program. Many problems can be far easier expressed in C++ than C,...


5

How C language is portable to any instruction set (I mean for new architecture). It is not, but C is portable to most reasonable instruction sets close to existing ones. As an hypothetical counter-example, you might define a computer architecture using ternary (not binary) or decimal. Both did happen in the past (1960s: IBM/1620 was decimal, Russian Setun ...


4

I'd say the most viable approach is to use the Strangler Vine method. Martin Fowler does a great job at describing the approach (I also found an article on docstoc that goes into more detail. Also it's hard to recommend which approach would work best for you, but I've always found that hosting VB forms in .NET is easier than the reverse.


4

If you are porting a library to a new language, I would follow the naming conventions commonly used in that new language. This makes it easier for developers used to the conventions of the new language but not the original. While the reverse domain name pattern is common in Java, for C# Microsoft's naming guidelines suggest something like YourName....


4

TL;DR All project management controls add overhead. Don't add overhead you don't need. Scrum is the Wrong Hammer Here (Don't Be a Nail) Scrum is a project management framework rather than a set of development practices suitable for an individual developer. Unless you are doing project management, Scrum is probably the wrong choice. In addition, when you ...


4

in general, every new architecture needs a new port of the C compiler (along with the rest of the C tool chain) Usually this starts with the development of a 'cross compiler' on a known architecture to compile C for the new architecture. (the compiler, itself, can be what is being compiled, from source, for the new architecture.) even a related new ...


3

I've read his article, and 1,2, and 4 are good points, but 3 is a circular argument. Also, his code examples aren't even close to the worst code I've seen. Surely, at some point, there must be code worth rewriting from scratch? It's one thing to say never do it, but it would be more helpful to try to come up with a way to reasonably decide where to draw ...


3

Probably...but There are probably additional exceptions - at some point 'large scale refactoring' and 'rewriting' are indistinguishable - when every line of code changes! But what I'm wondering is: what is the purpose of making hard-and-fast rules for situations you have yet to encounter? Joel's example was an extreme case (NetScape) not a common case. If ...


3

I don't know tons about visual studio but a search turned up this. It looks like you mostly have to worry about scope, type, and scanf errors.


3

10+ years ago we started a transition from Powerbuilder to Tomcat. Have no idea of the LOC, we had approx 600 tables. It was a transition from Windows UI to a web UI and we did it with a small team over 2-3 years. The Powerbuilder code and Java code interacted with the same backend database during the transition. Was a great day when we could decommission ...


3

You don't need to give any credit if you don't want to. Most computer languages are inspired by other languages and have features like those languages. Just check Python's own tutorial on classes and library reference for itertools. While reading these I thought they were advertising and nearly gave up reading the tutorial on classes as it was too much in ...


3

No, and that assuming the code will compile (you will have to make changes, C++ is not completely compatible with C, for example void * values cannot be assigned to other pointer types, and there are new keywords). In best case, there will be absolutely no difference. C++ doesn't add any new undefined behaviors the compilers can depend on. I don't think it ...


3

Is there any sort of benefit to be gained by porting the code to C++? I think the key phrase here is "porting". What do you mean by that? If you truly port the code to C++, make use of C++' features like templates etc., there is a chance this might speed up the code. (For example, C++' std::sort() is known to be faster than C's qsort() because a C++ ...


Only top voted, non community-wiki answers of a minimum length are eligible