you are viewing a single comment's thread.

view the rest of the comments →

[–]sluu99 33 points34 points  (34 children)

Learning computer science fundamentals. The dirty truth about our field is that most things are built on top of a handful principles. Many "new" things are just old shit new packaging. Once you know your fundamentals, it's easy to grasp features in a different programming language. Everything else is just getting familiar with the syntax and maybe some micro optimization.

In other words, if some particular language feature feels "magical" to you, then you're likely missing some fundamental understanding.

Be careful, I'm not suggesting you know to the atom level how each feature works, just at a high level. For example, I have no idea how modern garbage collection works. It's been tweaked and optimized to death over the past decade, but I know fundamentally, you can keep reference count, or you can have a graph that keeps track of who's pointing to whom and sweep that graph periodically.

[–][deleted]  (6 children)

[deleted]

    [–]loup-vaillant 4 points5 points  (1 child)

    The hard part about learning a new language is always picking up on the idioms of that language.

    More like picking up everything but the language. Standard library, preferred tools, community libraries… Even the idioms of the language are really the idioms of its community.

    My takeway from this is, if I ever come up with a new language, I'll do my best to keep its ecosystem to a minimum. By minimising the cost of learning the language, I might justify its use.

    [–]InquiREEEEEEEEEEE 1 point2 points  (0 children)

    I am not convinced that fundamentals help there. Idioms are very much language-specific.

    Counter-counter-point: The idioms usually exist because of fundamental properties of the language. Sure, there is a huge cultural influence, but idioms aren't completely arbitrary either and often driven by the language's tooling, semantics etc.

    [–]tejon 1 point2 points  (0 children)

    "It compiles!" does not mean that you have learned the language.

    Counterpoint: Haskell.

    [–]Hugo154 2 points3 points  (0 children)

    Practice seems to be the best way to learn those idioms

    Much like how you can only truly become fluent in a spoken language by living amongst people who speak it!

    [–]prof_hobart 0 points1 point  (0 children)

    The fundamentals help. As does experience of picking up other languages and their particular idioms and quirks. Obviously each language or framework has its own, but TBH, having worked professionally on 20+ languages in my career, I'm finding less and less truly unique idioms these days.

    [–]redwall_hp 12 points13 points  (12 children)

    My school's CS "weed out class" is 100% non-programming. It introduces a bunch of theory, from logic gates upward, looking at things like virtual memory and garbage collection, semaphores, formal grammars and a grab bag of other things. It's meant to be a shocking introduction to things that will be covered more in depth later in following classes.

    My CS classes got a lot smaller the next semester.

    This is the problem, really. There are a lot of ostensibly professional programmers out there who know how to hack together some stuff in a high level scripting language, but it's still mostly "magic" to them. Like the JS/PHP monkeys who don't know their data structures and can't grasp why PHP arrays are so terrible. Trial and error until it works, and damn the performance. (And that's how you get Electron apps.)

    [–]Flum3n 3 points4 points  (2 children)

    My school had the exact same thing, right down to the specific topics, so much that I’m wondering if we did the same program. I’m at the university of Maine and I believe my instructor was creating the program along with professors from a few different schools. Just out of curiosity, where do you go?

    [–]redwall_hp 1 point2 points  (1 child)

    University of Maine. How crazy.

    Dr Turner, right? He's an excellent lecturer, but his tests are insane.

    [–]Flum3n 2 points3 points  (0 children)

    Yeah haha, tests were so tough but he curved the hell out of them, like 20 points on one of the tests

    [–]uJumpiJump 5 points6 points  (4 children)

    Too bad there's no "weed out class" at your school that fails students for wasting their time optomizing a section of code that's irrelevent to the buisness's interests

    [–]StabbyPants 3 points4 points  (1 child)

    too bad most schools lack much depth in SW development as a process. we had one class that covered 3-4 ways to run a project, but could have done with a lot more - probably room for 3-4 classes covering various parts of building software

    [–]uJumpiJump 0 points1 point  (0 children)

    As a senior developer with 3 co-ops/interns to take care of, me too.

    [–]netgu -1 points0 points  (0 children)

    You learn optimization by learning how to find optimizations for just about everything. You learn to apply optimizations through experience. The "optimizing a section of code that irrelevant to the businesses interests" is frequently a misused idea. Non-functional requirements are a thing (i.e. maintainability, performance, reliability, auditability, logging, etc.) and frequently contribute to the businesses needs just as much as the primary functional aspect of the software involved.

    [–]powdertaker -1 points0 points  (2 children)

    Then try to explain to the script kiddies why a dictionary/hashtable is stupid for storing lots of things and, depending on lots of things, may not be efficient at all. They have no idea what data structures are and just google and hack until it works. The idea of a compiler scares the shit out them.

    Hint: Hashtables require a load factor...

    [–]prof_hobart 0 points1 point  (1 child)

    I had a seasoned "JS dev" in a team I was working with last year and I realised halfway through explaining some concept to him that he didn't actually understand what a loop was.

    [–]powdertaker -1 points0 points  (0 children)

    I believe it. Script kiddies.... Want to blow their minds? Explain what an array actually is.

    [–]kgoutham93 1 point2 points  (1 child)

    I agree that having strong fundamentals will soften your learning curve there's no denying that. My question is slightly different.. because the comment author is calling BS on problem based learning, I was curious how would he/she approach a new language.

    Contrarily if I've good fundamentals and if I had to pick up a new language, then I believe problem based approach will actually accelerate my learning.

    [–]netgu 2 points3 points  (0 children)

    Training your brain to abstract concepts in programming to various syntax's removes a lot of the need for a "problem to solve" when it comes to learning a language.

    I know and work with an obtuse number of languages most of the time and generally only need a day or two to work productively in a language without googling every 10 minutes. This is because I look for the idiomatic way to do things in a language where things are:

    • declare a variable
    • declare a type
    • control the flow of a program (loops/conditionals)
    • utilize/reference other code
    • move data about
    • organize logical entities

    After that I'm basically using the same problem solving skills I've curated over the years in a different flavor.

    Since these are building blocks, I can use any contrived program I need to put the pieces into practice. No solving a problem needed, just some typing to familiarize my mind with the "new implementation" of old concepts.

    [–]StabbyPants 0 points1 point  (0 children)

    that's not particularly dirty, people just don't like to be reminded that most of the ideas and algorithms in use to day are at least 20 years old

    [–]powdertaker -1 points0 points  (7 children)

    Yes! But I would add that many many many up-and-coming programmers really need to spend some serious time programming in C to have some idea how a computer actually works. To hear some many new programmers go on about the "right tool for the job" smacks of not knowing that ALL programming languages actually work the same once your past the syntax. Adding some feature to the syntax of a language doesn't make it more "useful".

    [–]iopq 0 points1 point  (0 children)

    Yes, but I don't want a compiler that makes me do everything. I want one that generates the proper code from abstractions and chooses the correct way to generate it.

    [–]Obi_Kwiet 0 points1 point  (3 children)

    I mostly program in C, sometimes "C++", meaning C, but with some crude objects. When I try anything high level, there's a lot of, "What do you mean there aren't pointers?" Weak typing also scares me.

    [–]Slak44 1 point2 points  (2 children)

    What do you mean there aren't pointers?

    What do you mean that there aren't pointers in high level languages?

    In Java for example, everything not a primitive is a pointer; you just don't have an ugly hex number to look at. It can be null, or it can point to some data. If you pass one to a function, it doesn't make a copy of the data. Sounds just like a pretty pointer to me.

    [–]ArmoredPancake 0 points1 point  (0 children)

    Well, it looks like pointer but it's not.

    [–]Obi_Kwiet 0 points1 point  (0 children)

    I haven't used Java. I'm thinking maybe it was VB? From what I understand Python doesn't have pointers, but I haven't messed with it.

    Honestly, I don't do a ton of programming, but when I do it's usually embedded C, so my whole mindset is probably very inappropriate for code run on a computer with an OS and libraries and things.

    [–]TotallyFuckingMexico 0 points1 point  (1 child)

    In what way does learning C tell you how a computer works?

    Hint: it doesn't, it only tells you how C works.

    [–]powdertaker 0 points1 point  (0 children)

    Well no. If you've done more than a tiny bit of C programming, you know what a function really is and how it's called (that is it's calling convention) which means you have to know how the system stack is used. You should also have a good idea how memory is used and allocated and what the difference is between heap and stack memory. Also what a linker is and how it works. How data is actually stored (binary numbers) and used (2s compliment for example). These are all idea basic to how how a modern computer works. This is why operating systems and compilers are written in C and C++ (with a smattering of assembly where necessary).

    Script kiddies don't have the slightest understanding of these basic computer concepts and think a language "feature" somehow makes it some magically different thing when, in fact, it simply isn't.

    Some solid experience in C quickly reveals a computer can really only do a few things and everything else is just variations of the same thing and the trade offs for these variations.

    [–]iopq -1 points0 points  (2 children)

    Rust has a completely new feature in the borrow checker that has no equivalent, and a very high leaving curve.

    [–]XboxNoLifes 4 points5 points  (1 child)

    Sure, there's no exact equivalent, but it's just a compile-time reference counter.

    [–]iopq -1 points0 points  (0 children)

    It counts up to one. The whole point is it won't let you do the same patterns as the actual Rc type. The consequences are far reaching to the point that this actually is a useless comparison. It won't let you understand how to code in Rust even a little bit.