11 ms·
How can I convince my boss that ANSI C is inadequate for our new project?
- debacle 14y agoMany of the responses there are for C in lieu of C#, which I disagree with. Unless you need the performance of C, you should always use a higher-level language, and C# is a beautiful and powerful language, and if you're any sort of C programmer, you can pick up C# relatively easily.
- dazzawazza 14y agoIn general of course what you say makes sense but in this instance the app should be written in C. The client asked for C, they know the future, you do not. If, as the service provider, you recommend C# and detail all the advantages and the client still wants C you go with C. Simple as that. Saying C# is beautiful and powerful is irrelevant. The task can be done in any number of languages but the client asked for C, go with C.
- debacle 14y agoThis isn't a client, it's a manager. There's a vast difference in the relationship there.
- dazzawazza 14y agoYes there is but within the scope of this problem I don't see that it makes much difference. You talk to your manager and recommend something but the buck stops with him and you do what he says. He is essentially in charge. If you can't accept this then leave, you have no respect for then, why would you want to work with them. If you need the money they get on with it. Programmers need to be more professional. As a professional you give your professional opinion but that isn't gospel. You note your protest and then get on with the job you are paid to do to the best of your ability. BTW I am a programmer. I've been junior, lead and manager so I've seen it from all sides.
- toyg 14y agoProgress is achieved by unreasonable people. If all programmers had never "disobeyed" their managers, we'd be probably still writing accounting software in COBOL.
- dazzawazza 14y agoSo it's OK for the programmer to be 'unreasonable' but not for the manager? Progress is actually made by teams of people working together for a common goal.
- eswangren 14y agoYeah, but perhaps your boss knows something you don't, perhaps he has some amount of wisdom gained through experience that you don't.
- Avenger42 14y agoYou don't do that by disobeying your boss - you do it by quitting, finding your own clients, and saying "your competition is taking 6 hours to do this, and I can do it in a fraction of the time by using new language/feature/technology/process X", and beating your boss at his own game. If your boss isn't paying you to look at the new technology, do it on your own time and in your own projects. If you want, you can come back afterwards and say "based on my personal experience, we can save time/money by switching to X" and give them the opportunity to try it out - or to overrule you.
- chris_wot 14y agoANSI C is a near universally portable language, C# is not. His boss wants it written in C, and his boss is the customer. Of course, his boss is specifying global variable names, so said boss is a micromanager... A no-win situation here really...
- damian2000 14y agoC# isn't as portable as C but it isn't totally unportable either. Mono allows you to target iOS, Android and Linux for example.
- shadowmint 14y agoHardware interaction is the place where mono fails most often in my experience; portability for something that actually touches the underlying hardware (of any type) is probably not possible using c#.
- damian2000 14y agoAnd for that you can always call the native methods written in C, from C# - the support for doing this is excellent on both Linux and Windows. You can reference a function in a .DLL on windows and in a .so on linux.
- icefox 14y agoHave you ever heard a C# guy going around talking about how they ported their C# code to iOS/Android/Linux? Excluding projects started with that specifically in mind and built using Mono I have never heard of of a Windows C# project going the other way.
- damian2000 14y agoAgreed its rare but I wanted to reply here because I did just this thing myself last week. I had a ~6000 line TCP/IP sockets and serial port application (command line) written in C# on windows. I needed to port it to run on a Raspberry Pi (running Debian Wheezy). A rewrite in C was the initial plan/expectation. But got it working in Mono, with only a handful of changes to the serial port code.
- jerf 14y agoThere's another reason. C + threads + computer science students maintaining it in sequence over the course of years is a recipe for disaster. Drop any one of those and it can be made to work, but not that trifecta. That said, the right answer is probably still to deliver it in C as requested, and walk away. The customer has spoken, and seems to broadly know what he is talking about (ie, it isn't a nontechnical customer who is asking how "cloudy" your solution is, it's a programmer), so... well... OK... if that's what you really want....
- petervandijck 14y ago"he even gave us a list with the name of the global variables (sigh) he wants us to use." -> Your boss clearly doesn't trust his team. Get him to trust you (may or may not be possible), and everything else will follow.
- TheGateKeeper 14y agoThat or whoever the poster is, is inadequate at understanding technical level management and their requirements. I had the same problem once.
- MartinCron 14y agoThis smells like a lost cause. I would consider looking at finding a manager with whom you are more...compatible.
- Turing_Machine 14y agoI suspect that choice is going to be made for him, once the manager learns that his explicit instructions were ignored. :-)
- MartinCron 14y agoI think so too. It makes me sad, because the whole thing could have been avoided with some better communication and leadership skills. We programmers tend to look at all things as technology problems, even in the way the question was asked ("inadequate?" what?) when it's almost always an interpersonal problem.
- qdog 14y agoOn the other hand, the poster didn't say what this list of global variables is. Maybe they are just configuration values? Probably not, and mentioning threading and global variables probably means some kind of nightmare, but as I've recently been reminded, not knowing all the facts we tend to make up a story in our heads... I've had to write some C that interfaces with C#, so providing a low level library for a C# UI might be an option, but implementing it without the Boss's permission...yeah probably not so wise.
- webreac 14y agoYou have completely failed to convince us that ANSI C was inadequate. C is an excellent language that seems adapted for the kind of tasks you have described. With the short description of the task (except the language requirement), I would also recommend C or go. I think the problem is that you were programming in C with your mind thinking in C#. I have a similar problem when I switch from Perl to C or java. You must learn to adapt to the language, and not learn to translate from your way of thinking toward the language of the day. The problem is not your boss or the C language, the problem is to open your mind toward different ways of thinking.
- damian2000 14y agoYeah C is good for lots of things, but not great for developing a desktop UI in Windows, when compared to C# for example. You'd be going back to the dark ages of Windows SDK development if you want to do that part in C.
- kokey 14y agoThat's assuming that in 5 years from now Windows is going to be the popular UI platform. If much of the program is not about the UI, then C is a good choice, since whatever finger nail mounted laser projection display computer will become popular in the future, you'll have ANSI C projects ported to it quickly. C#, I'm not so sure.
- huhtenberg 14y agoC# is not that great either. It's the IDE and all the supporting libraries that make a difference. And in this lies the problem - what if these libraries change, what if the IDE goes away or it license changes. Chances are that in a few years your UI code won't even build with then-current version of the C# toolset. On the other hand, C-based UI that depends solely on <windows.h> will.
- sbmassey 14y agoYeah, but mandating a list of global variables though?
- cobolorum 14y agoWell, C is never inadequate. Quite a few languages have their interpreters/jit-compilers written in C. C is portable. C will continue to be a major language and will not become some obscure legacy language. You can tell I am a fan boy, but I am a fan boy for a reason. That said, you do not seem to like C, and further you already have the program written. I think you would pitch this as your "pseudo-code" and show it to your customer. Let him or her know that you will be rewriting it and that this could take some time. If your customer is willing to wait, you now have two programs that you can benchmark to compare speed. You can compare development times in a real way, etc... quite an interesting little project once the "project" is finished.
- debacle 14y agoIf your speed of development is glacial because the language you are writing in is just a hop skip and a jump away from ASM, then the language you are writing in is inadequate.
- gms7777 14y agoIf your speed of development is glacial in C, then perhaps its that the skills of your developers that are inadequate.
- cobolorum 14y agoThis sounds a lot like some random FUD that you picked up somewhere. If C dev times are so long, why is it that new versions of large scale applications written C are available so often? An adept C programmer can get an application up and running in quite short order. Quick GUI? GTKDialog is available as are: Win32 GUI API, GTK, QT, ncurses, FLTK, and many more. It is also worth noting that should your customer/employer be willing to use some opensource code in his/her/their application, the amount of open source C code available online is quite staggering.
- gregsq 14y agoBe afraid. Very afraid. Project managers can often appear like roadblocks to innovative solutions. In fact, I've lost arguments even when the benefits for a particular technical solution are obvious and accepted. But maintenance is a big factor for those people. Not meeting a requirement is bad for your future prospects. Deceiving others is potentially disastrous for you current ones. What would be said if a future requirement, unknown to you, were for an ARM chipped portable controller for said instrumentation, as a student project. Bad move.
- philhippus 14y ago"ANSI C is inadequate" - No. It's perfectly adequate. I think you mean too low level.
- arocks 14y agoRather than a language inadequacy issue, it is better to think of this as a resistance to 'change'. This is a much bigger and yet common problem in enterprises. Everyone would have their comfort zone and have found safety in sticking to it for years. So why change now? There have been many studies on Change Management and certain strategies work in some situations better than the others. Most of them take a structured and step-wise process - e.g. Preparing for Change, Managing Change then Reinforcing Change. It is certainly hard to master the skill of convincing others to take up change, but it is paid off many times over the years in numerous situations. So it is well worth trying.
- dave_sullivan 14y agoExplain to your boss the cost/benefit of using a higher level language over c. C's benefit historically has been performance. I think the case for performance is becoming less compelling for 2 reasons: 1) The performance gap is closing, thanks in particular to projects like cython that let you write python code that gets converted over and compiled as c++ that's often more performant than the c++ code that devs might write themselves. 2) In general, the cost of hardware continues to drop while the cost of developers goes up. C takes longer to write than eg Python--I don't care who you are, it does. And if you're the god programmer of C, you probably cost a lot. So what would be the benefit of c for your boss really? It will cost more to develop, and the performance gains may not be as noticeable. It would quite possibly be bad business.
- heretohelp 14y ago>The performance gap is closing, thanks in particular to projects like cython that let you write python code that gets converted over and compiled as c++ that's often more performant than the c++ code that devs might write themselves. Well it's obvious you haven't done any systems programming. >In general, the cost of hardware continues to drop while the cost of developers goes up. C takes longer to write than eg Python--I don't care who you are, it does. And if you're the god programmer of C, you probably cost a lot. That's not what experiments have borne out, time-to-develop generally has a lot more to do with proficiency in the language of choice and in the problem domain than the language itself. I will say, however, that it is generally slower to write things in C, but not so drastically that it merits abandonment. >So what would be the benefit of c for your boss really? A solution that would reliably fit within the real-time and maintainability requirements of the problem being solved, unlike a throughput-focused GC'd language like C#.
- MartinCron 14y agoWell it's obvious you haven't done any systems programming While it may be true in this case, this is the sort of insulting and dismissive argument that I don't like to see here.
- 14y ago
- shadowmint 14y agoIt's not. Let me summarise the task: Continuous measurement of custom hardware in real time with some trivial user interface. There are two parts to this: 1) real time device I/O <--- Really important. 2) user interface <--- Irrelevant, will probably be replaced multiple times over the life of the project. This is how the OP needs to pitch it to the boss. (1) is critical and C is flat out the best language for real time I/O, and it's the best choice for making an easy-to-use DLL that can be loaded and used by any number of other systems (C#, python, etc.) (2) is hard to do nicely in C, but we can have a very trivial very rubbish ANSI C user interface if that's what you want. However, we can do a much better job by calling the library from (1) from another target (eg. c#). We can also repeat the process in (2) to build an alternative 'user interface' that is in fact a test harness / test suite for (1), increasing reliability (something that C once again, sucks at (testing that is)). "Here I made a prototype in a language you didn't ask for! It's the ROZZXXEOR!!!111" is just about certain to generate a negative reaction.
- eswangren 14y agoYou missed a critical requirement; the boss wants it written in C because he will be the one maintaining it. That is not something which should be ignored. The boss isn't learning C# any time soon apparently, so write the damn thing in C as he told you to. You are free to try and convince him that C# is the better choice, but if you fail; suck it up, too bad, do your job.
- prawks 14y agoThis sounds like a great way to approach the problem. While the author's boss might have too narrow of a field of view in technologies, the author shares his/her boss's strategy to use a hammer as his sole tool, regardless of whether he's driving nails or screws.
- deleted 14y ago[deleted]
- sophacles 14y agoI agree, however, I would argue that 1 needs to be an independent process, with an IPC mechanism rather than a library. This would allow for multiple systems to access the same research data - If my experience in research maps to the specific situation (not all research is the same), this means that several experiments can easily have a rock-solid data source, without needing to debug the library integration every time, and allowing for post-processing chains to build of each other.
- guilloche 14y agoI only realized that C is much better than c++ after using c++ for 20 years.
- forgottenpaswrd 14y agoYou should stop thinking that c is inadequate and do two things: 1-Automate pointer creation so you don't spend time with them. 2-Automate string creation. The good thing of programming is that you could automate anything. C# just automates it for you by default, but it is not god either. In fact for platform independence is one of the worst languages to choose(and windows future looks no brighter than its past with iOS and android). You could use c inside Obj c, on c++, on python and java super easy. It seems to me that "inadequade" is "I don't know enough about programming, and I only know one (proprietary) language, so I want to only use it"
- eropple 14y agoIt is one of the worst languages to choose for platform independence, is it? Strange. My application running on Windows (Desktop and Metro), OS X, Linux, iOS, Android, and the PS Vita seems not to have gotten the memo. And as it happens, I used it not because I'm not able to write C or C++, but because doing so is a waste of effort better suited to doing other tasks.
- huhtenberg 14y agoI find it hard to believe that you can cross-compile C# code to all these platforms without creating heavy dependencies on 3rd party abstraction layers and/or toolsets (like Unity).
- eropple 14y agoI don't really care what you believe. I do it with Mono and open-source libraries.
- MartinCron 14y agoand I only know one (proprietary) language Sorry to be so pedantic, but C# is absolutely not a proprietary language. Yes, it's predominantly used in a proprietary context (OS and tooling), but the language itself isn't proprietary.
- patrickmay 14y ago"A few months ago, we started developing an app to control an in-house developed test equipment and record a set of measurements. It should have a simple UI, and would likely require threads due to the continuous recording that must take place. . . . Our boss . . . has mandated that we develop this application in ANSI C. . . . I actually tried that approach for a while. . . . After a few days, I scrapped the entire thing and started anew using C#. Our boss has already seen the program running and he likes the way it works, but he doesn't know that it's written in another language." I'd have my resume up to date if I were you. Your technical arguments are irrelevant at this point -- you spent a significant amount of time deliberately ignoring the clear instructions of your manager and, apparently, not communicating with him. I would fire you on the spot regardless of the quality of your solution.
- juan_juarez 14y agoI'd have my resume up to date (and start shopping it around) if my manager was telling me the names of global variables I should be using.
- patrickmay 14y agoThat is a valid point. I would still certainly suggest having an open and honest discussion before spending company resources on something other than what was specified, though.
- MartinCron 14y agoWhile I think the poster really messed this up, big-time, I can empathize with him or her to a degree. I prefer high-level languages to low, and I also tend to avoid conflict. One way to salvage this situation without getting fired might be to come clean now, be contrite, stop using incendiary words like "inadequate" and demonstrate the new solution as something that just got out of hand. It's hard to hire programmers right now, and the manager would have to weigh the (legitimate) desire to fire someone on the spot with the fact that getting a replacement would be expensive and annoying. One could even say "now that I understand the problem better, I have a better handle on implementing it in ANSI C, as requested".
- umustbejoking 14y agololwat?
- deleted 14y ago[deleted]
- pfortuny 14y agoPart of the project is writing it in C, so you cannot and you should not. Sorry for the bad tidings.
- EvaPeron 14y agoOne could of course write a wrapper function to create strings, like char* someString = makeAString("A String"); where makeAString takes a char* as input, allocates the memory it needs via malloc (I prefer calloc though as it is safer by setting the allocated memory to a default value, IMO), and returns a char* as output, thus saving lines of code whenever one wants to make a string. Probably stating the obvious I guess, but if one takes a few days to make some wrappers like that one saves time down the road. Were it my boss, I would say, OK, we can do it in C, but you need to give me time to make some wrappers that I need in order to get this done efficiently. Just a thought. :-)
- Locke1689 14y agoEveryone here has forgotten the main rule for choosing a language for projects. You have to actually know the language. The developer here very clearly doesn't know c all that well. That's all we need to know to know it's a bad choice. C is an especially bad language to use if you don't really know what you're doing. If Linus Torvalds it's starting a new project, C is probably a good choice for almost anything. Why? Because he's an incredible C programmer. But we shouldn't confuse every developer with Linus Torvalds.
- MartinCron 14y agoIf that's the case, and C is the wrong choice for that developer but the right choice for the project, then it follows that the developer is the wrong one for the project. I had that exact same thing happen to me once. There's no shame in it.
- Locke1689 14y agoTotally true, but it doesn't appear that hiring another developer is in the works. So C# it is.
- phomer 14y agoInteresting. The boss gives a very specific set of requirements, then the programmer disobeys this direct order, goes behind his back to do it differently and has essentially been lying to him or her for months. It doesn't matter if it's the right or wrong technology choice, this is really an issue of 'work ethic'. Perhaps if the language was left unspecified, or it was a suggestion to use C rather than a requirement then it might be different, but this sounds like a rather blatant violation of trust based on a lack of respect. I'd have no problems removing the programmer from the project, even if the software was awesome.
- bmj 14y agoYeah, I think this is an important point. If you don't agree with your bosses architectural decisions, you probably should have discussed those initially. If you feel like your boss wasn't listening to reason, does he have a boss? Simply going off and doing your own thing seems like a particularly bad idea, and I'm not sure I'd want someone on my team acting in the same manner.
- dumbdumbda 14y agoHow can I convince young programmers who read StackExchange and generally look to forums for "advice" that it is worth their time to learn ANSI C (e.g., because it performs better than their suggested alternatives, it is time-tested, more widely known among programmers, etc., etc.)?
- chris_wot 14y agoOh look! Not constructive.