Modern "Hello World"



  • It’s easy to imagine that a “Hello, World” program is just for beginners, but most every project starts with that intimidating empty directory. Often a realistic project “Hello, World” requires a suspiciously difficult and complicated process with lots of moving parts. For example, creating the very basic scaffolding for a Java program in Maven constructs ten directories and subdirectories to build a literal “Hello, World” program in Java, while the Maven build and dependency manager program downloads 1350 files into more than 550 directories.

    This is hardly just a property of Java or Maven. Building a new React app with create-react-app requires 4304 directories and 28678 files.

    :wtf_owl: :wtf_owl: :wtf_owl:


  • Considered Harmful

    I see "Hello, World!" as much as an end-to-end test of a full stack as I see it as an introductory program.


  • ♿ (Parody)

    @Mason_Wheeler said in Modern "Hello World":

    For example, creating the very basic scaffolding for a Java program in Maven constructs ten directories and subdirectories to build a literal “Hello, World” program in Java, while the Maven build and dependency manager program downloads 1350 files into more than 550 directories.

    So...adding a powerful dependency maintainer and build system complicates things? TRWTF is the idiot who thinks this is some kind of...interesting thing to say.



  • @boomzilla It's interesting in the context of Hello World, aka The Simplest Possible Program You Can Have. Why should a build system, "powerful" or otherwise, need to pull in over 1000 files to do nothing more than write to the console?


  • Java Dev

    @Mason_Wheeler said in Modern "Hello World":

    @boomzilla It's interesting in the context of Hello World, aka The Simplest Possible Program You Can Have. Why should a build system, "powerful" or otherwise, need to pull in over 1000 files to do nothing more than write to the console?

    Well, the program which simply returns 0 or 1 is simpler.


  • ♿ (Parody)

    @Mason_Wheeler said in Modern "Hello World":

    @boomzilla It's interesting in the context of Hello World, aka The Simplest Possible Program You Can Have. Why should a build system, "powerful" or otherwise, need to pull in over 1000 files to do nothing more than write to the console?

    Why would you do all that to make a Hello World program in java? It's like comparing using a "simple" hammer and nail vs using an air hammer and then complaining that you have to buy special nails to load into the gun, then you need to get an air compressor and plug it in, then connect the hammer to the compressor before you can drive a nail.


  • Considered Harmful

    ca. 1971, EWD said:

    A very large program is, by necessity, composed of a large number, say N, individual components and the fact that N is large implies that the individual program components must be produced with a very high confidence level. If for each individual component the probability of being right equals p, for the whole program the probability P of being right will satisfy

    P ≤ pN

    and if we want P to differ appreciably from zero, p must be very close to one, because N is so large.

    @error said in Modern "Hello World":

    I see "Hello, World!" as much as an end-to-end test of a full stack as I see it as an introductory program.

    This is as much true as the opposite. For any non-trivial program it's just the beginning of the full stack, which will likely integrate third party systems (bug workarounds), legacy garbage (bug preservation), shifting requirements and breaking regressions to dependencies, your prelimitary test therefore luring you into having false sense of confidence.


  • Discourse touched me in a no-no place

    @Mason_Wheeler said in Modern "Hello World":

    Often a realistic project “Hello, World”

    :wtf:

    @Mason_Wheeler said in Modern "Hello World":

    For example, creating the very basic scaffolding for a Java program in Maven constructs ten directories and subdirectories to build a literal “Hello, World” program in Java, while the Maven build and dependency manager program downloads 1350 files into more than 550 directories.

    Anyone who uses Maven in a "Hello, World" program deserves the pain.


  • ♿ (Parody)

    @loopback0 said in Modern "Hello World":

    Anyone who uses Maven in a "Hello, World" program deserves the pain.

    It's not unreasonable for the purpose of learning Maven. But that's not what the mug people in this thread are talking about.


  • Fake News

    @Mason_Wheeler said in Modern "Hello World":

    @boomzilla It's interesting in the context of Hello World, aka The Simplest Possible Program You Can Have. Why should a build system, "powerful" or otherwise, need to pull in over 1000 files to do nothing more than write to the console?

    Maven is a dependency manager and plugin-based build system. It's likely downloading all the latest versions of the build plugins, which in turn have a whole bunch of dependencies.

    Sure, it might look like it's downloading half the Internet, but don't forget that other languages might also have tons of files under the hood. My MSBuild directory from my Visual Studio install contains 7 137 files, are you similarly going to indignantly complain that "you need all of those to start developing Hello World?!?".

    What matters more IMHO is how much hoops you need to jump through, how big a resulting program would be and how long developing all of your starter program actually took.


  • ♿ (Parody)

    @levicki said in Modern "Hello World":

    @boomzilla said in Modern "Hello World":

    It's like comparing using a "simple" hammer and nail vs using an air hammer and then complaining that you have to buy special nails to load into the gun, then you need to get an air compressor and plug it in, then connect the hammer to the compressor before you can drive a nail.

    I think this is a bad analogy.

    Using a "simple" hammer is simple -- point at the nail and hit. Repeat until nail visible.

    Using a "powertool" such as air hammer shouldn't be more complex than pointing at the nail and pressing the trigger. It shouldn't require complicated assembly process you are describing.

    :wtf_owl: How the fuck else would it work?! Magic? Also, what's complicated about that? Are you unable to make a piece of toast because plugging in the toaster is too complicated? Also, it's not really complicated, just the requirement to get all the great stuff the hammer gives to you. Same as with Maven.


  • Considered Harmful

    I linked my favorite EWD's lecture in equal parts to complain about inescapable woes of complexity and to show that all of this has been seen as a problem two generations ago already.

    It works a lot better when you forget that TFA is about Hello World (a rather misguided, clickbaity stuff, really) and remember that any decent deliverable serving any half serious purpose will have to have the full stack after all.

    And then there's no escaping that one basic rule - the more complex gun you have, the more it gravitates towards your feet.

    When you control and have at least a passing understanding of every part of your stack (or know someone who does), it's all good. Count how many years of practical and evolving experience you have and what it took you to acquire all that understanding. Modern development stacks are fucking ridiculous.

    Perhaps you're like the old car mechanic :arrows: that could tell a bad spark plug by sound alone. But if we suddenly all buy Teslas, he may very well have to close down the shop.

    How much time it would take you to get to grips with another sort of stack if, let's suppose, yours suddenly blinked out of existance? A few weeks? Months, perhaps? You could be a smart fellow that digs stuff - that definitely helps.

    I'm certainly not, my little brain misfires and emits toxic particulates as it is. If this gig doesn't work out, I may have to lern to code :tro:... wait a minute...

    But here's the kicker! Your extensive experience and acuity is often not an advantage! Someone less experienced than you will promise to deliver the same thing for less money, ignoring parts they don't understand, gluing things together with snot and hope, engineering kludges and quick hacks, pushing some silly putty where it leaks. And they will get that job, because for the most part it will work, too. After all, the key to happiness is reducing your expectations.

    If you get some masochistic satisfaction out of that (and maybe lots of money, because you're the HPC contracted to sort out the mess), good for you. Otherwise... well... that's where :trwtf: is.



  • Some interesting viewpoints. When I am starting a new (real world) project me "source code" is often something very much like "Hello World" - along with the work tracking infrastructure, testing infrastructure, build infrastructure, deployment infrastructure, et. al. that will be needed. Only after this is working does the code start to expand....



  • @levicki said in Modern "Hello World":

    Is part of Visual Studio install and it is not even necessary for say C++ compiler to compile a Hello World application.

    Maven isn't necessary to build a Java hello world either. The only thing you need is javac.



  • @boomzilla said in Modern "Hello World":

    It's not unreasonable for the purpose of learning Maven.

    Why would you want to do that in the first place? 🐠


  • ♿ (Parody)

    @dfdub said in Modern "Hello World":

    @boomzilla said in Modern "Hello World":

    It's not unreasonable for the purpose of learning Maven.

    Why would you want to do that in the first place? 🐠

    💰



  • @Applied-Mediocrity said in Modern "Hello World":

    But here's the kicker! Your extensive experience and acuity is often not an advantage! Someone less experienced than you will promise to deliver the same thing for less money, ignoring parts they don't understand, gluing things together with snot and hope, engineering kludges and quick hacks, pushing some silly putty where it leaks. And they will get that job, because for the most part it will work, too. After all, the key to happiness is reducing your expectations.

    They would be welcome to it. I don't really need a client that want quick, retarded and barely functional.

    If you get some masochistic satisfaction out of that (and maybe lots of money, because you're the HPC contracted to sort out the mess), good for you. Otherwise... well... that's where is.

    Well... There is a fair bit of money in it, but I'd prefer if the fucknuggets just got into journalism instead. Telling clients that the system they paid meeellions for is shut and unsalvageable isn't particularly fun.



  • @Applied-Mediocrity said in Modern "Hello World":

    When you control and have at least a passing understanding of every part of your stack (or know someone who does), it's all good. Count how many years of practical and evolving experience you have and what it took you to acquire all that understanding. Modern development stacks are fucking ridiculous.

    Yeah, I have an almost obsessive need to understand all the parts of my stack, and I'm very aware of that.

    I'll always say this: why did the "fractal of bad design" PHP power the entire internet for so long? Because IT'S FUCKING EASY TO UNDERSTAND. There's requests, there's .php files in a folder, Apache finds the file that matches the request, and runs the PHP module that executes it with some magic global functions and the output gets sent. Put your crappy code in there with your crappy HTML and your web app works. That's pretty much all there is to know! If something's broken, you just look in there.

    Compare with ASP.NET Core where there's an IHostBuilder that you call ConfigureWebHostDefaults on to make an IWebHostBuilder that calls your Startup class and gives you an IServiceCollection and an IApplicationBuilder and an IWebHostEnvironment and you call a whole bunch of magic extension methods on the IServiceCollection to register the classes it needs to work, then you call similar magic extension methods on the IApplicationBuilder to build a pipeline of callback functions to process the requests, then you build the host, then you call IHost.Run() which calls IHost.StartAsync() which calls IHostLifetime.WaitForStartAsync() which registers events on the IHostApplicationLifetime, and then calls all the IHostedService.StartAsync() methods which actually starts the web server plugged into that pipeline of callback functions which finally include the Razor Pages module…

    …which contains a whole lot of conventions that tell it where to look for files that will be and compiled and instantiated along with a second "model" file that will be instantiated and will get some of its methods called according to the same conventions, with some HTTP parameters magically turned into .net objects according to the model binder.

    And of course the whole of EF Core (with the contexts and the migrations and the model builders and the navigation properties and the shadow properties…) and the various routing systems and the identity modules and the tag helpers and the partial views. All of which are necessary to understand to actually start building stuff.



  • The author's point isn't that "hello world" is hard to write if you use Maven.

    His point is that it's getting harder to start actually writing useful, potentially commercial, software, because you have a bunch of stuff to do before you can even build it. This is especially true if you want to do it "right", from the start.

    You start with a "template" (frequently provided by your IDE, for example; and which typically does nothing more than "hello world"...). And that requires a build environment. And if you're going to use all the fancy newest techs, to do your commercial project right, from the start, you're going to end up using a whole lot of stuff, like configuration management or containerization, package management, version control, continuous deployment/integration, etc.

    Granted, these tools are here to help us, but the learning curve is turning into a bigger cliff than Vim's.



  • @Mason_Wheeler said in Modern "Hello World":

    most every project starts with that intimidating empty directory.

    For me, the empty dir is not intimidating. Let's create main.py and start building something.
    What's intimidating is the ginormous result of running create-react-app or ng new or whatever.


  • Considered Harmful

    @Captain said in Modern "Hello World":

    the learning curve is turning into a bigger cliff than Vim's.

    Steep learning curves keep the Highly Paid Consultants highly paid. We must uphold the priesthood.



  • @anonymous234 you don't need to know any of that stuff though, because they do it all for you. You might have to go into some of that stuff occasionally, but it's not like you have to know how to construct all of that manually.



  • @anonymous234 said in Modern "Hello World":

    Compare with ASP.NET Core where there's an IHostBuilder that you call ConfigureWebHostDefaults on to make an IWebHostBuilder that calls your Startup class and gives you an IServiceCollection and an IApplicationBuilder and an IWebHostEnvironment and you call a whole bunch of magic extension methods on the IServiceCollection to register the classes it needs to work, then you call similar magic extension methods on the IApplicationBuilder to build a pipeline of callback functions to process the requests, then you build the host, then you call IHost.Run() which calls IHost.StartAsync() which calls IHostLifetime.WaitForStartAsync() which registers events on the IHostApplicationLifetime, and then calls all the IHostedService.StartAsync() methods which actually starts the web server plugged into that pipeline of callback functions which finally include the Razor Pages module…

    I have zero experience with ASP.NET, but that still sounds better to me than going anywhere near the clusterfuck called Tomcat.



  • @Magus but you do have to know which piece of code goes in which of the 47000 different places. Which is different per framework and template. And you're basically flying blind of something breaks or is unexpected. So yes, you do have to understand quite a lot of the complicated mess.



  • @Magus Not all the IWebHostBuilder stuff (that was just me wanting to know wtf is going on under the hood), but you do have to know

    • most of EF Core (DbContexts, migrations, model builders, navigation properties)
    • the basics of dependency injection
    • the basics of the "middleware pipeline"
    • the Razor Pages folder and file naming conventions
    • the MVC/MVVM patterns
    • the model handler naming conventions (OnGetCustomthingAsync)
    • the basics of the model binder
    • routing (if you want to deviate from the default pattern)
    • the basics of the identity system (which is probably the most complex thing on the list!)
    • tag helpers and partial views

    before you can build any real systems. And that list is way too long.



  • @anonymous234 while I'm with you entirely on the identity component, and EF can admittedly be complicated, all the rest of that is pretty straightforward. It's only if you want to change routing and such that it starts getting weird, but you really don't need to do that.



  • @Mason_Wheeler

    Hello World
    Maven dependencies

    I don't know who Charles R. Martin is, but I've immediately come up with a guess for what the "R" stands for



  • @Captain said in Modern "Hello World":

    but the learning curve is turning into a bigger cliff than Vim's.

    The difference is that learning Maven actually has the potential to be useful


  • Considered Harmful

    @hungrier said in Modern "Hello World":

    Charles R. Martin

    I don't know but I've given up on waiting for book six.



  • @Captain said in Modern "Hello World":

    use all the fancy newest techs ...
    do your ... project right

    One of these does not follow from the other.



  • @anonymous234 said in Modern "Hello World":

    Compare with ASP.NET Core where there's an IHostBuilder that you call ConfigureWebHostDefaults on to make an IWebHostBuilder that calls your Startup class and gives you an IServiceCollection and an IApplicationBuilder and an IWebHostEnvironment and you call a whole bunch of magic extension methods on the IServiceCollection to register the classes it needs to work, then you call similar magic extension methods on the IApplicationBuilder to build a pipeline of callback functions to process the requests, then you build the host, then you call IHost.Run() which calls IHost.StartAsync() which calls IHostLifetime.WaitForStartAsync() which registers events on the IHostApplicationLifetime, and then calls all the IHostedService.StartAsync() methods which actually starts the web server plugged into that pipeline of callback functions which finally include the Razor Pages module…

    No wonder modern web pages are so slow. It takes 10 CPU seconds just to get to the point where you can start generating actual content.



  • @levicki I've had clients that actually believe me for a bunch of years now, but yes, I've worked with those as well. I usually just find the email where everything was explained and forward it to them to kill any such discussions.
    If they still want something, I'll fix it. But I don't do stress, something I always tell clients up front. When they inevitably want me to stress out, I tell them again.



  • @levicki said in Modern "Hello World":

    I think this is a bad analogy.

    Yours isn't much better.

    Using a "simple" hammer is simple -- point at the nail and hit. Repeat until nail visible.

    If you make the nail visible by hitting it, was it invisible before? Are you leaving it sticking out of the surface?

    And if you meant no longer visible, that's weird, too. Do you really hit the nail so much that it falls out other side of the surface?

    😆


  • kills Dumbledore

    @boomzilla said in Modern "Hello World":

    @Mason_Wheeler said in Modern "Hello World":

    @boomzilla It's interesting in the context of Hello World, aka The Simplest Possible Program You Can Have. Why should a build system, "powerful" or otherwise, need to pull in over 1000 files to do nothing more than write to the console?

    Why would you do all that to make a Hello World program in java? It's like comparing using a "simple" hammer and nail vs using an air hammer and then complaining that you have to buy special nails to load into the gun, then you need to get an air compressor and plug it in, then connect the hammer to the compressor before you can drive a nail.

    Can you rephrase in the form of a car analogy please?


  • Discourse touched me in a no-no place

    @Mason_Wheeler said in Modern "Hello World":

    :wtf_owl: :wtf_owl: :wtf_owl:

    The main source of the complexity seems to be in the vast array of libraries/frameworks used, and the cached bits and pieces that those require to work. Expand out all the little bits and pieces that all that is made of and you have a great deal of complexity. But you also have that with C compilers; the header files you have for basic system libraries are numerous, and the internal complexity of any modern compiler is pretty intense. The fact that it's hidden behind a “simple” callable interface doesn't really change that.

    The only really horrible things in all this are how much stuff gets expanded out unnecessarily. And the overuse of heavyweight libraries and frameworks for trivial tasks, but that's because the trivial tasks are proxies for substantive things and the article makes that crystal clear.

    (28678 files for create-react-app is still an Abomination Unto Nuggan.)


  • BINNED

    @anonymous234 said in Modern "Hello World":

    Compare with ASP.NET Core where there's an IHostBuilder that you call ConfigureWebHostDefaults on to make an IWebHostBuilder that calls your Startup class and gives you an IServiceCollection and an IApplicationBuilder and an IWebHostEnvironment and you call a whole bunch of magic extension methods on the IServiceCollection to register the classes it needs to work, then you call similar magic extension methods on the IApplicationBuilder to build a pipeline of callback functions to process the requests, then you build the host, then you call IHost.Run() which calls IHost.StartAsync() which calls IHostLifetime.WaitForStartAsync() which registers events on the IHostApplicationLifetime, and then calls all the IHostedService.StartAsync() methods which actually starts the web server plugged into that pipeline of callback functions which finally include the Razor Pages module…

    I am struggling to discern if this is parody or it actually works like that. 🤔

    And no, I'm not going to google to find out. :kneeling_warthog:


  • Banned

    @Jaloopa said in Modern "Hello World":

    @boomzilla said in Modern "Hello World":

    @Mason_Wheeler said in Modern "Hello World":

    @boomzilla It's interesting in the context of Hello World, aka The Simplest Possible Program You Can Have. Why should a build system, "powerful" or otherwise, need to pull in over 1000 files to do nothing more than write to the console?

    Why would you do all that to make a Hello World program in java? It's like comparing using a "simple" hammer and nail vs using an air hammer and then complaining that you have to buy special nails to load into the gun, then you need to get an air compressor and plug it in, then connect the hammer to the compressor before you can drive a nail.

    Can you rephrase in the form of a car analogy please?

    You build yourself a car. A bunch of nerds comes screaming at you that you can't do that because it won't meet the thousands of regulations.



  • @topspin said in Modern "Hello World":

    @anonymous234 said in Modern "Hello World":

    Compare with ASP.NET Core where there's an IHostBuilder that you call ConfigureWebHostDefaults on to make an IWebHostBuilder that calls your Startup class and gives you an IServiceCollection and an IApplicationBuilder and an IWebHostEnvironment and you call a whole bunch of magic extension methods on the IServiceCollection to register the classes it needs to work, then you call similar magic extension methods on the IApplicationBuilder to build a pipeline of callback functions to process the requests, then you build the host, then you call IHost.Run() which calls IHost.StartAsync() which calls IHostLifetime.WaitForStartAsync() which registers events on the IHostApplicationLifetime, and then calls all the IHostedService.StartAsync() methods which actually starts the web server plugged into that pipeline of callback functions which finally include the Razor Pages module…

    I am struggling to discern if this is parody or it actually works like that. 🤔

    And no, I'm not going to google to find out. :kneeling_warthog:

    It actually works like that, but you only really need to know some of it. Specifically, how to configure the IHostBuilder and add stuff to the IServiceCollection (which controls dependency injection in ASP.NET MVC).


  • area_pol

    @Applied-Mediocrity said in Modern "Hello World":

    After all, the key to happiness is reducing your expectations.

    You've just made my day, week, month, and all the years to come.


  • BINNED

    @strangeways said in Modern "Hello World":

    @Applied-Mediocrity said in Modern "Hello World":

    After all, the key to happiness is reducing your expectations.

    You've just made my day, week, month, and all the years to come.

    That's some high expectations you got there. 🏆


  • area_pol

    @topspin said in Modern "Hello World":

    @strangeways said in Modern "Hello World":

    @Applied-Mediocrity said in Modern "Hello World":

    After all, the key to happiness is reducing your expectations.

    You've just made my day, week, month, and all the years to come.

    That's some high expectations you got there. 🏆

    That's what you get thanks to living in eastern Europe.



  • @strangeways said in Modern "Hello World":

    @Applied-Mediocrity said in Modern "Hello World":

    After all, the key to happiness is reducing your expectations.

    You've just made my day, week, month, and all the years to come.

    Hi Wally!



  • @powerlord and even then, only when the need for one of those things comes up. Definitely not up front, or when trying to make the words "hello world" display on the app the IDE spits out for you.


  • Considered Harmful

    @Gąska said in Modern "Hello World":

    @Jaloopa said in Modern "Hello World":

    @boomzilla said in Modern "Hello World":

    @Mason_Wheeler said in Modern "Hello World":

    @boomzilla It's interesting in the context of Hello World, aka The Simplest Possible Program You Can Have. Why should a build system, "powerful" or otherwise, need to pull in over 1000 files to do nothing more than write to the console?

    Why would you do all that to make a Hello World program in java? It's like comparing using a "simple" hammer and nail vs using an air hammer and then complaining that you have to buy special nails to load into the gun, then you need to get an air compressor and plug it in, then connect the hammer to the compressor before you can drive a nail.

    Can you rephrase in the form of a car analogy please?

    You build yourself a car. A bunch of nerds comes screaming at you that you can't do that because it won't meet the thousands of regulations.

    You decide to start with a prefab. Lolomgwtfbbq this car has thousands of components and I haven't even customized it yet! Do we seriously need an... squints engine?



  • @error said in Modern "Hello World":

    @Gąska said in Modern "Hello World":

    @Jaloopa said in Modern "Hello World":

    @boomzilla said in Modern "Hello World":

    @Mason_Wheeler said in Modern "Hello World":

    @boomzilla It's interesting in the context of Hello World, aka The Simplest Possible Program You Can Have. Why should a build system, "powerful" or otherwise, need to pull in over 1000 files to do nothing more than write to the console?

    Why would you do all that to make a Hello World program in java? It's like comparing using a "simple" hammer and nail vs using an air hammer and then complaining that you have to buy special nails to load into the gun, then you need to get an air compressor and plug it in, then connect the hammer to the compressor before you can drive a nail.

    Can you rephrase in the form of a car analogy please?

    You build yourself a car. A bunch of nerds comes screaming at you that you can't do that because it won't meet the thousands of regulations.

    You decide to start with a prefab. Lolomgwtfbbq this car has thousands of components and I haven't even customized it yet! Do we seriously need an... squints engine?

    "Surely those wheels are optional, right?"



  • There's a funny song I heard several years ago, it basically plays as a car ad, showing off the amazing standard features of the Gambertuni, with such luxuries as the wheels and the brakes. Unfortunately, I can't find a non-awful-quality version of it on YouTube... and also it's in Spanish so most people here wouldn't understand it anyway.



  • @Mason_Wheeler This isn't it at all, but is hilarious nonetheless (NSFW language)

    Big Bill Hell's – 01:01
    — pud


Log in to reply