Trying to read the configure scripts and Makefiles for software like Apache httpd server was overwhelming. There's obviously many man-months of work there as well as unknown styles, conventions, and tricks.
How (and why) would I go from "gcc -lexample -o program csci201.c" and maybe a simple Makefile to a 10,000-line ./configure script? I never had any idea.
Some configure.ac files are a bit hairy, usually because they depend on heaps of optional packages or because they test for all this obsolete stuff that autoscan told them to.
Have a look at libfake437[1], MudCore[2] or libtelnet[3] for some in-between examples.
[1]: http://code.google.com/p/libfake437/source/browse/#svn%2Ftru...
This is mostly from trying to compile tar balls that used it. It didn't seem to give error messages for missing parts as well as simple make.
The problem was that an intermediate student who can use gcc and make but has questions like "what's the best way to organize my source code into directories?" there were no good answers if you were stuck at the command-line with man pages. If you didn't have a good mentor, you were figuring it out for yourself, or trying to emulate a random open source project with hundreds of source files organized into multiple subtrees with helper files, shell scripts, dozens of libraries and modules, and huge configure files that bear no resemblance whatsoever to any problems you're actually trying to solve. Or, maybe, if not a big project, then another intermediate developer who was just as clueless as you and you don't actually want to be imitating.
Meanwhile, GUI-heavy IDEs were offering sane default answers for those intermediate questions and offering tools to help manage a moderate number of dependencies, build steps, and platform targets. Unfortunately, they were also hiding important details and too often became crutches for people who didn't understand how compiling and linking actually works.
I use UNIX as my IDE almost exclusively. When it comes to Java however, I don't think there's any way to avoid using Eclipse or Netbeans or something. Any nontrivial Java project is going to be convoluted enough that using the traditional tools is an exercise in futility.
For example, most IDE developers tend to love their debuggers... want to learn something? Just run the debugger! Want to debug something, hey run that debugger and watch 'dem breakpoints!
When I code without a debugger I tend to write smaller, easier testable code because I lack a real way to step through a convoluted process. I feel this encourages a simpler application (but I have no study to prove that).
Another example is most Java/C# work tends to be in the center of the unknown universe. You are editing something twelve layers deep in a mess of public/private/protected objects and you aren't sure if the item you should call is the MarginalFlowStateController or the ControllingMarginalFlowState... with an IDE you would just open up both of them, their unit tests, and any documentation until you discover which one you should be calling.
It bothers me because I really enjoy my vi/tmux development environment where every time I :w a file and run a test I am running on virtually the exact same environment as dev/qa/pre/prod.
Want to know if something is efficient? Then build a test to gauge it. That way if it changes and becomes less efficient in the future your test will break. That's a much more solid approach than simply walking through the code a couple times and noticing something out of place.
You're falling into the trap of "one tool to solve all problems." Why waste your time writing tests to "gauge efficiency" when a profiler tells you more, more effectively?
What happens next week when someone does an x += hugeBlockOfText in a loop?
I'd rather have a set goal and a test/process that validates it over a one time event where human error is involved. You want X process a million records in under three seconds? Build a test.
I'm not advocating one tool. I'm simply saying that everything described so far is better solved with a test first approach over a debug first approach. Build a test to replicate the problem. Solve the problem. Keep the test to prove that the problem is solved.
Then it will show up in your profiling? If you're doing something perf-critical it is absolutely insane not to be running it through a profiler suite on a regular basis. Your continuous integration system can (or should) be completely capable of replaying real or synthetic activity in order to demonstrate real-world hotspots.
Tests only find what you already want to find. Performance concerns are much fuzzier than that (unless you want to be writing "performance tests" for literally-literally everything, which you're welcome to do but I have better things to do than that).
The only way to make such tests really persist is to build in some kind of fixed known benchmark to evaluate baseline performance in the test environment, and then evaluate the software under test relative to that benchmark. This is a huge extra effort and hard to get right.
I can't offer any hard evidence to prove this. But personally I've found that keeping the discipline of always stepping through my code in a debugger — even when it seems to be working correctly — leads to improved results. Try it for a few weeks with a good interactive debugger and I think you'll see what I mean.
I was talking to a programmer who used to have to hand in punch cards and wait a day to get results. He said people tended to get it right first time in those days.
HOWEVER: (1) from my experience of working with people fresh out of school who were exclusively familiar only with the IDE way of building programs and who knew little to nothing about the command line tools -- such people were curiously unaware that many tasks (testing for example) could be automated. People who used command line extensively, on the other hand, would be the first ones to write a simple script that performed testing of their program. Testing is just one example (I'm sure there are many IDE-tailored solutions for it). There are other things that are done repetitively; using an IDE can mold one into thinking that such tasks are impossible to automate and that they can only be performed by clicking buttons.
(2) (Again this is about people either in school or fresh out of it -- certainly not about highly professional IDE users). People who were taught IDE first and who are not familiar with the command line will often assume that running command line utilities is an old-fashioned way and that they are more "modern" (therefore somehow "better") programmers just because they are using a GUI. Such people will then go on to write programs that completely ignore the standard way of interacting with the shell, even if their programs do run from the command line. One example: One of the programmers (who used exclusively GUIs for building programs) would write command-line utilities which, when outputting a text file, would place '\n' at the beginning of each line and not at the end, which then resulted in parts of the output being truncated when I ran them through sed/gnuplot/whatever. Firthermore, even though his programs were quite complicated (read: painful to debug), he had no idea what the difference between stderr and stdout was, and would write any errors that would come up to stdout. The same programmer was then curiously defensive when I told him that his way of doing it was wrong (his answer basically was: "I've been programming for a long time, and I've always done it that way, and I don't care that my programs don't play nice with that sed thing with which I'm not familiar with").
1) People who exclusively use the command line, especially when recently graduated, have extreme difficulty thinking in an OO fashion, because they have not had the tools to support exploring inheritance and call stacks the way someone with a visual OO development environment has (Smalltalk is ideal for this.)
2) People who have used the command line exclusively are content without visualizations, which can be massively more effective at conveying information, especially about performance and architecture.
3) People who have used the command line exclusively are less likely to employ refactoring tools and more likely to tolerate long, poorly factored code because vim/emacs makes it easy to navigate and ignore the ugliness.
4) People who have used the command line exclusively, especially when they are recent graduates, believe that their approach is inherently better and necessary in order to be a good developer. They get curiously defensive if you expect them to be able to instantly jump to the definition of a method in question or actually use the Strategy pattern.
2) I have encountered people who used UML/SQL schema diagrams in a cargo-cultish way to prove to themselves and (especially) others that what they were doing was well thought-out when in fact the opposite was the case.
3) That reads more like an argument in favor of Vim/Emacs as superior editors. Also, it seems silly to blame lack of refactoring on editor when it's more of an issue of whether the programmer has a sense of code elegance and clarity or not.
4) I guess hubris is not exclusive to either side.
Building the project is not really that difficult, and make can be made to do it just fine.
The Desktop GUI I'm making involves about twenty libraries, multiple threads and other complexities.
I could make my job even more complex by diving in and learning a command-line way to do everything. But it seems to me, my personal approach is, I move ahead by dealing with the necessary complexity and letting the unnecessary complexity fall away.
I mean, I'm sure there a way use ls with wildcards in a way that doesn't puke all subdirectories out at you when you're trying to find a single file in a large directory. But the fact that ls does this by default seems like strong evidence that the interface wants you to remember random bs - indeed, I've read stuff here where people were saying essentially "vi is good because it makes me remember arbitrary commands, strengths your brain". It might even be true that it strengths your brain but I think only a subset of even geeks want to relate to their computers like this and this subset isn't the same as geeks who can create useful and powerful programs or the most productive subset.
Also, I don't see any inherently more powerful tools here. Qt Creator can show me the meaningful references to variable foo, excluding comment "foo". I can't see grep doing that (even though I use grep for some thing but I still memorize ten cli options). All the tools are pretty Turing complete if you dig so it's hard to claim one thing is more powerful than another.
But here's some stuff Qt Creator can't do (or rather, provides no particular support for -- you can always use it as a text editor, of course): iOS apps; Android apps; sending email automatically; kernel drivers; languages other than C++ or Javascript: Scala, Haskell, TCL, C#, sh, perl, prolog, lisp...; build and deploy a node.js app; fire up an AWS instance; build a binary for an AVR microcontroller and download it to a device; Verilog or VHDL editing/synthesis/verification.
Obviously I could go on and on, but you get the point. The command line environment? Yeah. It "does" all that stuff. And it does it in the same way. A Makefile for your VHDL project is going to look like a Makefile for your web app. The build scripts for your machine learning rig and your AVR hackery work the same way. You write your email in the same editor you use to write your C++ and CoffeeScript (and that you used 20 years ago to write your TCL!).
So sure: if you want to spend your career searching for "foo" in your Qt C++/QML projects, Qt Creator is a great choice. And the next environment you work in will have a new tool, that does all the same boring stuff in mostly the same ways, and you'll need to learn it again. Pick up the command line and get better at it and you'll find you've opened up a much bigger door (and you won't need to learn to use a new editor every year, to boot).
Is it clear now why there are some of us (with decades of make and shell and ssh in our toolbelts) who sit here and scratch our heads at the perpetuation of this nonsense?
It's no more clear than it was before--that is to say, perfectly so. But here's one for you, in turn: I'm glad that it works for you and that you like it, but if you want to insist it's objectively superior and I don't know what's better for me (which is what you've been doing throughout this thread), I cordially invite you to go fuck yourself. Impolite of me, sure, but telling you to go fuck yourself is considerably less impolite than patronizing people who decide they don't value working in the same way you do. I've been where you say to be, I've done what you say to do, and I got the T-shirt that you're rocking out in. I put it in a drawer because I think it wears poorly.
I have plenty of experience with "make, shell, and ssh"--I'm neither new to nor afraid of working in shells. Doesn't mean I want that to be my primary work environment and certainly doesn't mean I'm either ignorant or wrong for disliking it. For me, a phrase which I will italicize a few more times because you seem unable to internalize this, the UX of the command line abjectly sucks for tasks beyond basic file manipulation and quick text editing. It sucks! For me. I don't care about its hallowed consistency when it makes me feel like shit to be using it all day and makes me feel like I'm wasting my time. Learning new tools is, for me, a smaller cost than hating what I do. I'd rather go learn a new tool, one that's specialized to its use case, because in every case I've encountered it is both a more productive and more enjoyable experience. If I'm not going to value doing my job in an enjoyable fashion, I might as well go be a plumber.
I'm more than happy to use the command line to handle deployment tasks and other automation, but for actually creating things, writing code and doing development work? I'd rather have a tooth pulled than work in vim all day. But I recognize that that's the case for me. Your decisions to use those tools are right for you but not for me are your decisions--if they make you happy, awesome! But your patronizing "what you do is nonsense" crap (and your consistent implication that not adopting your methods is borne out of ignorance rather than experience) leads me to invite you to GFY.
Preferring consistent tools to specific tools for different tasks is not better; it is preference. And, quite literally, nothing more.
I don't know why you took the parent post so personally; they never attempted to convince you that the command line is superior all the time for everyone. I can relate to it already. I saw a post on here a few days ago about shortcuts for some random new-ish editor (Sublime text 2?) listing awesome shortcuts that people should use. So what? None of that can compare to what is possible in Vim and it never will. I'm sure it's helpful for those who use that tool, but sometime soon there will be some other new tool that replaces it as the hot new editor for language x and those people will have to relearn it when they switch tools. However, that new tool will still use <ctrl-g> to find by line number.
Learning new tools on Linux is as easy as reading the man page or reading online and failing that I would dive into the source code. For example, I learned how to use rsync last night, but only enough to do what I was trying to do. Luckily, that knowledge will build as I require new uses for it. What makes this all worthwhile is that I can now make my computer do whatever I want and I am not limited to what others have built for a specific use case because these tools can handle almost anything.
Characterizing a well-reasoned decision not to use the command line and command line tools for everything as "nonsense" certainly is implicitly placing your chosen tool stack as objectively superior. It isn't.
The rest of your post is more of the same--I'm glad it works for you (and for text editing I use MacVim quite often, but not for development because for that task it sucks for me) and its reasons are great for you, but it is not objectively superior. Which is why I responded to the post to which I responded in the first place--because it was the sort of sneering arrogance that's so common in these parts, where my way is the best way. It is the best for you, and I'm happy that you enjoy it, but taking the tribal rock-throwing ("what you have chosen to do is 'nonsense'") attitude that ajross did is stupid.
For example: I use MacVim and Textmate for text editing (writing markdown files, etc.) because they're good at it. And that's about where it ends, for me; I would under no circumstances use it to write more code, than a one-off Python script because I find it displeasing to do. I feel annoyed and angry because writing code in it is, for me, a slog; I consider ctags basically defective and they're not as good as, say, IDEA's Python (or Java, or Scala) support (or Visual Studio's for C# or VS's and Xcode's for C++).
Similarly, and heading back towards the command-line realm: while this thread is full of people extolling the virtues of make (and my eyes made a credible attempt to roll out of my head at the idea, because make is one of the build tools I swear at most often at work...), it would be utterly stupid of me to use make for most of my personal projects because xbuild (for C#) and Maven (for Java) exist--but, oh the horror, they're specialized to their task, what if I want to flip waffles instead? And to that I respond, I don't care about using xbuild or Maven to flip waffles, because their job is not to flip waffles but instead to build C# and Java code. If I need to write a platform-independent build script for C or C++, sure, I'll use make (although today I'm more likely to use cmake), but that doesn't make it a wonderflonium-packed delight for everything else under the sun. I know this from personal experience; I deal with a make-powered Java app with makefiles best termed "monstrous" and if I could turn back the clock and make it a Maven application we'd have about a tenth of the headaches that we get from the current system. Because it's made for the job.
I would rather adapt to tools better suited to a given task than use consistent tools across all problem sets. I don't find picking up new tools to be daunting or particularly time consuming (I picked up IDEA in about two hours, despite it being markedly different in behavior than previous IDEs I'd used, and I'm significantly more productive) and I don't find value in the "elegance" of bolting 30,000 things into vim to make it almost as good as my IDE was, for me, a decade ago.
But what I have said above, if you listen to ajross, is head-scratching nonsense. Which is patronizing and insulting to people who've decided that their priorities aren't his. Such was the attitude to which I replied.
I could to write emails with vi and I could learn to write python extensions for Qt Creator to do just about anything also. I could add an email-sending make step to my project if I happen to want send emails when I checked changes into git. I don't know which one is better and I don't do either right now because I don't have to.
As far as doing things "the same way" goes, the same way as what? I've actually done lets of command-lining in my time. When I need to formulate a twenty argument command, I usually edit it in a text file and paste it to the prompt. And the thing is, the argument syntax of shell commands isn't consistent. The only unifying factor is the various pipes but it's hardly a panacea. I mean, fricken grep only searches directories recursively for a pure wildcard search (just "*"). You can pipe the results of this search to a further search for, say. ".cpp" but if you've got lots of non "cpp" files that happen to have the "cpp" string next to the string you want in them, you're hosed. I'm sure someone has some other trick for this somewhere. But the situation seems to boil down to "you can do anything if you take the time to learn everything" - I mentioned you could write custom IDE extensions right?
emacs.
Sorry, but seriously that is BS. I started coding with Basic on a Commodore 64. By the same reasoning, I should be mystified by a mouse.
People learn, tools and languages evolve, especially during the whole span of a 40 years career.
Also: I'm not following. The context of your post implies that you agree with me, but the facts seem to say you're an IDE user. How can you possibly be doing development without modifying your build system? If you're not using make, you're using something else. My guess is it's an IDE...
That is true if the user didn't already give up and leave programming completely due to the obtuseness and complexity of autotools,makefiles, m4,macros and workarounds like cmake.I survived it, but many others in my Masters class did not. http://esr.ibiblio.org/?p=1877 If even ESR finds them troublesome, what hope does a beginner have?
>Of course. But one environment scales and the other doesn't. A IDE user who only knows how to modify projects by adding files and clicking checkboxes for optimization settings will do that for the rest of their career
Using an IDE does not mean that you cannot do advanced configuration, including setting options that change the commandline of the compiler used. Don't almost all GUIs call commandline compilers on the backend?
Visual Studio even shows you the commandline being used when you hit the Build button. SQL Server usually has a "Script" button to generate script for a admin GUI option and you can do anything you can do in the IIS GUI with Power Shell.
The power should be there for when you need it, but making everyone go through arcane options has the unfortunate side effect of making the tool less popular though it does show the power of the tool to the novice user.
And, sigh, "advanced configuration" is certainly something more than setting compiler flags. That was sarcasm, intended to show the limit that IDE users hit trying to extend their tools. For a practical example, how about this: conditionally build the modules of your C/C++ project such that they can be either linked in statically to the main binary or loaded dynamically, and generate both versions in a standard build. Someone who knows how the linker works and how to write a makefile can do this in a day, easily. Someone who only knows the IDE will be lost; there's no button for that. They'd probably hack up some monstrosity involving thousand-line boilerplate like building all the modules as separate subprojects or some nonsense.
I'd like to hide in the corner and applaud the recognition of this reality. I grew up with Windows, I've been learning cli and vim and ... for 5 years and I still suck. But as Kennedy said, "don't wish for easy lives, wish to be strong [wo]men."
> Using an IDE does not mean that you cannot do advanced configuration, including setting options that change the commandline of the compiler used. Don't almost all GUIs call commandline compilers on the backend?
That's really illustrating his point, rather than countering it. If all you think of in terms of "advanced configuration" is "setting options that change the command line of the compiler", you're missing entire worlds of flexibility and productivity wins because of this GUI-centric view of things.
What about, say (and this is a very trivial illustration of flexibility), compiling part of the project, running a tool that analyzes those .o files along with some network resources, which generates yet more source files, which are then picked up by another step in the same build process and linked into the final executable?
I had to build essentially that kind of build system a few years back, for two different ecosystems, so that they could share some common infrastructure in a Big Org™ (a command-line/unix/ant-based Java build system, and a Windows/Visual Studio 2003/2008 based C# build system). The Java version was straightforward, but the Visual Studio version was an exercise in frustration.
The IDE Gods grant you no "custom build step that will generate an unknown number of files with unknown names which you will then pick up and compile as part of this compilation process" button to press. They give you a build scripting language, MSBuild, but it's so crippled by the baked-in assumptions of its IDE-bound design that it won't get you anywhere (to be specific, it assumes that you can hardcode the name and path of every file to be compiled by the project. It will let you insert a wildcard, but it expands them when the IDE opens the project file, which is useless when files are generated during the build, and if anyone deletes a file from the project in the IDE, it will "helpfully" rewrite the wildcard into separate entries for everything the wildcard matched back when the IDE opened the project file. Pure crap).
And this is a really trivial way to use the flexibility that the unix build environment gives you. There's so much more that can be automated than any IDE could hope to present a GUI for.
Just make sure you have make.exe in you PATH and maybe defer the call to a batch file if it is too complex for VS. Or use the batch file to set up the PATH altogether.
Unless I'm grossly misremembering, pre-build tasks would only have worked if the project had been broken up into separate projects such that the generation script could run post-(a) or pre-(b).
BIN=my-program
OBJ=file1.o file2.o file3.o
DEPS=../foo/libfoo.so
-include ../config.mk
include ../mk/c.mk
include ../mk/lexyacc.mk
It's not hard to modify, it's flexible, and if I need custom scripts to generate files, it's very easy to extend. I don't have to futz with compiler options, command line parameters, etc. I just add the next .o file to the list, and get back to coding.There's room for improvement, but it works for me. And it's implemented in less than 100 lines of make.
I can barely stand to work on projects that don't use maven any more. Declare your dependencies and your sources in a standard format that every other project uses, and then get on with actually writing code; the build system is not the place for arbitrary complexity.
Why? I mean, the fact that a newbie developer just needs to know how to press one button to build their code is actually pretty amazing. Plus, how many school projects are complex enough to require much more than that?
The best way to learn something is through whatever method encourages you to learn.
For some that is starting from zero, others want to start at the highest level and work backwards, others start in the middle and jump around. Whatever can keep you interested.
Being familiar with command line tools for debugging allows you to troubleshoot issues in production, saving the company money, and troubleshooting issues in production generally means working with command line tools on linux servers. This is valuable even if you're not in operations.
2 examples to back this up (one from a backend developer and one from a frontend developer):
My former boss used to run the Customer Order Workflow (COW) team at amazon. He related to me how useless/slow he felt the first time a production issue popped up and he was trying to get some ungodly combination of WinSCP and notepad working. Obviously he learned vim very quickly after that.
Even if you're not on the "backend", you may find yourself needing to ssh to a server which is reverse proxing to something else, and running curl/wget to try and figure out why the CDN isn't serving the latest version of the CSS file you just created even though you're using a cache busting query string.
Sadly saving the company money doesn't always translate into more for you, but experiences like this generally end up making you a go to guy/girl, which can lead to being a lead engineer.
I was thinking about vim just a bit ago (I hear emacs pinky is a real bitch). Maybe I'll put eclipse on my ubuntu too and check it out (dunno if it has support for python or not. I tried IDLE and didnt like it ... )
I have kind of stalled out a bit lately. maybe it's time for an IDE anyway
Despite the advice that you must use a terminal editor to edit files remotely, nautilus (& others) let you mount remote folders over ssh and edit them locally with the editor of your choosing. I find it very convenient. I hit a bookmark and start editing, keeping the terminals reserved for commands instead.
On the other, it's a giant facepalm that the simplest, best documented, most powerful development tradition of the last 40 years actually needs this treatment. That there is a whole generation of developers who come out of school thinking that "building" is the action of pressing a button in an IDE GUI (and that "writing a program" means launching a big wizard that pukes a dozen files into a new directory) is just depressing.
Oh, and get off my lawn.