News for hackers. Stuff that matters.
Re:CS631 – Advanced Programming in the Unix Environment by weatherlite on Sunday October 09, 2022 @02:25PM (#33143888)
After 10 years of writing software for a living I still don't get this. Why vim/emacs and not Intellij (for instance?). What do you mean magical - I want a powerful tool to help me edit code...
Re:CS631 – Advanced Programming in the Unix Environment by 533474 on Sunday October 09, 2022 @02:34PM (#33143970)
Experienced emacs users will beg to differ. It is as capable and arguably, more easily extensible. I must admit, it is not for everyone. As your anecdotal 10 years experience, I have the opposite opinion but I think it is fair to say that both, Graphical IDEs and emacs/vim, have their merits. Having transitioned from Graphical IDEs -> vim + plugins -> emacs + evil + configs + org-mode. I will never go back to my old self, I've never been as productive and free.
Re:CS631 – Advanced Programming in the Unix Environment by scruple on Sunday October 09, 2022 @04:24PM (#33144952)
Same trajectory here. I started with vi(m), used a handful of IDEs along the way, but vi(m) was (is*, if I'm in my terminal and just need to edit a config file or look at some data file, and sometimes even just for reading source, I default to using neovim) a mainstay, and I also eventually landed on Emacs with evil-mode. I still use an IDE frequently for graphical debugging. I find it's the best way to approach thorny problems, but I jump in and out of the IDE quickly. I don't hang around in it and write code, almost as a rule.
Re:CS631 – Advanced Programming in the Unix Environment by ms4720 on Sunday October 09, 2022 @09:33PM (#33146950)
I just wish emacs used a better lisp or scheme
Re:CS631 – Advanced Programming in the Unix Environment by alpark3 on Sunday October 09, 2022 @02:30PM (#33143932)
I'm assuming the rationale is that for someone who's doing complex system-level stuff on unix/linux they should be able to change things deep in the weeds instead of pulling the entire code out to IntelliJ or an IDE.
Re:CS631 – Advanced Programming in the Unix Environment by nuclearnice1 on Sunday October 09, 2022 @02:30PM (#33143928)
One difference might be the pedagogical vs the productive perspective.

Perhaps the magic of a full fledged IDE is thought to obscure some of what is essential to the subject.

Re:CS631 – Advanced Programming in the Unix Environment by weatherlite on Sunday October 09, 2022 @03:13PM (#33144276)
I vaguely remember hearing something like that when I just started uni and they had us all working on Emacs. I can attest it added zero value to me...but that's just me.
Re:CS631 – Advanced Programming in the Unix Environment by waynesonfire on Sunday October 09, 2022 @02:54PM (#33144131)
> I want a powerful tool to help me edit code...

Then why would you use Intellij and not vim/emacs?

Re:CS631 – Advanced Programming in the Unix Environment by emoII on Sunday October 09, 2022 @02:59PM (#33144174)
Please educate me - since I feel like writing Java without IntelliJ is like riding a bike without wheels, what does emacs/vim do better?
Re:CS631 – Advanced Programming in the Unix Environment by HL33tibCe7 on Sunday October 09, 2022 @03:11PM (#33144263)
Tbf I’m a heavy vim user but I’d still 100% use IntelliJ to write Java. It’s different to most other languages in its verbosity, and the fact that (imo) it doesn’t slot nicely into Unix conventions in general.
Re:CS631 – Advanced Programming in the Unix Environment by pjmlp on Sunday October 09, 2022 @04:27PM (#33144989)
One would think Sun understood what UNIX was about.
Re:CS631 – Advanced Programming in the Unix Environment by ninkendo on Sunday October 09, 2022 @04:47PM (#33145195)
Sun never really integrated Java into its UNIX environment very well, IMO. My memory of that time is spotty but I don’t recall any of their UNIX tools actually being written in it. (Likely because the startup time is awful, which is bad news for any CLI programs which need to execute and finish quickly.) The Java way of doing things and the UNIX way of doing things are worlds apart. UNIX prefers small executables that do simple tasks, mostly with text, tied together with scripts, where Java (at least at the time) preferred pure-Java libraries assembled into larger applications with graphical interfaces. Sun never seemed to square that circle, and Java felt like a second-class citizen on Solaris.
Re:CS631 – Advanced Programming in the Unix Environment by pjmlp on Sunday October 09, 2022 @05:00PM (#33145295)
Forte IDE was written in Java, the IDE used for Solaris development.

There was a research implementation to write Solaris drivers in Java.

https://dl.acm.org/doi/10.1145/1215995.1215998

The Sun network computing thin clients had plenty of Java into them.

The classical UNIX does one thing well myth was hardly followed by all major UNIX vendors.

Re:CS631 – Advanced Programming in the Unix Environment by ninkendo on Sunday October 09, 2022 @05:28PM (#33145506)
I mean sure, IDE’s are an obvious choice for Java. But the rest of the usages of Java in SunOS I would consider token at best.

One thing I never understood was why I couldn’t just write some Java, compile it [0], and hand the result to someone else on a Solaris system, and have them run it.

Sure, they may know how to run “java -jar myapp.jar”, but why was that necessary? Why couldn’t it be a standalone executable, that didn’t require the end user to know in advance that it was written in Java and to invoke it accordingly?

Every single bit of Java software I ever used on Solaris always had some sort of shell script wrapping it. I never understood why the operating system couldn’t just natively execute Java code… they literally wrote the entire operating system, language, compiler, toolchain, etc, and the end result wasn’t usable without arcane wrapper scripts and JAVA_HOME conventions and so forth. Windows managed to make it work with .NET (they were just .exe’s like everything else), I always thought like Sun could have done so much better with the end-user experience with running Java software.

[0] for any loose, reasonable definition of “compile”. I’m not saying it can’t be byte code, that’s fine… I just don’t want to have to care. I should be able to copy it to /usr/bin and just run it without having to invoke “java -jar”, or use some weird self-extracting shell script trick. And I shouldn’t have to care about whether the person I’m distributing it to has Java installed, because it should have always been the case that a given SunOS machine should have a working Java install… the same company made the OS and the language for chrissakes, every SunOS installation should have had it as a mandatory component.

Re:CS631 – Advanced Programming in the Unix Environment by geofft on Sunday October 09, 2022 @09:28PM (#33146913)
One might hope, but they didn't. How do you tell in Java if stderr is a TTY, and if so, what its width is? How do you do an NSS passwd lookup (as in getpwnam("pjmlp") in C etc.)?

(To be fair, these could be defended, very slightly, on the grounds that Java is a cross-platform language, even though other cross-platform languages have better answers. But then I'd raise the point about Java corrupting RLIMIT_FILES for processes it starts....)

Re:CS631 – Advanced Programming in the Unix Environment by pjmlp on Monday October 10, 2022 @07:22AM (#33150040)
The same way you can tell in Limbo, and its authors did know one or two things about UNIX and its evolution, although this might be considered moving goalposts. :)
Re:CS631 – Advanced Programming in the Unix Environment by willbw on Sunday October 09, 2022 @05:00PM (#33145300)
I honestly mean this with no disrespect but having written code exclusively in vim in the terminal for several years and the same in IntelliJ, I am confident that either: - you don't have to write Java full time, and/or - you don't have to work in a large Java code base, and/or - you haven't been exposed to IntelliJ's features and how they can save you time

I love vim, I really do, but IntelliJ is a Java-specific IDE and there is absolutely no way that vim or emacs or vscode can compete on features. You can refactor code in a split second in ways that are just not possible in vim/emacs. IntelliJ has an understand of the structure of your Java code that vim simply doesn't have and will never catch up to having as its a general purpose tool and IntelliJ is a specific tool. Its vim mode is also pretty good. The only downside of Jetbrains IDEs is that they can be slow when indexing large projects and they can be slow in general. But I would still 10 times out of 10 choose to make a commit in IntelliJ over vim for a Java project that is non-trivial.

If you write Java I would (as strongly as possible) recommend giving IntelliJ another go and looking into its refactoring and other features.

Re:CS631 – Advanced Programming in the Unix Environment by hoistbypetard on Sunday October 09, 2022 @05:38PM (#33145568)
This thread is about a course on Advanced Programming in the Unix Environment. After looking at the content of the course, I'd argue that there's an implied "Systems" between "Advanced" and "Programming". (Indeed, this course is taught using the famous book whose title it borrows, and is heavily C oriented.)

Java is neither common nor especially well suited for the topic of this course.

So while I share your opinion on IntelliJ as a Java IDE, I would not recommend it for UNIX systems programming. And even the IntelliJ-derived Clion, which is (IMO) decent for that, leaves something to be desired when it comes to learning the topic.

Re:CS631 – Advanced Programming in the Unix Environment by __turbobrew__ on Monday October 10, 2022 @12:24AM (#33147777)
The necessity of intellij just shows how much Javas type system is abused. I don’t know what it is about java but you see the craziest types in codebases: IAbstractBeanFactoryResolverInjector<IDisplayableAppletResolverInjector>
Re:CS631 – Advanced Programming in the Unix Environment by weatherlite on Monday October 10, 2022 @01:34AM (#33148119)
Is that the type system's fault or the whole Spring/dependency injection fault? You're using a typed language and making it behave in dynamic ways when using Spring (at least that's the impression I had when I looked at Spring).
Re:CS631 – Advanced Programming in the Unix Environment by misnome on Sunday October 09, 2022 @03:41PM (#33144494)
Sooner or later, in many lines of programming, you are going to find yourself remoted in to a server somewhere that only has the basic tools. That’s probably not the best time to try to learn an editor.
Re:CS631 – Advanced Programming in the Unix Environment by anta40 on Sunday October 09, 2022 @03:48PM (#33144560)
Perhaps "magical" = increased complexity, like you can't just build a standalone source file. You have to setup a project first, configure the required build XML, add your code files to that project, etc etc then finally compile it.

with editors like vim/emacs, it's much simpler, like typing `vim test.c` and `gcc test.c -o test`. OK it's simpler, assuming you already have the toolchain installed properly. In general it's true, a few lines of apt-get/homebrew/etc get the job done.

BTW, I have nothing against IDE. As a Android developer, I won't ditch Android Studio for any editor. But for quickly navigating or building non Java codes, I'm happy with vim + Makefile/scons/etc. Or VSCode, if I'm not in the mood of running full featured IDE.

Re:CS631 – Advanced Programming in the Unix Environment by chrismarlow9 on Sunday October 09, 2022 @04:06PM (#33144723)
For coding in your normal day to day? Sure use intellij. For trying to debug some deep level production only issue where every second of downtime means big money lost? You'll want to know vim/emacs..

Edit: I'll also add that once you learn vim or emacs you'll be far more efficient manipulating text. Sure you could add the bindings to intellij, but I think that's admitting the point is valid. At a point it becomes like a real time meta language where you edit lines the way you would algorithmically.

Re:CS631 – Advanced Programming in the Unix Environment by weatherlite on Sunday October 09, 2022 @04:08PM (#33144754)
Yeah I can see that's possible sure. Though if I have access to the code I just use Github but sometimes I guess that's not possible. Still quite rare though no?
Re:CS631 – Advanced Programming in the Unix Environment by chrismarlow9 on Sunday October 09, 2022 @04:15PM (#33144843)
In some places it's rare, in some places it's a daily occurrence, and sure you should work towards stability, but the reality is you have to fix this thing now with what you have. There's also the fact that even if it's rare I still have to know it. And if you don't use it often you will forget it. And then why learn two tools if I can do everything with 1? With intellij I can only do day to day, with vim I can do mission critical and day to day. I'd also argue that a seasoned vim user can get things done incredibly faster than a seasoned intellij user.
Re:CS631 – Advanced Programming in the Unix Environment by treeman79 on Sunday October 09, 2022 @04:42PM (#33145142)
Vim mode in intelij rocks
Re:CS631 – Advanced Programming in the Unix Environment by monkey26 on Sunday October 09, 2022 @07:22PM (#33146256)
Yeah, I'm torn on this. I wrote C in emacs for 20 years, and still do. But when I write anything else, particularly javascript, java and rust, give me intellij ide's...
Re:CS631 – Advanced Programming in the Unix Environment by weatherlite on Monday October 10, 2022 @01:35AM (#33148127)
Why not Clion for C?
Re:CS631 – Advanced Programming in the Unix Environment by fijiaarone on Sunday October 09, 2022 @11:18PM (#33147406)
Because it teaches you that compile and run aren’t just buttons on a window, it’s taking one or more files (streams of text == data) and translating them into other files.
Re:CS631 – Advanced Programming in the Unix Environment by sqqqqrly on Monday October 10, 2022 @09:50AM (#33151392)
Who cares about java in this context?
Re:CS631 – Advanced Programming in the Unix Environment by ddacunha on Tuesday October 11, 2022 @05:23AM (#33161131)
Quite simply, I may have to login into a server on a high pressure time sensitive environment, think downtime. I want to maintain my vim skills at a level that allow me to focus on the issue. It's also why I use bash and GNU coreutils on my MacBook Pro.